Skip to content

Instantly share code, notes, and snippets.

@jdivock
Last active August 29, 2015 14:22
Show Gist options
  • Save jdivock/3109d1728381ec4557d6 to your computer and use it in GitHub Desktop.
Save jdivock/3109d1728381ec4557d6 to your computer and use it in GitHub Desktop.
JSConf 2015

JSConf 2015

Day 1

Keynote

Oh, not a keynote, simple overview

Felipe de Albuquerque Accessibility and JS: side-by-side

Talk not in english

Trying new things!

this is weird

I get what they’re trying to do here, I just don’t think it’s being executed well.

Kate Hudson Beyond Responsive: Building a mobile web you’re f*ing proud of

The web is broken (pause for shock and awe)

Native is better at basic operations

Native was built with solving these problems in mind

The web wasn’t

Recent blog post: give up on the mobile web, go Native

Reasonable rationale argument

2004 Web development

wallpapers
Kazaa
PHP 5.0 (box.com was built this day, … I kid I kid)
GMail was released
An app … in JavaScript!
Everytone told the lead dev it was a terrible idea
“If amazon can do without JS, so can you”
First rich client expierence
More advanced than box, can see a new email right away. heh.
You are here because of a massive hack

The 3 levels of hack

Test new features before their time

Service workers!
Like app cache but not shitty
Transpiler polyfills
ES6
If you’re not doing it, you should.
This is not controversial stuff
Filer
Browser level file storage

New abstractions

The third level of hack: Blow shit up

Hybrid apps

Hack together your own user-agent
Cordova (yuck)

Mozilla first shots at trying to build a mobile app

Poor offline

Memory leaks

UI perf

Android <4.4

Building a hybrid app better

Crosswalk

Puts latest chromium in android so you don’t fight with native Browser

Using react to render views

Simple to save initial state in android

Using Android to handle routing

More stuff on using javasript in android development

Not totally caring, but whatevs … that’s cool

Making Relational Cool Again: Javascript on ACID

@tgriesser

Bringing SQL and JS together

KNEX.jS

Promises kind of structure in a query language kind of way

Here we go again with parse, falcor, etc

Transactions

Abillity to roll backend

Snapshot state of the world

Prevent others from altering data you’re working with (locks)

When to user

register user, give them id, send registration to service, create a bunch of rows

Bookshelf.js

ORM

Takes care of standard sql queries for you
model.fetch()
model.save()
model.destroy()

1-1

1-many

many-many

Builds on Knex

can write raw sql when you want

Eager loadinger

avoids N+1 query problem
withRelated options

Shared models sound great, but not great in practice

KNEX and Bookshelf not the first to do it

OpenRecord

Sequelize

Azul.js

endpoints

Sails.js

Larger scale/stack implementation

Node: a target for traditional “CRUD” web applications

ES 2016: Jafar (Netflix)

Former talk name (ES7)

ES6 -> ES2015, ES7 -> ES2016

Ship Every year

ES016

Rolling into browsers (observe)

Concurrent development

How do we make async easier?

=>

Awesome sauce

arrow function are an improvement but we can do better

no callbacks
Blocking is easy
Block until request comes back
Blocking means pulling
what if we want to wait instead of Blocking
we quicly end up in the “pyramid of doom”
Callback hell
Wait just like you Block
function* getStockPrice(name){
   var symbol = yield getStockPrice(ticker)
}
A generator function can return multiple values
function* getNumbers() {
yield 23;
yield 52;
yield 22;
return 18;
}
var iterator = getNumbers();
console.log( iterator.next());
Generators allow feedback
Async iterationtask.jsImplements spawnJafar thinks this will be a common patternImplement pattern nativelynative async functionsasync / await()

Symmetrical support for async and waiting

ES Feature maturity stages

strawman

proposal

draft (async functions)

available in babel

What if you want to wait on multiple values

All ES6 collections are iterable

for( var x of [23,2,34] ){..}

Waiting on values with for…on

for(var price on new WebSocket(”prices” + stock)){ … }

Unfortunately there’s a problem

No standard observable interface

Introducing Observable

Iterator pulls values

you’re in control

Observe pushes values

observe is in control

observer.next(30); //… etc etc

In a perfect worl all push APIs implement Observable
If an async function returns a promise and a function* returns and iterator
What does an async function* return?
pushes multiple values?an observableasync function* returns observableStrawman phase of proposallooking for feedback http://github.com/jhusain/asyncgenerator

