Three step checklist to transition off ember-decorators
I'm working on a new app and wanted to get on the pre-release version of ember in modern javascript, with ES6 Classes, Decorators, and the new Ember component model.
Things were great using https://ember-decorators.github.io/ember-decorators/">Ember Decorators, until it came time to upgrade to Ember 3.10 and switch to using the build-in decorator system.
If you're like me, and hate random configuration changes, you may find this process "un-fun." So I put together a migration guide so I didn't have to look it up again.
Upgrade Ember Decorators
Upgrade ember-decorators
to 6.0.0
If you're using Ember 3.9 or less, install ember-decorators-polyfill
You can also remove the sub
packages for @ember-decorators/object
@ember-decorators/service
and @ember-decorators/data
. For a full rundown, (read Chris Garret's
blog post)https://www.pzuraq.com/ember-octane-update-landing-decorators/
Remove Ember-decorators babel-transforms
yarn remove @ember-decorators/babel-transforms
should do the trick
Replace Ember Decorators Imports
Replace import { <decorator> } from '@ember-decorators/<package>
with import { decorator } from
@ember/package`
All Done!