Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Components: What, Why, How, When

9d9f17e37b751b9f83081ba3dd44bab4?s=47 Peter Gasston
September 22, 2014

Web Components: What, Why, How, When

From The Front; Bologna, Italy; 19th September, 2014. Sorry, but won’t make a lot of sense without commentary.

9d9f17e37b751b9f83081ba3dd44bab4?s=128

Peter Gasston

September 22, 2014
Tweet

Transcript

  1. @stopsatgreen WEB COMPONENTS What, Why, How, When #FromTheFront, 19/09

  2. @stopsatgreen @stopsatgreen Peter Gasston broken-links.com

  3. @stopsatgreen Unless otherwise stated, all photos in this deck are

    copyright George Lucas or Mickey Mouse or someone and used without permission.
  4. @stopsatgreen WEB COMPONENTS

  5. @stopsatgreen ‘Demeaning’ ‘Condescending’ ‘A bit silly’

  6. @stopsatgreen

  7. @stopsatgreen

  8. @stopsatgreen WHAT?

  9. @stopsatgreen “The component model for the Web.”

  10. @stopsatgreen A suite of technologies for making reusable UI controls

    or services.
  11. @stopsatgreen Fundamental change to the way we build the Web.

  12. @stopsatgreen

  13. @stopsatgreen

  14. @stopsatgreen

  15. @stopsatgreen ® The Lego Group

  16. @stopsatgreen Custom Elements

  17. @stopsatgreen Shadow DOM

  18. @stopsatgreen HTML Imports

  19. @stopsatgreen

  20. @stopsatgreen Templates

  21. @stopsatgreen WHY?

  22. @stopsatgreen

  23. @stopsatgreen OOCSS BEM Java Applets Dynamic Drive React Ember jQuery

    UI Bootstrap Web Components
  24. @stopsatgreen W3C WHATWG

  25. @stopsatgreen

  26. @stopsatgreen • jQuery : querySelector(), classList • Modernizr : @supports

    • Sass : --custom-properties()
  27. @stopsatgreen #extendthewebforward http://extensiblewebmanifesto.org/

  28. @stopsatgreen <flex-carousel> <prev-next> <show-position> <open-lightbox>

  29. @stopsatgreen http://msdn.microsoft.com/library/ie/ms531426.aspx

  30. @stopsatgreen

  31. @stopsatgreen

  32. @stopsatgreen

  33. @stopsatgreen meaningful naming + modularisation + encapsulation + sharing =

    web components
  34. @stopsatgreen HOW?

  35. @stopsatgreen <indiana-jones></indiana-jones> document.registerElement('indiana-jones');

  36. @stopsatgreen proto = Object.create(HTMLElement.prototype); proto.whip = function(…); document.registerElement('indiana-jones', indy =

    document.querySelector('indiana-jones');
 indy.whip();
  37. @stopsatgreen <button is="indiana-jones"></button> proto = Object.create(HTMLButtonElement.prototype); proto.whip = function(…); document.registerElement('indiana-jones',

    { prototype: proto, extends: 'button' });
  38. @stopsatgreen

  39. @stopsatgreen

  40. @stopsatgreen var root = foo.createShadowRoot();
 root.innerHTML = '<div>…</div>';

  41. @stopsatgreen <indiana-jones>
 <template id="doom">…</template>
 <script>…</script>
 </indiana-jones>

  42. @stopsatgreen <link rel="import" href="button-super.htm">

  43. @stopsatgreen http://leafletjs.com/

  44. @stopsatgreen <leaf-map lat="33.9186805" lon="8.1198406"></leaf-map> <link rel="import" href="leaflet-map.htm">

  45. @stopsatgreen Everything Useful Useful & well-made Crap http://en.wikipedia.org/wiki/Sturgeon%27s_law

  46. @stopsatgreen http://addyosmani.com/first/

  47. @stopsatgreen http://www.paciellogroup.com/blog/2014/09/web-components-punch-list/

  48. @stopsatgreen

  49. @stopsatgreen

  50. @stopsatgreen

  51. @stopsatgreen /path/to/library.min.js
 /path/to/a/library.min.js

  52. @stopsatgreen <link rel="import" href="//foo.com/btn-a.htm">
 <link rel="import" href="//bar.com/btn-b.htm">
 <link rel="import" href="//baz.com/btn-c.htm">

  53. @stopsatgreen WHEN?

  54. @stopsatgreen Browser Custom Elements Shadow DOM HTML Imports Template Who

    knows? ‘Under consideration’ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ http://jonrimmer.github.io/are-we-componentized-yet/
  55. @stopsatgreen

  56. Polyfill Polymer Core X-Tags Bosonic Polymer Elements Brick Paper Elements

    Elements http://www.polymer-project.org/ - http://x-tags.org/ - http://bosonic.github.io/
  57. @stopsatgreen Web Components are for you to drive the future

    of the web. Please drive responsibly.
  58. @stopsatgreen The End.