SlideShare a Scribd company logo
{ { E M B E R - C O M P O N E N T S
D E E P D I V E = T R U E } }
@ R A Y T I L E Y
B A C K I N M Y
D A Y
MODEL
VIEW
CONTROLLER
M O D E L L A Y E R
I S R E A L L Y T H E
R O U T E R
MODEL
VIEW
CONTROLLER
U S E A
C O M P O N E N T
MODEL
VIEW
CONTROLLER
W H A T I S
E M B E R
B E C O M I N G ?
W H A T E M B E R
I S B E C O M I N G
ROUTER
W H A T E M B E R
B E C O M I N G
ROUTER
GLUE
R O U T E R
G L U E D
C O M P O N E N T S
ROUTER
GLUE
COMPONENTS
{{components deepDive=true}}
{{components deepDive=true}}
2.0
H T T P : / / W 3 C . G I T H U B . I O / W E B C O M P
O N E N T S / S P E C / C U S T O M /
W3C Spec
Custom Element Spec Ember
createdCallback init
attatchedCallback didInsertElement
detachedCallback willDestroyElement
attributeChangedCallback * data binding *
– @ W Y C A T S V I A @ M I X O N I C
“Components are
akin to functions
with callbacks”
U S I N G A C O M P O N E N T
W H A T I S A C O M P O N E N T
Markup
Javascript
W H A T I S A C O M P O N E N T
Markup
Javascript
Styles
W H A T I S A C O M P O N E N T
template
class
css
O R G A N I Z A T I O N
• Use Pods
• Organize components by route where appropriate
• Components can be nested in directories
• Organize Early
• Put styles in pod structure
• https://github.com/ebryn/ember-component-css
• https://github.com/petehunt/jsxstyle
ps://github.com/dockyard/styleguides/blob/master/ember.md#use-pods-structu
{{components deepDive=true}}
{{components deepDive=true}}
ISOLATION
{{components deepDive=true}}
{{components deepDive=true}}
// components/sweet-component/component.js
import Ember from 'ember';
export default Ember.Component.extend({
foo: null,
actions: {
save: function() {
this.sendAction('on-save', this.get('foo'));
},
delete: function() {
this.sendAction('on-delete', this.get('foo'));
}
}
});
{{components deepDive=true}}
B U G
{{components deepDive=true}}
{{components deepDive=true}}
{{components deepDive=true}}
W R A P P I N G A T H I R D
P A R T Y L I B R A R Y
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'input',
attributeBindings: ['value'],
classNames: ['date-picker'],
didInsertElement: function() {
var options = {};
var picker = new Pikaday(options);
picker.setDate(this.get('value'), true);
this.set('_picker', picker);
},
willDestroyElement: function() {
this.get('_picker').destroy();
}
});
format: 'YYYY-MM-DD',
didInsertElement: function() {
var self = this;
var options = {
field: this.$()[0],
format: this.get('format'),
onSelect: function() {
Ember.run(function() {
var date = self.get('_picker').getDate();
self.set('value', date);
self.sendAction('on-select', date);
});
}
};
{{components deepDive=true}}
D A T A D O W N - A C T I O N S
U P
Action Checkbox
{{components deepDive=true}}
C O O R D I N A T I N G
C O M P O N E N T S
C O O R D I N A T I N G
C O M P O N E N T S
- W I T H B L O C K P A R A M S
( D E M O )
{{components deepDive=true}}
{{components deepDive=true}}
//Draggable Item
import Ember from 'ember';
export default Ember.Component.extend({
mouseDown: function() {
this.startDrag();
},
touchStart: function() {
this.startDrag();
}
startDrag: function() {
this.get('canvas').send('startDrag', this.get('dragData'));
}
dragData: Ember.computed(...)
});
H A N D L I N G B R O W S E R E V E N T S
http://emberjs.com/api/classes/Ember.View.html
//Drag Canvas
import Ember from 'ember';
export default Ember.Component.extend({
dragging: false,
touchMove: function() {...},
mouseMove: function() {...}
mouseUp: function() {...},
touchEnd: function() {...}
endDrag: function() {...},
updatePosition: function() {...}
actions: {
startDrag: function(dragData) {
this.setProperties({
dragging: true,
dragData: dragData
});
},
doDrop: function(dropData) {
this.sendAction('on-drop', dropData, this.get('dragData'));
}
}
});
C O O R D I N A T I N G
C O M P O N E N T S
- W I T H S E R V I C E S
{{components deepDive=true}}
// services/drag-coordinator.js
import Ember from 'ember';
export default Ember.Component.extend({
canvas: null,
registerCanvas: function() {...},
unregisterCanvas: function() {...}
});
// Any component that needs access to drag canvas
import Ember from 'ember';
export default Ember.Component.extend({
dragCoordinator: Ember.inject.service(),
canvas: Ember.computed.alias('dragCoordinator.canvas')
});
D Y N A M I C C O M P O N E N T S
W I T H { { C O M P O N E N T } }
( D E M O )
var title =
{
field: 'title',
component: 'text-search-filter',
placeholder: 'Title',
display: 'Title',
operators: [
{
operator: 'equals',
display: 'Contains'
},
{
operator: 'notEquals',
display: 'Does Not Contain'
}
]
};
H T T P : / / V I C T O R A R I A S . C O M . B R / I M A G E S / D U C K _ T Y P I N G . J P G
{{components deepDive=true}}
2.0
T H A N K S F O R
R E M I N D I N G M E
https://github.com/emberjs/ember.js/pull/10461
ISOLATION
L O O K ! I P U T A N U N D E R S C O R E I N
F R O N T O F I T
{{components deepDive=true}}
import Ember from 'ember';
export default Ember.Component.extend({
_superSecretInternalState: 'safe and secure',
actions: {
doSomething: function() {
var userValue = this.attrs.someValue;
...
}
}
}
});
E M B E R 2 . 0
import Ember from 'ember';
export default Ember.Route.extend({
attributes: function(params, queryParams) {
return {
model: this.model(params);
}
}
});
{{components deepDive=true}}
{{components deepDive=true}}
T O O M A N Y O F M Y C O M P O N E N T S
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'span',
classNames: ['sweet-component']
attributeBindings: ['some-attribute']
actions: {
save: function() {
this.sendAction('save')
}
}
}
});
E L E M E N T A N D F R A G M E N T R F C
T A G L E S S C O M P O N E N T = = =
F R A G M E N T
C O M B I N E D W I T H B E T T E R A C T I O N
H A N D L I N G
http://emberjs.jsbin.com/rwjblue/394/edit?html,js,output
A L L T H E O T H E R R O A D T O 2 . 0
S T U F F
• Road to 2.0 RFC
• Routable Components RFC
• Elements and Fragments RFC
• Erik is impatient
R E C A P
• Components are Ember’s vision of custom elements
today
• They simplify the learning curve of ember allowing a
unified interface for getting content and behaviors for UI.
• Organize Early
• Favor data down actions up
• You can coordinate between components to build
complex but compassable interfaces
R E C A P
• Use the {{component}} helper when you need to choose
a component at run time.
• Be on the lookout for sweet new features in Glimmer
and Ember 2.0 which are just around the corner.
T H A N K S !
@raytiley (github & twitter)
raytiley@gmail.com

