In the 3.x series Ember’s component model has undergone a number of incremental improvements. When Ember Octane lands the new programming model will be fully available. But until then, if you’d like to know what’s available in the version of Ember you’re using–or if you’d like to trace the changes–here’s a cheat sheet for you.
This post shows a simple component for displaying a form for entering a person’s name. It shows most of the basic features of components. It traces each version of the Ember 3.x series where code related to that component changed.
Note that since Ember follows semver and so breaking changes are only made in a major release, none of the old APIs for components have gone away; newer APIs have been added while the old are retained as well. This post shows the latest-and-greatest APIs as they’re added.
If you’d like more information about how any of these features work, check out Jen Weber’s Ember Components Museum.
Ember 3.0
Component Invocation
Component JS File
Component Template
Ember 3.1
- ES5 getters
- @args
Component Invocation
Component JS File
Component Template
Ember 3.4
- Angle bracket component invocation
Component Invocation
Component JS File
Component Template
Ember 3.10
- Decorators, enabling class components
- Angle-bracket builtins (Input, Textarea, LinkTo)
Note: generators do not create components as ES6 classes by default; they continue to create them with Component.extend()
. But this guide illustrates the new class syntax that’s available.
Component Invocation
Component JS File
Component Template
Ember 3.11
on
andfn
helpers
Component Invocation
Component JS File
Component Template
Ember Octane Preview
- Glimmer Components (this.args, @tracked)