meteor + polymer = a perfect synthesis

23
Meteor + Polymer A perfect synthesis

Upload: fabian-kromer

Post on 20-Feb-2017

92 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Meteor + polymer = a perfect synthesis

Meteor + PolymerA perfect synthesis

Page 2: Meteor + polymer = a perfect synthesis
Page 3: Meteor + polymer = a perfect synthesis

http://jonrimmer.github.io/are-we-componentized-yet/

Page 4: Meteor + polymer = a perfect synthesis

Virtual RealityProgressive Web AppsMachine Learning

Page 5: Meteor + polymer = a perfect synthesis
Page 6: Meteor + polymer = a perfect synthesis
Page 7: Meteor + polymer = a perfect synthesis
Page 8: Meteor + polymer = a perfect synthesis

Using Polymer with MeteorYes, it’s a 101!

Page 9: Meteor + polymer = a perfect synthesis

https://github.com/meteorwebcomponents/synthesis

Page 10: Meteor + polymer = a perfect synthesis

● Square brackets ([[]]) create one-way bindings. Data

flow is downward, host-to-child, and the binding never

modifies the host property.

● Curly brackets ({{}}) create automatic bindings. Data flow

is one-way or two-way, depending whether the target

property is configured for two-way binding.

Databinding

Page 11: Meteor + polymer = a perfect synthesis

Template repeater (dom-repeat)

Similar to Blaze {{#each}} with some extensions / limitations

● Binds only to arrays, no other data structures.● Exposes

○ item: The array item.○ index: The index of item in the array.

Page 12: Meteor + polymer = a perfect synthesis

Conditional Templates

● Similar to Blaze {{#if}}● By default all stamped elements are hidden (but remain in

the DOM tree).● To disable this behavior, set the restamp property to true.

Page 13: Meteor + polymer = a perfect synthesis

Handling events

● Bind on-tap events to functions using markup

● Or in your element definition using listeners

Page 14: Meteor + polymer = a perfect synthesis

Adding a little bit of Meteor magic

Page 15: Meteor + polymer = a perfect synthesis

Using reactive Data sources

● Provided by the mwcMixin● Uses Tracker to reactively rerun code when needed● getMeteorData capsules all your collections and exposes

them through the mwcData property

Page 16: Meteor + polymer = a perfect synthesis
Page 17: Meteor + polymer = a perfect synthesis

{{ }}Blaze is dead,long live Handlebars!

Page 18: Meteor + polymer = a perfect synthesis

What about Meteor best practices?

● Encourages template level subscriptions● Good support for Flowrouter (through mwc:layout)● Encourages the Meteor 1.3 directory structure● Enables the definition of reusable components

Page 19: Meteor + polymer = a perfect synthesis

Case Study: Bummerl Liste

Before:Meteor 1.0 + Blaze

+ Bootstrap + Materialize

After:Meteor 1.3 + Polymer

Page 20: Meteor + polymer = a perfect synthesis

Folder Structure

Page 21: Meteor + polymer = a perfect synthesis

Blazing Fast & Lightweight

Page 22: Meteor + polymer = a perfect synthesis

https://github.com/faburem/bummerl-liste

Page 23: Meteor + polymer = a perfect synthesis

Ready to get componentized?

Thanks for your attention!

faburem Fabian Kromer @faburem