More Related Content

PDF
Angular server-side communication
PDF
array, function, pointer, pattern matching
PPTX
Load-time Hacking using LD_PRELOAD
PDF
ESCMAScript 6: Get Ready For The Future. Now
PDF
如何「畫圖」寫測試 - RxJS Marble Test
PDF
人力
PDF
Javascript Secrets - Front in Floripa 2015
Angular server-side communication
array, function, pointer, pattern matching
Load-time Hacking using LD_PRELOAD
ESCMAScript 6: Get Ready For The Future. Now
如何「畫圖」寫測試 - RxJS Marble Test
人力
Javascript Secrets - Front in Floripa 2015

What's hot (19)

PDF
node.js and the AR.Drone: building a real-time dashboard using socket.io
PDF
Hello Swift 3/5 - Function
PDF
優しいWAFの作り方
PDF
Advanced programming with #nodecopter
PDF
Drones, Flying robots and Javascript
PDF
How to develop modern web application framework
PDF
Promise of an API
PDF
Implementing pattern-matching in JavaScript (short version)
TXT
fabfile.py
PDF
Implementation of c string functions
PDF
GeoGebra JavaScript CheatSheet
PDF
Oro meetup #4
PDF
Keep It Simple Security (Symfony cafe 28-01-2016)
PDF
InterConnect: Server Side Swift for Java Developers
PDF
Introduction to ES2015
PDF
Data Structure - 2nd Study
PDF
C++ Programming - 11th Study
PDF
Excellent
PDF
One definition rule - что это такое, и как с этим жить
node.js and the AR.Drone: building a real-time dashboard using socket.io
Hello Swift 3/5 - Function
優しいWAFの作り方
Advanced programming with #nodecopter
Drones, Flying robots and Javascript
How to develop modern web application framework
Promise of an API
Implementing pattern-matching in JavaScript (short version)
fabfile.py
Implementation of c string functions
GeoGebra JavaScript CheatSheet
Oro meetup #4
Keep It Simple Security (Symfony cafe 28-01-2016)
InterConnect: Server Side Swift for Java Developers
Introduction to ES2015
Data Structure - 2nd Study
C++ Programming - 11th Study
Excellent
One definition rule - что это такое, и как с этим жить
Ad

