It's great in tests, but not quite useful for app code yet.
There are three ways we can get it to work. If you try
async/await without any of these changes, you will get the error
regeneratorRuntime is not defined.
|Method||Size ※||app code||test code|
|targets.js (see below)||0kb||no||yes|
※ size in prod (gzipped). Determined by doing
ember build -p before and after making the change.
This method adds nothing to the production payload. You can configure just the test environment browser target to use the latest chrome. Add the
targets.js (below) to your app
Since this does not let you use
async/await in your app code, you may want to restrict usage in app code somehow. Is there an eslint rule that would work for this? If so we could enable in
tests/eslintrc.js but not
Although maybe 2kb is small enough you'd rather use ember-maybe-import-regenerator :)
- https://github.com/rwjblue/rfcs/blob/42/text/0000-grand-testing-unification.md#async--await (~"what the future should look like")