CSS in JS

Ideas, not code

Some stuff may not work

CSS has limitations

No ctonants or variables

No code sharing or reuse

bad dependency management

Leads to copypasta and hard to maintain

Hence CSS pre-processors

Ambigious syntax

Non-standard semantics

Almost a real language but not quite

Walkthrough of different preprocessors and their shortcomings

Language design is hard

JS CSS

Right, flashbacks of VJeux’s talk for React and whatnot

Simple function to turn JS into CSS text

Why do it?

Constants and variables

Code reuse

Leverage npm to store reusable style packages!

Can now use Math.random in styles

Async logic to build styles

Use JS to insert polyfills

use flex vs float: left
build browser specific rules

Mutations in Relay (Laney Kuenzel)

Big Problem that neither react nor flux solve data fetching

Child data component needs are leaked upwards to the Parent

this means changes have to propogate upwards and neccessitate changes all the way up the tree to many files

Data fetching on the server and rendering on the client

Run into scenarios where you’re over-fetching

Sending data you don’t need

Or worse, under-fetching and the page explodes

How would this work in a perfect world?

Have data fetching objects reside in one place

Where you execute you rendering, within the react components

GraphQL: Put the data query in the component

GraphQL
Component describes it data needs
Think layer to interact with the server
Can be wrapped in other GraphQL queries
One single store for dealing with graphQL data
Single store provides lots of benefits
Less boilerplate
Easy to build things like pagination

As data is related to component, devs can work indepent of one another on different components

GraphQL Mutations

Suports writes as well as reads.

Provide 3 piees of info

Type of Mutations
inputs
Data you want after mutation

Want anything that could’ve changed as a result of the mutation returned from the Mutations

Can detect dependant mutations

Will wait for one payload to return before dispatching another

Already being used in production in a couple places at FB

Oh crap, announced somethign new still in development … totally zoned out

Main goan when designing Relay

Find common patterns taht are causing issues

Returning mutated data
Optimistic updates in the queue

By using relay you get these problems solved “for free”

Mariko Kosak - Knitting for Javascripters

Knitting is binary

knit stitch vs binary stitch

Can’t believe I just wrote that as a note

There’s a github for Knitting

Took knitting patterns from that and turned it into JS

Fun knitting “bugs” caused by ruffles

MIT paper actually covering this with crochet

Using Node to pixelate and translate images

gm lib

still needed dithering

ordered dithering

Pretty solid, always curious how to create depth in 2-tone

LIVE KNITTING DEMO

Cold War - @simon_Swan

Set up a basic atari style missle defender game

Start tweaking params

Creates chaos, browser starts to jank

Request animation frame

Can’t conintually paint

Call the function when browser is ready to paint

No gaurantee we’ll get called 60x / second

Amazing animations in his slides, worth mentioning

Solid speaker too, enjoy how he’s telling a story

Vector displays

Big advantage is you can scale it easily

HTML5 Canvas

gives us best of both worlds

Reminds me of the eloquent javascript nature sim

Amazing war sim set up, sets the params and just lets yellow and blue sides go toe to toe

walks through code behind each element, how it moves how it decides to attack

this is fucking ridiculous

Naveed Ihsanulla - Parallelism experiments in JavaScript

concurrency vs Parallelism

Evolution of the Web applications

breif hisotry, evolution of js, web apps nowadays, etc

At a bit of a bottleneck with CPU speed

We’re just adding cores now

Leads to us waiting on operations to completed

Each appication type has it’s own type of issue

Parallelism

Workers may be enough

bit heavier than system threads

Concurrency already exists in JS

Parallel JS

postMessage()

perf isn’t there
Limitited to no-shared-state computation

Native has solved this,

So what can we learn?

Design Criteria

Native like perf

not dependant on event loop

implementation versatility

support applications and alogrithms based on threads pthreads

support extensible web philosophy

Shared memory for JS!

posts giant spec to scare everyone off

The incrementing worker

err, rough examples ensue
this feels pretty close to the metal

Chris Lorenzo - Polymer: The future of Web Components

Hey I remember polymer, let’s see what they’ve done with it

Comcast. Heh.

History lesson on HTML

XFinity Demo

Looks like netflix did a couple years ago

More semantic markup

Building legos

Okay, nothing new so far, we knew all this when polymer was released

Okay buddy, easy on the kid pics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment