ember install ember-async-to-generator
What does the addon do?
tl;dr: Enable async-await syntax without including the whole babel polyfill.
Under the hood, this addon configures babel's async-to-generator plugin to use
The babel plugin defaults to use native
Promise which breaks in old browsers.
The browsers list support generator and async-await from babel can be found at babel-preset-env/data/plugins.json.
Can I only include the transform for my addon's tests?
ember-async-to-generator to your addon's
devDependencies will not affect host apps.
Notice your addon's local development will also have async/await available. To avoid async/await code from addon, you can add lint rules to make sure async/await is test only.
What about ember-maybe-import-regenerator(-for-testing)?
ember-async-to-generator will check existence of those two addons to avoid duplicate import.
If you wish to only import the asset in test, you can install
eslint-plugin-disable-features, see this blog post.
This project is licensed under the MIT License.