Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting ci #45

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Run linter
run: yarn lint
12 changes: 3 additions & 9 deletions presentation/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ import {
Box,
CodePane,
Deck,
FlexBox,
FullScreen,
Heading,
Image,
ListItem,
Notes,
Progress,
Quote,
Slide,
Text,
UnorderedList,
} from "spectacle";

const images = {
Expand All @@ -33,8 +27,8 @@ const images = {
const Presentation = () => (
<Deck>
<Slide>
<Heading>Using Chrome's console</Heading>
<Heading fontSize="h3">It's not just console.log anymore</Heading>
<Heading>Using Chrome&apos;s console</Heading>
<Heading fontSize="h3">It&apos;s not just console.log anymore</Heading>
<Text>
Created by <a href="http://github.com/doug-wade">Doug Wade</a> / <a href="https://mastodon.xyz/@dougwade">@dougwade</a>
</Text>
Expand Down Expand Up @@ -170,7 +164,7 @@ console.dir(characters[3]);
console.table(characters);`}
</CodePane>
<Notes>
Here's code with dates to show dates
Here&apos;s code with dates to show dates
<CodePane language="javascript">{`
console.dir({ name: 'Archer', age: 37, aliases: ['Duchess', 'Randy'], created: new Date() });
`}</CodePane>
Expand Down
31 changes: 14 additions & 17 deletions presentation/meet-react-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ import {
Box,
CodePane,
Deck,
FlexBox,
FullScreen,
Heading,
Image,
ListItem,
UnorderedList,
Notes,
Progress,
Slide,
Text
} from "spectacle";
Expand Down Expand Up @@ -40,27 +37,27 @@ const Presentation = () => (
<UnorderedList>
<ListItem>Thank Max Stoiber for the intro to css</ListItem>
<ListItem>Express excitement to be in Amsterdam</ListItem>
<ListItem>Going to talk about my favorite FOSS project, though we'll see after James Kyle's talk ;)</ListItem>
<ListItem>Going to talk about my favorite FOSS project, though we&apos;ll see after James Kyle&apos;s talk ;)</ListItem>
</UnorderedList>
</Notes>
</Slide>

<Slide>
<Heading>What's wrong?</Heading>
<Heading>What&apos;s wrong?</Heading>
<Heading fontSize="h3">Javascript Fatigue</Heading>
<Image width="65%" src={images.jsFatigue} />

<Notes>
<UnorderedList>
<ListItem>There are too many tools, and they change too often.</ListItem>
<ListItem>The tooling is complicated to set up, and inaccessible for "joe and jane developer".</ListItem>
<ListItem>The tooling is complicated to set up, and inaccessible for &quot;joe and jane developer&quot;.</ListItem>
<ListItem>it took us many months/tries/mistakes to get a universal react app working well.</ListItem>
</UnorderedList>
</Notes>
</Slide>

<Slide>
<Heading>What's wrong?</Heading>
<Heading>What&apos;s wrong?</Heading>
<Heading fontSize="h3">Slow Internet</Heading>
<Image width="65%" src={images.mobileVsFixed} />
<Text>Credit/Source: <a href="http://www.itu.int/en/ITU-D/Statistics/Pages/facts/default.aspx">ITU ICT Facts and Figures 2016</a></Text>
Expand All @@ -70,22 +67,22 @@ const Presentation = () => (
<ListItem>From the The International Telecommunication Union, a branch of the UN</ListItem>
<ListItem>Most internet users are on mobile.</ListItem>
<ListItem>Most internet users are not in the first world.</ListItem>
<ListItem>Most internet users don't have the patience to wait while your 4 MB bundle downloads</ListItem>
<ListItem>Most internet users don&apos;t have the patience to wait while your 4 MB bundle downloads</ListItem>
<ListItem>(47% of consumers expect a web page to load in 2 seconds or less).</ListItem>
</UnorderedList>
</Notes>
</Slide>

<Slide>
<Heading>What's wrong?</Heading>
<Heading>What&apos;s wrong?</Heading>
<Heading fontSize="h3">No Javascript</Heading>
<Image src={images.noJs} />

<Notes>
<UnorderedList>
<ListItem>Primarily an SEO problem.</ListItem>
<ListItem>Some users blocking because of ads or security.</ListItem>
<ListItem>Has the added benefit of maintaining the "document" nature of the web</ListItem>
<ListItem>Has the added benefit of maintaining the &quot;document&quot; nature of the web</ListItem>
</UnorderedList>
</Notes>
</Slide>
Expand All @@ -101,7 +98,7 @@ const Presentation = () => (
<Notes>
<UnorderedList>
<ListItem>
They're p similar: they all come with a babel preset,
They&apos;re p similar: they all come with a babel preset,
webpack configuration
</ListItem>

Expand Down Expand Up @@ -193,8 +190,8 @@ const Presentation = () => (
<Notes>
<UnorderedList>
<ListItem>Address impatient users by getting chunks on the page as soon as possible</ListItem>
<ListItem>Prevent users from clicking on the wrong element when the page "jumps" (Dark Pattern)</ListItem>
<ListItem>Treat the page like a document that "snaps in" as soon as it is ready</ListItem>
<ListItem>Prevent users from clicking on the wrong element when the page &quot;jumps&quot; (Dark Pattern)</ListItem>
<ListItem>Treat the page like a document that &quot;snaps in&quot; as soon as it is ready</ListItem>
<ListItem>The page becomes interactive as soon as above-the-fold content is loaded but no sooner</ListItem>
</UnorderedList>
</Notes>
Expand All @@ -208,7 +205,7 @@ const Presentation = () => (
<Notes>
<UnorderedList>
<ListItem>Send a bundle of data + code that was used for server rendering so the DOM render the same.</ListItem>
<ListItem>client-side rendering "prequests" that the server ready a data bundle and hold it until the request</ListItem>
<ListItem>client-side rendering &quot;prequests&quot; that the server ready a data bundle and hold it until the request</ListItem>
</UnorderedList>
</Notes>
</Slide>
Expand Down Expand Up @@ -280,7 +277,7 @@ export default class ExamplePage {
<Notes>
<UnorderedList>
<ListItem>Lifecycle methods are specially named methods that React Server calls as part of the page lifecycle</ListItem>
<ListItem>React Server provides "best-guess" defaults for all lifecycle methods</ListItem>
<ListItem>React Server provides &quot;best-guess&quot; defaults for all lifecycle methods</ListItem>
<ListItem>This example adds meta tags and a title to the page head</ListItem>
</UnorderedList>
</Notes>
Expand Down Expand Up @@ -340,7 +337,7 @@ export default class ExamplePage {
<Notes>
<UnorderedList>
<ListItem>External synchronous js file can significantly impact perf by blocking</ListItem>
<ListItem>devs define css + js in a structured way so they can't tank perf</ListItem>
<ListItem>devs define css + js in a structured way so they can&apos;t tank perf</ListItem>
<ListItem>prepares us for http2 by creating a manifest of js + css to push</ListItem>
<ListItem>body classes allow you to add classes to the generated body tag</ListItem>
</UnorderedList>
Expand Down Expand Up @@ -482,7 +479,7 @@ navigator.on("loadComplete", onLoadComplete);`}
</Slide>

<Slide>
<Heading>What's next?</Heading>
<Heading>What&apos;s next?</Heading>
<UnorderedList>
<ListItem>Webpack (and hmr!) on the server</ListItem>
<ListItem>Clustering</ListItem>
Expand Down
20 changes: 10 additions & 10 deletions presentation/python-at-redfin.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const Presentation = () => (
<Text>Platforms team</Text>

<Notes>
I'm mostly a javascriptista, but Python was the first language I liked
I've been at Redfin almost a year
I&apos;m mostly a javascriptista, but Python was the first language I liked
I&apos;ve been at Redfin almost a year
I work mostly on front end build, especially performance
</Notes>
</Slide>
Expand All @@ -71,7 +71,7 @@ const Presentation = () => (
<ListItem>walk score deployments</ListItem>
</UnorderedList>
<Notes>
These are smaller uses; just emphasizing Python's ubiquity
These are smaller uses; just emphasizing Python&apos;s ubiquity
Our nagios alerts are a subset used to monitor Jenkins
Our test team uses python to run performance tests against the site
The data team uses python for listings imports, photos
Expand All @@ -89,7 +89,7 @@ const Presentation = () => (
</OrderedList>

<Notes>
We're currently working on creating a continuous deployment pipeline
We&apos;re currently working on creating a continuous deployment pipeline
Many parts of the are written in Python
Our Python is rapidly growing
</Notes>
Expand All @@ -112,7 +112,7 @@ const Presentation = () => (
<Notes>
Written at Google, uses hermeticism to guarantee reproducability, and a distributed artifact cache for performance
This is a big part of our move to continuous deployment, to get builds under 6 minutes
We've struggled with our module builds because of npm violations of bazel assumptions
We&apos;ve struggled with our module builds because of npm violations of bazel assumptions
</Notes>
</Slide>

Expand Down Expand Up @@ -155,7 +155,7 @@ external_npm_module = rule(
<Notes>
Used almost exclusively for deployments
Is managed by a Google doc that is translated to xml and then updates the google doc with timing data
Manage everything except a small subset of ops boxes that aren't deployed to
Manage everything except a small subset of ops boxes that aren&apos;t deployed to
</Notes>
</Slide>

Expand Down Expand Up @@ -297,19 +297,19 @@ $ pip install https://github.com/redfin/dirpy/zipball/master`}
</Slide>

<Slide>
<Heading>We're Hiring!</Heading>
<Heading>We&apos;re Hiring!</Heading>
<Heading fontSize="h3"><a href="http://www.redfin.com/about/jobs/hq">Jobs site</a></Heading>
<Text>Contact us: <a href="mailto:[email protected]">[email protected]</a></Text>
</Slide>

<Slide>
<Heading>Questions?</Heading>
<Quote>
This couldn't possibly work, could it? It can't be that easy, can it? But it works! - Dan Fabulich
This couldn&apos;t possibly work, could it? It can&apos;t be that easy, can it? But it works! - Dan Fabulich
</Quote>
<Notes>
Mostly, our experience in Python has been: it shouldn't be this easy, but it is
Dan / jlo's story about starting a thread / process pool
Mostly, our experience in Python has been: it shouldn&apos;t be this easy, but it is
Dan / jlo&apos;s story about starting a thread / process pool
</Notes>
</Slide>
</Deck>
Expand Down
10 changes: 3 additions & 7 deletions presentation/walk-score-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import {
Box,
CodePane,
Deck,
FlexBox,
FullScreen,
Heading,
Image,
ListItem,
OrderedList,
Progress,
Quote,
Slide,
Text,
UnorderedList,
Expand Down Expand Up @@ -274,7 +270,7 @@ router.get('/api/stop/:id', function *() {
"distance": 0.0437115618187228
, "name": "1ST AVE & LENORA ST"
, "summary_text": "1ST AVE & LENORA ST (0.0 mi)\t99, 121"
, "summary_html": "<span class=\"walkscore\"><span class=\"stop\">1ST AVE &amp; LENORA ST</span> <span class=\"distance\">(0.0 mi)</span> <span class=\"Bus\">99, 121</span></span>"
, "summary_html": "<span class="walkscore"><span class="stop">1ST AVE &amp; LENORA ST</span> <span class="distance">(0.0 mi)</span> <span class="Bus">99, 121</span></span>"
, "route_summary": [
{
"category": "Bus"
Expand Down Expand Up @@ -372,8 +368,8 @@ function getRoute() {
<CodePane language="javascript">{`
function linestringToCoordinates(linestring) {
return linestring
.replace(/LINESTRING\(/i, '')
.replace(/\)/i, '')
.replace(/LINESTRING(/i, '')
.replace(/)/i, '')
.split(',')
.map(function(coord) {
var parts = coord.split(' ');
Expand Down
Loading