Viewers also liked (20)

PDF
Shorten your life infographic
PPTX
SMWSantiago - Mónica Bulnes
PDF
Marca pessoal
DOCX
Planificacion estrategica
PDF
Hip hop2 (1)
PPTX
Katonah-Lewisboro: It matters where you draw the line
PPTX
Understanding and treating mental illness 4.15 fnl
PPTX
SMWSantiago - Erick Bellido
PPTX
Evaluation
PDF
Proceso de extrusion ok
PDF
Proceso de extraccion de la materia prima el aluminio- --2 a
PDF
כללים להתנהלות נכונה באיביי
PDF
istributed system
PDF
Guia articuladora1
PPS
Factorizacion polinomios
PPT
Fuentesdel derecho
PDF
Ponencia alfonso muñoz
PPT
Hemoglobin
PPTX
Aldo rossi
PPTX
My presentation
Shorten your life infographic
SMWSantiago - Mónica Bulnes
Marca pessoal
Planificacion estrategica
Hip hop2 (1)
Katonah-Lewisboro: It matters where you draw the line
Understanding and treating mental illness 4.15 fnl
SMWSantiago - Erick Bellido
Evaluation
Proceso de extrusion ok
Proceso de extraccion de la materia prima el aluminio- --2 a
כללים להתנהלות נכונה באיביי
istributed system
Guia articuladora1
Factorizacion polinomios
Fuentesdel derecho
Ponencia alfonso muñoz
Hemoglobin
Aldo rossi
My presentation
Ad

Similar to {{components deepDive=true}} (20)

PDF
Workshop 16: EmberJS Parte I
PPTX
Intro to Ember.JS 2016
PPT
Ember.js: Jump Start
PDF
The road to Ember 2.0
PPTX
EmberJS BucharestJS
PDF
A Beginner's Guide to Ember
PDF
Ember presentation
PPTX
The road to Ember.js 2.0
PPTX
Full slidescr16
PPTX
Ember - introduction
PDF
Ember.js Self Defining Apps
PPTX
Introduction to Ember.js
PDF
Stackup New Languages Talk: Ember is for Everybody
PDF
New Component Patterns in Ember.js
PDF
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
PDF
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
PDF
Workshop 17: EmberJS parte II
PDF
Delivering with ember.js
PPTX
Getting into ember.js
PDF
Create an application with ember
Workshop 16: EmberJS Parte I
Intro to Ember.JS 2016
Ember.js: Jump Start
The road to Ember 2.0
EmberJS BucharestJS
A Beginner's Guide to Ember
Ember presentation
The road to Ember.js 2.0
Full slidescr16
Ember - introduction
Ember.js Self Defining Apps
Introduction to Ember.js
Stackup New Languages Talk: Ember is for Everybody
New Component Patterns in Ember.js
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
Workshop 17: EmberJS parte II
Delivering with ember.js
Getting into ember.js
Create an application with ember

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
top salesforce developer skills in 2025.pdf
PPTX
ai tools demonstartion for schools and inter college
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
history of c programming in notes for students .pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Transform Your Business with a Software ERP System
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administraation Chapter 3
PDF
Softaken Excel to vCard Converter Software.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Upgrade and Innovation Strategies for SAP ERP Customers
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
top salesforce developer skills in 2025.pdf
ai tools demonstartion for schools and inter college
Introduction to Artificial Intelligence
CHAPTER 2 - PM Management and IT Context
Odoo POS Development Services by CandidRoot Solutions
history of c programming in notes for students .pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Reimagine Home Health with the Power of Agentic AI​
VVF-Customer-Presentation2025-Ver1.9.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Operating system designcfffgfgggggggvggggggggg
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf

