Releases: machty/ember-concurrency
2.3.0 - async arrow fn tasks
NOTE: v2.3.2 simplifies the new task() API even more further; you should upgrade to that (or higher!)
2.3.0
- Introduce async-arrow task() API as the new universal JS/TS API, e.g.
myTask = task(this, { drop: true }, async (arg: string) => {})
. This new API
sidesteps the vast majority of TypeScript issues that plagued past decorators- and generators-
based APIs. All prior APIs are still supported, but users are strongly recommended
to migrate to the new API. Recommended steps:- Finish migrating any classes with EC tasks to ES6 class syntax
- Once you've done that, use the following codemods
- Convert
@task
decorator based APIs to the new async-arrow fnnpx machty-ember-concurrency-codemods async-arrow-task app/**/*.ts app/**/*.js
- If you've used
ember-concurrency-ts
, run the following codemod to removetaskFor()
npx machty-ember-concurrency-codemods rm-ember-concurrency-ts app/**/*.ts app/**/*.js
- Convert
- The
ember-concurrency-ts
andember-concurrency-async
packages are no longer needed
and can be removed - Soft-deprecated (removed from documentation, likely to formally deprecate later)
a number of less commonly used features- Encapsulated Tasks
- Task Groups
2.2.1
2.2.0
New Features
- Implemented a public API for Task Modifiers,
providing a way for users to define additional modifiers and behavior in
application code. (#441) Please consider theTaskProperty
prototype extension method of implementing task modifiers to be deprecated
in favor of theregisterModifier
API. - Add
onError
parameter toperform
helper to allow UI-triggered tasks to
specify alternative or null error handlers (#443, fixes #435. Thanks
@lolmaus for the discussion)
Bugfixes
- Fix inefficent use of
run.once
(#442, fixes #437. Thanks @stefanpenner for
the heads up!)
2.1.2
Bugfixes
- Expose TaskInstance state inside encapsulated tasks (#434)
Misc
- [dev] use prettier to format code (#415, thanks @alexlafroscia!)
- [dev] test against embroider scenarios (#430, thanks @alexlafroscia!)
2.1.0
New Features
- Implemented a public API for Yieldables, a new way to instrument TaskInstances by providing a safe mechanism to implement custom waiters, hooks, introspection, and other operations from application code. (#413)
Read more about Yieldables in the ember-concurrency docs
Bugfixes
Docs
- [docs] Document that
@lastValue
does not support chained property access (#429)
2.0.3
Bugfixes
- Remove runloop binding for
perform
andcancel-all
helpers, which prevented proper instrumentation. (#414, fixes #409) - Fix incorrect import for deprecated private
task-instance
module alias (#411, thanks @mydea!)
Misc
- [dev] Upgrade qunit to v5 (#410, thanks @alexlafroscia)
- [docs] Fix missing jsdoc documentation (#407)
2.0.2
2.0.1
2.0.0
ember-concurrency 2.0 is primarily an "engine" replacement. Internally, its been substantially rewritten and decoupled from Ember at it's core. This will enable a much more maintainable codebase, as well as setting the stage for potential extraction of core primatives for us in the broader JavaScript ecosystem.
The application developer-facing changes are fairly minimal, and there are few potentially breaking semantic changes to the operation of the addon.
Please review the 2.0 Upgrade Guide for a thorough description of the changes for app and addon users alike.
New Features
-
Use
@tracked
underneath on Ember 3.16+ (#354)Note: Within applications with both tracked & computed properties,
if using a native getter to access task state, and wishing to use it
alongside a computed property, @dependantKeyCompat will need to be used on
the getter as expected with any other tracked-prop using getter. -
Implement decorators from
ember-concurrency-decorators
. The "nice" decorators
fromember-concurrency-decorators
are now built-in to ember-concurrency, without
requiring an additional addon or seperate import. All decorators are available for
import directly from the top-levelember-concurrency
package.Addon maintainers: Please see notes in
UPGRADING-2.x.md
if you're using
decorators currently, and wish to support both ember-concurrency 1.x and 2.x at
runtime.
Enhancements
-
Migrate task lifetimes to
@ember/destroyable
underneath, rather than
patchingwillDestroy
(#377).Potentially breaking: this drops support for Node 8 and Ember < 3.8 LTS
-
[docs] Rewrite documentation to use native classes and decorators, and update tutorial
to show rewriting of async function code, rather than Promise code, as is more common
today. -
Make
Task#cancelAll
andTaskInstance#cancel
awaitable (#396). See
topic in UPGRADING-2.x.md for more info.
Removals
-
Remove ability to directly use tasks with
{{action}}
helper stuff
(deprecated in 1.3.0) (#374) -
Remove
get
andset
compatibility methods fromTask
,TaskGroup
,
andTaskInstance
. -
Drop unused
broccoli-file-creator
andember-maybe-import-regenerator
dependencies.Note on
ember-maybe-import-regenerator
: This was originally added back when
generator support in browsers was far lower and Babel 5 and 6 were used. The
addon does nothing for Babel 7, which is used forember-concurrency
these
days. Tweakingconfig/targets.js
or adding the regenerator Babel plugin to
your babel config can be done instead if the regenerator runtime is needed
to transpile generators for older browsers.
2.0.0-rc.2
Enhancements
- Make
Task#cancelAll
andTaskInstance#cancel
awaitable (#396). See
topic in UPGRADING-2.x.md for more info.
Bugfixes
- Fix
TaskProperty
extension methods not working with built-in decorators
(e.g.ember-concurrency-retryable
,ember-concurrency-test-waiters
, etc.)
Misc.
- [dev] Add test for interop w/ ember-concurrency-decorators
- [dev] Migrate CI to GitHub Actions (#393)