Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Who am I? 
๏ Founder @ Dynamatik 
๏ Co-Founder @ Ember Chat 
๏ Engineer @ Kobo 
๏ @FaisalAbid 
๏ faisal.abid@gmail.com - A...
About the talk 
๏ Split into three parts. 
๏ Goal is to inspire you to go out, learn Dart & Polymer and rule the world. 
๏...
But first 
Let’s play a game
Guess the language
public String Hello(){ 
return "World"; 
}
public String Hello(){ 
return "World"; 
} 
Java
function Hello(){ 
return "World"; 
}
function Hello(){ 
return "World"; 
} 
Javascript
String Hello(){ 
return "World"; 
}
String Hello(){ 
return "World"; 
} 
Dart!
You already know Dart* 
*95% of it at least
1Dart
What is Dart & Why should I care? 
๏ Dart is a new platform and language by Google. 
๏ Dart is for “Scalable web app engin...
“Scalable web app engineering” 
What does that mean?
Scalable web app engineering 
๏ Javascript is “Scalable” to an extent 
• RequireJS/AMD modules 
• Frameworks like Backbone...
Javascript is the root of all evil* 
*a little bit dramatic, but gets the point across
Scalable web app engineering 
๏ Dart is built for scale 
• Optional type checking - I <3 typed objects 
• Single threaded ...
All while keeping the language 
easy to develop in.
All while keeping the language 
easy to develop in. 
Because all that scale stuff is cool, but this is what really matters...
class Conference { 
String name; 
num attendees; 
Conference(String name, num attendees) { 
this.name = name; 
this.attend...
Dart IDE Tour
Dart IDE Tour
Dart Package Manager
Dart IDE Tour
Dart IDE Tour
Optionally Typed 
๏ Dart is optionally typed. 
๏ For Public API’s / Public Methods - Use Type 
๏ For internal method imple...
Dart Typed Example
Async / Future 
๏ One of the most powerful features of Dart 
๏ Dart is single threaded, blocking code blocks! 
๏ Dart futu...
Dart Future Example
Async / Future - Recap 
๏ One of the most powerful features of Dart 
๏ Dart is single threaded, blocking code blocks! 
๏ D...
Dart Everywhere 
๏ You can write your Dart apps on the server side also! 
๏ Dart on the full stack! Front-end and backend....
Simple Dart:io Example
Dart for web 
๏ Ran through simple but powerful examples. 
๏ Dart makes web development easy. 
๏ Dart is built to scale, w...
2Polymer / Web components
What are web components? 
๏ Next generation of encapsulation for the web. 
๏ Build your own tag, hide the implementation d...
Whats the shadow DOM? 
๏ Shadow DOM hides the web component implementation from the 
DOM. 
๏ I.e <my-tag> shows up as <my-...
Now what’s Polymer then? 
๏ Truthfully the web component spec is sometimes messy 
๏ Hard to implement on its own. 
๏ Polym...
Now what’s Polymer then?
Can I use Polymer with only Dart? 
๏ No! Polymer can be used with Javascript. In fact it’s first written for JS. 
๏ Dart h...
3Dart meet Polymer
How do you use Polymer with Dart 
๏ Starter project makes it easy to get started. 
๏ Transformer gets polymer all ready to...
Dart / Polymer Example
Simple data binding in Polymer 
๏ You want your components to do something and take attributes 
๏ Databinding is simple wi...
Dart / Polymer Databinding
Simple data binding in Polymer 
๏ You want your components to do something and take attributes 
๏ Databinding is simple wi...
Advanced data binding in Polymer 
๏ Databind on lists too!
@CustomTag(‘speaker-list') 
class SpeakerList extends PolymerElement { 
final List speakers = toObservable(["Speaker One",...
Advanced data binding in Polymer 
๏ Databind on lists too! 
๏ DAMN THIS IS EASY!!!!
Material Design & Polymer 
๏ Google introduced this at Google IO 
๏ Sexy fluid new UI components for the web & mobile. 
๏ ...
Material Design & Polymer 
๏ Paper-Elements is the new UI language from Google 
๏ Lets take a look at a sample example
Material Design & Polymer 
๏ Paper-Elements is the new UI language from Google 
๏ Do all Material design apps look alike? ...
Styling Polymer 101 
๏ Styling Polymer components is straight forward with a few pitfalls. 
๏ Use CSS - Duh. 
๏ However CS...
<polymer-element name="x-foo" noscript> 
<template> 
<style> 
:host { 
/* Note: by default elements are always display:inl...
<style> 
x-foo { 
display: block; 
} 
x-foo:hover { 
opacity: 0; 
} 
</style> 
Styling from outside
Closing Thoughts 
๏ Dart is ready for prime time. version 1.6 
๏ Polymer still in beta for Dart, but “pretty” stable. 
๏ D...
Thank you 
@FaisalAbid - faisal.abid@gmail.com 
Title screen by Sam Beck - SamBeck.ca
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Building for the Material web with Polymer and Dart
Upcoming SlideShare
Loading in …5
×

Building for the Material web with Polymer and Dart

3,168 views

Published on

Building for the Material web with Polymer and Dart
with Faisal Abid

Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca

Google recently unleashed a wide array of new components and technologies that help you develop for the rich web. In Building for the Material web with Polymer and Dart, you’ll learn about what Material means for your web apps, how to integrate polymer and material design into your existing or new dart apps, and lastly how to make it work across all screen sizes from mobile to desktop!

OBJECTIVE
Learn about the material web and integrate polymer into your existing or new Dart apps.

TARGET AUDIENCE
Existing Dart developers looking to adopt Polymer and material design into their web app.

ASSUMED AUDIENCE KNOWLEDGE
Audience should be familiar with Dart language and tools, as we will be skipping over these.

FIVE THINGS AUDIENCE MEMBERS WILL LEARN
How to integrate polymer into your dart app.
How to integrate paper elements/material design concepts in dart.
How to properly architect a real world polymer and dart app.
How to handle routes and multiple pages in Dart.
How to handle multiple screen resolutions using polymer core elements.

Published in: Internet
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Building for the Material web with Polymer and Dart

  1. 1. Who am I? ๏ Founder @ Dynamatik ๏ Co-Founder @ Ember Chat ๏ Engineer @ Kobo ๏ @FaisalAbid ๏ faisal.abid@gmail.com - Ask me anything about Node, AngularJS, Dart, Polymer, and Android.
  2. 2. About the talk ๏ Split into three parts. ๏ Goal is to inspire you to go out, learn Dart & Polymer and rule the world. ๏ Part 1. Quick Dart introduction to basic language concepts ๏ Part 2. Quick rundown of Web components & Polymer ๏ Part 3. Dart + Polymer and what Material design is
  3. 3. But first Let’s play a game
  4. 4. Guess the language
  5. 5. public String Hello(){ return "World"; }
  6. 6. public String Hello(){ return "World"; } Java
  7. 7. function Hello(){ return "World"; }
  8. 8. function Hello(){ return "World"; } Javascript
  9. 9. String Hello(){ return "World"; }
  10. 10. String Hello(){ return "World"; } Dart!
  11. 11. You already know Dart* *95% of it at least
  12. 12. 1Dart
  13. 13. What is Dart & Why should I care? ๏ Dart is a new platform and language by Google. ๏ Dart is for “Scalable web app engineering”
  14. 14. “Scalable web app engineering” What does that mean?
  15. 15. Scalable web app engineering ๏ Javascript is “Scalable” to an extent • RequireJS/AMD modules • Frameworks like Backbone, Ember.js, Angular.js • JQuery, Zepto
  16. 16. Javascript is the root of all evil* *a little bit dramatic, but gets the point across
  17. 17. Scalable web app engineering ๏ Dart is built for scale • Optional type checking - I <3 typed objects • Single threaded “Isolate” concept for server apps. Web workers for client. • Objects, Classes, Polymorphism • Easy async, less messy callbacks • Many years of programming language research • High performance VM, Dartium • Compile straight to JS for cross browser compatibility
  18. 18. All while keeping the language easy to develop in.
  19. 19. All while keeping the language easy to develop in. Because all that scale stuff is cool, but this is what really matters.
  20. 20. class Conference { String name; num attendees; Conference(String name, num attendees) { this.name = name; this.attendees = attendees; } } // then later var webunleashed = new Conference("WebUnleashed", 5800); Example Class in Dart
  21. 21. Dart IDE Tour
  22. 22. Dart IDE Tour
  23. 23. Dart Package Manager
  24. 24. Dart IDE Tour
  25. 25. Dart IDE Tour
  26. 26. Optionally Typed ๏ Dart is optionally typed. ๏ For Public API’s / Public Methods - Use Type ๏ For internal method implementations, use var. • Dart IDE will make use of type info also. Easy code assist. • “Explicit type annotations are usually just visual noise.”
  27. 27. Dart Typed Example
  28. 28. Async / Future ๏ One of the most powerful features of Dart ๏ Dart is single threaded, blocking code blocks! ๏ Dart futures lets you perform async operations. I.e HTTP
  29. 29. Dart Future Example
  30. 30. Async / Future - Recap ๏ One of the most powerful features of Dart ๏ Dart is single threaded, blocking code blocks! ๏ Dart futures lets you perform async operations. I.e HTTP ๏ Futures make it easy to avoid callback hell and keep syntax simple. ๏ Almost one line API calls. no callbacks needed
  31. 31. Dart Everywhere ๏ You can write your Dart apps on the server side also! ๏ Dart on the full stack! Front-end and backend. ๏ Use classes, futures and everything you’ve learned
  32. 32. Simple Dart:io Example
  33. 33. Dart for web ๏ Ran through simple but powerful examples. ๏ Dart makes web development easy. ๏ Dart is built to scale, with OOP principals, Async programming made easy and simple to use syntax. Making Dart web apps is easy. ๏ But what’s this polymer thing about?
  34. 34. 2Polymer / Web components
  35. 35. What are web components? ๏ Next generation of encapsulation for the web. ๏ Build your own tag, hide the implementation details.
  36. 36. Whats the shadow DOM? ๏ Shadow DOM hides the web component implementation from the DOM. ๏ I.e <my-tag> shows up as <my-tag> and not a series of divs. ๏ Ready in firefox, chrome, opera, and their mobile counterparts. ๏ Not in Safari. ๏ Polyfills ready for older browsers and Safari. Mileage may vary
  37. 37. Now what’s Polymer then? ๏ Truthfully the web component spec is sometimes messy ๏ Hard to implement on its own. ๏ Polymer wraps all this up in a nice abstraction layer. By Google ๏ Works wherever Web components/ Shadow dom works.
  38. 38. Now what’s Polymer then?
  39. 39. Can I use Polymer with only Dart? ๏ No! Polymer can be used with Javascript. In fact it’s first written for JS. ๏ Dart has a feature parity port by Google. ๏ pub : polymer ๏ pub : paper-elements ๏ Polymer is better with Dart. You feel like you are coding for the future.
  40. 40. 3Dart meet Polymer
  41. 41. How do you use Polymer with Dart ๏ Starter project makes it easy to get started. ๏ Transformer gets polymer all ready to rock.
  42. 42. Dart / Polymer Example
  43. 43. Simple data binding in Polymer ๏ You want your components to do something and take attributes ๏ Databinding is simple with polymer. ๏ Lets take a look!
  44. 44. Dart / Polymer Databinding
  45. 45. Simple data binding in Polymer ๏ You want your components to do something and take attributes ๏ Databinding is simple with polymer. ๏ @published - is two way binding ๏ @observable - is one way binding
  46. 46. Advanced data binding in Polymer ๏ Databind on lists too!
  47. 47. @CustomTag(‘speaker-list') class SpeakerList extends PolymerElement { final List speakers = toObservable(["Speaker One", "Speaker Two", "Speaker Three"]); SpeakerList() : super.created(); } [ . . . ] <template repeat=“{{speaker in speakers}}”> <li> {{speaker}} </li> </template> Example list data binding in Dart
  48. 48. Advanced data binding in Polymer ๏ Databind on lists too! ๏ DAMN THIS IS EASY!!!!
  49. 49. Material Design & Polymer ๏ Google introduced this at Google IO ๏ Sexy fluid new UI components for the web & mobile. ๏ “Paper-elements” is a package ready to be used by Dart. In fact many examples have used paper-elements already ๏ Must have polymer: ">=0.14.0 <0.15.0” in your pub ๏ core_elements: ">=0.2.0 <0.3.0" ๏ paper_elements: ">=0.2.0 <0.3.0"
  50. 50. Material Design & Polymer ๏ Paper-Elements is the new UI language from Google ๏ Lets take a look at a sample example
  51. 51. Material Design & Polymer ๏ Paper-Elements is the new UI language from Google ๏ Do all Material design apps look alike? • No! You can easily theme them via CSS • Great resource is http://polymerthemes.com/
  52. 52. Styling Polymer 101 ๏ Styling Polymer components is straight forward with a few pitfalls. ๏ Use CSS - Duh. ๏ However CSS is encapsulated in your component. No global css styles. ๏ New selectors help with this.
  53. 53. <polymer-element name="x-foo" noscript> <template> <style> :host { /* Note: by default elements are always display:inline. */ display: block; } </style> </template> </polymer-element> Styling Example
  54. 54. <style> x-foo { display: block; } x-foo:hover { opacity: 0; } </style> Styling from outside
  55. 55. Closing Thoughts ๏ Dart is ready for prime time. version 1.6 ๏ Polymer still in beta for Dart, but “pretty” stable. ๏ Dart brings sanity to web development. ๏ Polymer/Web components brings proper modularity to web development. ๏ Dart is moving full steam ahead, adopted heavily by Google. ๏ It’s not going anywhere, so embrace change and lets rule the world.
  56. 56. Thank you @FaisalAbid - faisal.abid@gmail.com Title screen by Sam Beck - SamBeck.ca

×