{{components deepDive=true}}

  • 1. { { E M B E R - C O M P O N E N T S D E E P D I V E = T R U E } } @ R A Y T I L E Y
  • 2. B A C K I N M Y D A Y MODEL VIEW CONTROLLER
  • 3. M O D E L L A Y E R I S R E A L L Y T H E R O U T E R MODEL VIEW CONTROLLER
  • 4. U S E A C O M P O N E N T MODEL VIEW CONTROLLER
  • 5. W H A T I S E M B E R B E C O M I N G ?
  • 6. W H A T E M B E R I S B E C O M I N G ROUTER
  • 7. W H A T E M B E R B E C O M I N G ROUTER GLUE
  • 8. R O U T E R G L U E D C O M P O N E N T S ROUTER GLUE COMPONENTS
  • 11. 2.0
  • 12. H T T P : / / W 3 C . G I T H U B . I O / W E B C O M P O N E N T S / S P E C / C U S T O M / W3C Spec
  • 13. Custom Element Spec Ember createdCallback init attatchedCallback didInsertElement detachedCallback willDestroyElement attributeChangedCallback * data binding *
  • 14. – @ W Y C A T S V I A @ M I X O N I C “Components are akin to functions with callbacks”
  • 15. U S I N G A C O M P O N E N T
  • 16. W H A T I S A C O M P O N E N T Markup Javascript
  • 17. W H A T I S A C O M P O N E N T Markup Javascript Styles
  • 18. W H A T I S A C O M P O N E N T template class css
  • 19. O R G A N I Z A T I O N • Use Pods • Organize components by route where appropriate • Components can be nested in directories • Organize Early • Put styles in pod structure • https://github.com/ebryn/ember-component-css • https://github.com/petehunt/jsxstyle
  • 26. // components/sweet-component/component.js import Ember from 'ember'; export default Ember.Component.extend({ foo: null, actions: { save: function() { this.sendAction('on-save', this.get('foo')); }, delete: function() { this.sendAction('on-delete', this.get('foo')); } } });
  • 28. B U G
  • 32. W R A P P I N G A T H I R D P A R T Y L I B R A R Y
  • 33. import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'input', attributeBindings: ['value'], classNames: ['date-picker'], didInsertElement: function() { var options = {}; var picker = new Pikaday(options); picker.setDate(this.get('value'), true); this.set('_picker', picker); }, willDestroyElement: function() { this.get('_picker').destroy(); } });
  • 34. format: 'YYYY-MM-DD', didInsertElement: function() { var self = this; var options = { field: this.$()[0], format: this.get('format'), onSelect: function() { Ember.run(function() { var date = self.get('_picker').getDate(); self.set('value', date); self.sendAction('on-select', date); }); } };
  • 36. D A T A D O W N - A C T I O N S U P Action Checkbox
  • 38. C O O R D I N A T I N G C O M P O N E N T S
  • 39. C O O R D I N A T I N G C O M P O N E N T S - W I T H B L O C K P A R A M S
  • 40. ( D E M O )
  • 43. //Draggable Item import Ember from 'ember'; export default Ember.Component.extend({ mouseDown: function() { this.startDrag(); }, touchStart: function() { this.startDrag(); } startDrag: function() { this.get('canvas').send('startDrag', this.get('dragData')); } dragData: Ember.computed(...) });
  • 44. H A N D L I N G B R O W S E R E V E N T S http://emberjs.com/api/classes/Ember.View.html
  • 45. //Drag Canvas import Ember from 'ember'; export default Ember.Component.extend({ dragging: false, touchMove: function() {...}, mouseMove: function() {...} mouseUp: function() {...}, touchEnd: function() {...} endDrag: function() {...}, updatePosition: function() {...} actions: { startDrag: function(dragData) { this.setProperties({ dragging: true, dragData: dragData }); }, doDrop: function(dropData) { this.sendAction('on-drop', dropData, this.get('dragData')); } } });
  • 46. C O O R D I N A T I N G C O M P O N E N T S - W I T H S E R V I C E S
  • 48. // services/drag-coordinator.js import Ember from 'ember'; export default Ember.Component.extend({ canvas: null, registerCanvas: function() {...}, unregisterCanvas: function() {...} });
  • 49. // Any component that needs access to drag canvas import Ember from 'ember'; export default Ember.Component.extend({ dragCoordinator: Ember.inject.service(), canvas: Ember.computed.alias('dragCoordinator.canvas') });
  • 50. D Y N A M I C C O M P O N E N T S W I T H { { C O M P O N E N T } }
  • 51. ( D E M O )
  • 52. var title = { field: 'title', component: 'text-search-filter', placeholder: 'Title', display: 'Title', operators: [ { operator: 'equals', display: 'Contains' }, { operator: 'notEquals', display: 'Does Not Contain' } ] };
  • 53. H T T P : / / V I C T O R A R I A S . C O M . B R / I M A G E S / D U C K _ T Y P I N G . J P G
  • 55. 2.0
  • 56. T H A N K S F O R R E M I N D I N G M E https://github.com/emberjs/ember.js/pull/10461
  • 58. L O O K ! I P U T A N U N D E R S C O R E I N F R O N T O F I T
  • 60. import Ember from 'ember'; export default Ember.Component.extend({ _superSecretInternalState: 'safe and secure', actions: { doSomething: function() { var userValue = this.attrs.someValue; ... } } } });
  • 61. E M B E R 2 . 0 import Ember from 'ember'; export default Ember.Route.extend({ attributes: function(params, queryParams) { return { model: this.model(params); } } });
  • 64. T O O M A N Y O F M Y C O M P O N E N T S import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'span', classNames: ['sweet-component'] attributeBindings: ['some-attribute'] actions: { save: function() { this.sendAction('save') } } } });
  • 65. E L E M E N T A N D F R A G M E N T R F C
  • 66. T A G L E S S C O M P O N E N T = = = F R A G M E N T
  • 67. C O M B I N E D W I T H B E T T E R A C T I O N H A N D L I N G http://emberjs.jsbin.com/rwjblue/394/edit?html,js,output
  • 68. A L L T H E O T H E R R O A D T O 2 . 0 S T U F F • Road to 2.0 RFC • Routable Components RFC • Elements and Fragments RFC • Erik is impatient
  • 69. R E C A P • Components are Ember’s vision of custom elements today • They simplify the learning curve of ember allowing a unified interface for getting content and behaviors for UI. • Organize Early • Favor data down actions up • You can coordinate between components to build complex but compassable interfaces
  • 70. R E C A P • Use the {{component}} helper when you need to choose a component at run time. • Be on the lookout for sweet new features in Glimmer and Ember 2.0 which are just around the corner.
  • 71. T H A N K S ! @raytiley (github & twitter) raytiley@gmail.com

