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

A tale of two pods

A tale of two pods

Review the history of pods, how they have evolved, and what the next steps are.

Presented at EmberATX: https://youtu.be/1wc3a_ttTy0?t=28m18s

0dfd10ad198ae5a87640da046a77a90a?s=128

Robert Jackson

October 22, 2015
Tweet

Transcript

  1. A Tale of Two Pods

  2. Who the heck is this guy? • Ember Core Team

    • Aptible • General Open Source Addict twitter: rwjblue github: rwjblue
  3. Thank You!!

  4. What are pods?

  5. None
  6. Great, :shipit:

  7. The End

  8. • 2014-01-19 • “Simple” • names + types • non-configurable

    Pods v1.0
  9. Router.map(function() { this.route('post', function() { this.route('comments', function() { this.route('show'); });

    }); }); Example Setup - Routes
  10. app/application/route.js app/application/template.hbs app/index/route.js app/index/template.hbs app/post/route.js app/post/template.hbs Pods v1.0 - Files

  11. app/post/index/route.js app/post/index/template.hbs app/post/comments/route.js app/post/comments/template.hbs app/post/comments/index/route.js app/post/comments/index/template.hbs Pods v1.0 - Files

  12. app/post/comments/show/route.js app/post/comments/show/template.hbs app/post/model.js app/post/serializer.js app/post/adapter.js app/comment/model.js Pods v1.0 - Files

  13. <div> {{posts/display-post post=post}} </div> app/posts/display-post/component.js app/posts/display-post/template.hbs Pods v1.0 - Local

    Invocation
  14. <div> {{display-post post=post}} </div> app/display-post/component.js app/display-post/template.hbs Pods v1.0 - Global

    Invocation
  15. • 2014-04-07 • complete refactor / overhaul • adds configurability

    Pods v1.5
  16. moduleNameLookupPatterns: Em.computed(function() { let defaults = this._super(...arguments); return defaults.push(this.snowflakeModules); }),

    Pods v1.5 - Customization
  17. Pods v1.5 - Customization snowflakeModules: function(name) { return 'snowflake/' +

    name.fullNameWithoutType + '/' + name.type'; }
  18. <div> {{posts/display-post post=post}} </div> ...snip app/snowflake/posts/display-post/component.js app/snowflake/posts/display-post/template.hbs Pods v1.5 -

    Custom Invocation
  19. • 2014-07-24 • Allows `app/components/<name>/<type>` Pods v1.75

  20. <div> {{posts/display-post post=post}} </div> ...snip app/components/posts/display-post/component.js app/components/posts/display-post/template.hbs Pods v1.75- Local

    Invocation
  21. <div> {{display-post post=post}} </div> ...snip app/components/display-post/component.js app/components/display-post/template.hbs Pods v1.75- Global

    Invocation
  22. What is wrong with Pods 1.x? • Inconsistent Rules •

    Not “portable” • Too much variation • Melding of “UI” and “Data” • Naming Conflicts • Addons?
  23. Where do we go from here?

  24. Pods v2.0 - Requirements • Consistent Rules • Portable •

    Separation of “UI” and “Data” (notice a theme?)
  25. Router.map(function() { this.route('post', function() { this.route('comments', function() { this.route('show'); });

    }); }); Example Setup - Routes
  26. app/routes/application/route.js app/routes/application/template.hbs app/routes/index/route.js app/routes/index/template.hbs app/routes/post/route.js app/routes/post/template.hbs Pods v2.0 - Files

  27. app/routes/post/index/route.js app/routes/post/index/template.hbs app/routes/post/routes/comments/route.js app/routes/post/routes/comments/template.hbs app/routes/post/routes/comments/routes/index/route.js app/routes/post/routes/comments/routes/index/template.hbs Pods v2.0 - Files

  28. app/routes/post/routes/comments/routes/show/route.js app/routes/post/routes/comments/routes/show/template.hbs app/models/post/model.js app/models/post/serializer.js app/models/post/adapter.js Pods v2.0 - Files

  29. <div> {{display-post post=post}} </div> app/routes/posts/components/display-post/component.js app/routes/posts/components/display-post/template.hbs // OR app/routes/posts/components/display-post.{js,hbs} Pods

    v2.0 - Local Invocation
  30. <div> {{display-post post=post}} </div> app/components/display-post/component.js app/components/display-post/template.hbs Pods v2.0 - Global

    Invocation
  31. app/models/post.js // OR app/models/post/model.js app/models/post/serializer.js app/models/post/adapter.js Pods v2.0 - Data

  32. route.js template.hbs controller.js | component.js components/ helpers/ routes/ Pods v2.0

    - “UI” Level
  33. <div> {{ember-admin::model-title model=model}} </div> ... < inside node_modules/ember-admin/ > addon/components/model-title/component.js

    addon/components/model-title/template.hbs Pods v2.0 - Addon Invocation
  34. Pods v2.0 - Concepts • Layer Symmetry • Local Lookup

    • Addon Support
  35. The End