ember-concurrency is an Ember Addon that enables you to write concise, worry-free, cancelable, restartable, asynchronous tasks.
MIT License
Bot releases are visible (Hide)
Published by machty 9 months ago
.perform
method (and curry with fn
helper if needed) rather than to use the classic perform
helper, which doesn't really add much value anymoreperform
are now directly importable within .gts/.gjs files.Published by machty 9 months ago
Published by maxfierke about 1 year ago
peerDependencies
(#542, thanks @mkszepp!)taskFor()
deprecation (#540, thanks @MichalBryxi!)Published by maxfierke about 1 year ago
Note: Due to a tagging snaffu during the release of 3.0.0, it was functionally the same as 2.3.7. This release (3.1.0) also includes the changes intended for 3.0.0
Published by machty over 1 year ago
Published by machty about 2 years ago
this
param, e.g.myTask = task(async () => {})
(#477)@task
decorator based APIs to the new async-arrow fn
npx machty-ember-concurrency-codemods async-arrow-task app/**/*.ts
npx machty-ember-concurrency-codemods async-arrow-task app/**/*.js
ember-concurrency-ts
, run the following codemod to remove taskFor()
npx machty-ember-concurrency-codemods rm-ember-concurrency-ts app/**/*.ts
npx machty-ember-concurrency-codemods rm-ember-concurrency-ts app/**/*.js
Published by machty about 2 years ago
NOTE: v2.3.2 simplifies the new task() API even more further; you should upgrade to that (or higher!)
myTask = task(this, { drop: true }, async (arg: string) => {})
. This new API@task
decorator based APIs to the new async-arrow fn
npx machty-ember-concurrency-codemods async-arrow-task app/**/*.ts app/**/*.js
ember-concurrency-ts
, run the following codemod to remove taskFor()
npx machty-ember-concurrency-codemods rm-ember-concurrency-ts app/**/*.ts app/**/*.js
ember-concurrency-ts
and ember-concurrency-async
packages are no longer neededTaskProperty
registerModifier
API.onError
parameter to perform
helper to allow UI-triggered tasks torun.once
(#442, fixes #437. Thanks @stefanpenner forRead more about Yieldables in the ember-concurrency docs
@lastValue
does not support chained property access (#429)perform
and cancel-all
helpers, which prevented proper instrumentation. (#414, fixes #409)task-instance
module alias (#411, thanks @mydea!)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.
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
from ember-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-level ember-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.
Migrate task lifetimes to @ember/destroyable
underneath, rather than
patching willDestroy
(#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
and TaskInstance#cancel
awaitable (#396). See
topic in UPGRADING-2.x.md for more info.
Remove ability to directly use tasks with {{action}}
helper stuff
(deprecated in 1.3.0) (#374)
Remove get
and set
compatibility methods from Task
, TaskGroup
,
and TaskInstance
.
Drop unused broccoli-file-creator
and ember-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 for ember-concurrency
these
days. Tweaking config/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.
Task#cancelAll
and TaskInstance#cancel
awaitable (#396). SeeTaskProperty
extension methods not working with built-in decoratorsember-concurrency-retryable
, ember-concurrency-test-waiters
, etc.)