Editor's Notes

  • #3: Ember is an “MVC” framework Components Introduced: https://github.com/emberjs/website/blob/master/source/blog/2013-06-23-ember-1-0-rc6.md
  • #4: For the model layer you can use ember data, or ember model, or plain jquery, or just POJOs. The real power of “models” in ember comes from the router which gives you a place to load your data, but it doesn’t matter the form that data takes.
  • #5: For each route you get a view, controller and template… but the distinction between those separate items is fuzzy and most of the time you should just use a component.
  • #6: So if models are loose, and you shouldn’t use views and controllers except for rare circumstances, what is ember?
  • #7: Router - Ember’s top feature from day one is the router. It is inspiring and still leads other frameworks.
  • #8: Glue - A framework is really a bunch of decisions made for you ahead of time. A bunch of small micro-libraries glued together for you so you don’t .
  • #9: Components - Ember is a front end framework for building a UI. Components are the building blocks of a web UI
  • #10: I remember sitting in IRC when components were being discussed.
  • #11: Initial reaction was less than thrilled.
  • #12: At the time our app was almost ready for launch… we didn’t migrate anything over to components. All of our views continued working fine and we were happy. Looking back especially has glimmer and 2.0 come down the road, the foresight was great. #thoughtleaders
  • #13: Components come from the custom element spec. Similar to Angular directives, react, and polymer.
  • #14: Custom elements and components are essentially markup and javascript combined. Both can react to browser events, and provide lifecycle hooks.
  • #16: Currently only mustache syntax is available… Angle brackets are coming. Components must have dash to align with spec. Arguments passed in as hash. Components can yield a template in block form.
  • #17: A component is some markup or some javascript or both.
  • #18: Lots of efforts to also tackle the styling question.
  • #23: With render we could tie a view, controller and template together.
  • #24: The killer feature of components is their isolation. Actions don’t escape a component unless explicitly given a handler and properties are part of the component templates context unless explicitly passed in.
  • #25: We can see here there are actions and properties available in the context the component is called in. But we can change the name and even switch what an action will do when the component is invoked.
  • #26: Shows how components can use the properties passed in. Also actions that originate inside a component do nothing if the component is not invoked with a handler.
  • #28: Pause and Demo app real quicky. Current Component count 80+.
  • #31: Refactoring - Another reason why component isolation is a benefit is it can make refactoring a UI easier. Should the content go in a side pane?
  • #32: Refactoring - Or maybe content should go in a modal. Having the content isolated to a component makes moving it around as a logical chunk easier.
  • #34: Lots of components in our app are just wrapping other libraries. Most of these will just require passing in options, setting up the plugin in the didInsertElement hook and cleaning up in the willDestroyElement.
  • #35: Wrapping a Plugin - Expand in the options. Notice now we run the plugins callback in an Ember.run. This is important. Also notice how we use component properties to configure the plugin, and call sendAction when the date picker calls its callback.
  • #36: Ember Addons is starting to replace a lot of our wrapper components. We’ll submit bugs / patches if we find a major issue. Spread the burden of maintenance, usually more complete.
  • #37: “Data Down Actions Up” is the hot new trend replacing 2 way data binding. The {{action-checkbox}} won’t change any state when clicked. Instead sends an action. Has loads of benefits but can be tricky. Sometimes you need to rewrite the element to avoid weird edge cases.
  • #38: Example Tweeted by Ember Sherpa of Data down actions up for a text input that formats the date once the user enters a new value.
  • #39: Sometimes components need to work together to.Think calendars, video players, tables. Here will go over a drag and drop scheduling interface.
  • #40: Block Params are in 1.10.0. Are awesome. Allow components to expose values into yielded templates. Show examples of where using block params in app. Demo Drag and drop scheduling.
  • #42: The drag canvas coordinates all the drag and drop and wraps all the draggables, droppables and helpers. Ultimately flexible. If the inner components are not passed a canvas, they will assert.
  • #43: You yield block params from a components template. In this case were yielding the entire component. You could yield selective values.
  • #44: The inner components can dispatch to the “canvas” component that was passed in. Also notice how the components allow us to respond to browser events.
  • #45: Its good to review list of events components and views respond to. You can always register custom events.
  • #46: After the {{draggable-item}} kicks off a drag the coordinator is responsible for tracking it, checking for intersections, etc. Since all the inner components have the canvas instance, they can create computed properties from canvas properties (x,y coordinates, intersecting, etc)
  • #47: Communicating with block params is great for components grouped locally. Sometimes components need to coordinate across routes.
  • #48: This is actually how our drag and drop works. The sidebar is a nested route. The drag canvas wraps everything including the outlet.
  • #49: Services also released in Ember 1.10.0. Really awesome dependency injection pattern. Makes coordinating globalish things much easier.
  • #50: Instead of passing a block param into the component, we just inject the service and use an alias.
  • #51: Sometimes you don’t know ahead of time which component to use. Could use crazy {{if}} branching… but its ugly. Use component helper instead. Demo advanced search builder.
  • #53: We have a file of search fields that we import. Notice the “component” property. Tells the interface what component to display if user adds this filter.
  • #54: Its javascript. Components don’t care what properties you pass in. When using component helper its useful to pass in anything that will be needed.
  • #55: Here we pass all the possible options to a component helper. The individual components know how to look up what data they need based on the type of component.
  • #56: Usually when I give a talk I do an arc where I build something up and then knock it down a little. I like to show all the sides. This time around the answers are right around the corner.
  • #58: Isolation in components today is really only one way. The outside world can set any of your components properties it wants
  • #60: No way to prevent it and no great way to reason about what was passed in vs came with the component.
  • #61: In glimmer properties passed into a component will be added to an attrs hash. Makes it sane to reason about what was passed in vs what is part of the component class.
  • #62: Attributes will also affect routable components. A new route hook allows you to specify what the attrs hash contains when your routable component is rendered.
  • #63: Glimmer also lands with some new lifecycle hooks inspired by react.
  • #64: An important new hook involving attires is willRecieveAttrs. Allows to react to attribute changes. Think of our pikaday component. If the format changes we probably need to recreate the plugin. Removes the need for an observer to handle this.
  • #65: Too many of my components have JS classes because I need to set properties on the elements tag or I need to catch and re-fire actions. The new element keyword removes the need for these classes and lets me handle everything in the template.
  • #66: The element keyword lets me set properties on the components element.
  • #67: Fragments give us a clear way to denote a component with no tag. Still unclear how this.$() will work. Might return a dom range, but may be left off completely.
  • #68: Actions now always need to be caught and re-fired. Can be tedious.Now actions will just be functions on the attrs hash.