Google meets Facebook
Web components and flux
github.com/tpluscode/polymer-vs-react
github.com/tpluscode/polymer-flux
Google meets Facebook
Polymer and reflux.js
Custom Elements
<my-uber-select>
<option>Choose me</option>
</my-uber-select>
<select is="my-uber-select">
<option>Choose me</option>
</select>
Templates
<template>
<div>
<span>This is reusable code!</span>.
</div>
</template>
HTML imports
<!-- load not only JS and CSS -->
<script src="some-library.js" />
<!-- but also HTML fragments -->
<link rel="import" href="my-uber-select.html" />
Shadow DOM
Hide component's internals from outside markup
Polymer
- One custom element to rule them all
- Two-way data binding
- Shadow DOM or Shady DOM
- CSS extensions
- Vulcanize tool
- Web Components Tester
- Many pre-built elements
- Much more
Polymer 1.0 breaking changes
- New syntax
- One-way binding by default
- Less fancy expressions
- Behaviors
- CSS extensions
- Full polyfill not necessary
- Local DOM API
0.5 -> 1.0 Migration guide
In the beginning there was MVC
Why reflux?
Flux
- Singleton dispatcher
- Actions are strings
- Stores use
switch
Dispatcher.waitFor([])
reflux
- No dispatcher
- Actions are functions
- Stores listen to actions
- Chained stores or joined listeners
Summary
- Flux enables complex data flows and parallel logic
- Everything is a custom element
- Polymer takes some practise
- non-WebKit browsers
- completely different approach
- great documentation
Google meets Facebook
Web components and flux
github.com/tpluscode/polymer-vs-react
github.com/tpluscode/polymer-flux