Skip to content

Releases: machty/ember-concurrency

2.3.0 - async arrow fn tasks

24 Aug 01:13
Compare
Choose a tag to compare

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 fn
        • npx machty-ember-concurrency-codemods async-arrow-task app/**/*.ts app/**/*.js
      • If you've used ember-concurrency-ts, run the following codemod to remove taskFor()
        • npx machty-ember-concurrency-codemods rm-ember-concurrency-ts app/**/*.ts app/**/*.js
  • The ember-concurrency-ts and ember-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

09 Feb 04:33
Compare
Choose a tag to compare

Bugfixes

  • Added missing TypeScript types for onState task modifier and
    TaskFactory#setOnState (#449, fixed #447. Thanks @johanrd for the heads up!)

2.2.0

27 Oct 03:52
Compare
Choose a tag to compare

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 the TaskProperty
    prototype extension method of implementing task modifiers to be deprecated
    in favor of the registerModifier API.
  • Add onError parameter to perform helper to allow UI-triggered tasks to
    specify alternative or null error handlers (#443, fixes #435. Thanks
    @lolmaus for the discussion)

Bugfixes

2.1.2

29 Jul 16:41
Compare
Choose a tag to compare

Bugfixes

  • Expose TaskInstance state inside encapsulated tasks (#434)

Misc

2.1.0

01 Jun 16:26
Compare
Choose a tag to compare

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

  • Avoid applying task state updates out of order (#423, #426, fixes #422)

Docs

  • [docs] Document that @lastValue does not support chained property access (#429)

2.0.3

17 Mar 16:38
Compare
Choose a tag to compare

Bugfixes

  • Remove runloop binding for perform and cancel-all helpers, which prevented proper instrumentation. (#414, fixes #409)
  • Fix incorrect import for deprecated private task-instance module alias (#411, thanks @mydea!)

Misc

2.0.2

22 Feb 06:21
Compare
Choose a tag to compare

Bugfixes

  • Ensure lastRunning resets one-by-one as tasks are completed, successfully
    or not. (Fixes #403)
  • Expose lastValue decorator in TS definitions (Fixes #404)

2.0.1

17 Feb 03:27
Compare
Choose a tag to compare

Bugfixes

  • Prevent synchronous errors in cancelable promise helpers from being rethrown asynchronously later (#402, fixes #400. thanks @Turbo87 for flagging!)
  • Restore access to host context from encapsulated tasks (#401)

2.0.0

15 Feb 18:46
Compare
Choose a tag to compare

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
    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.

Enhancements

  • 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.

Removals

  • 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.

2.0.0-rc.2

20 Jan 06:34
Compare
Choose a tag to compare
2.0.0-rc.2 Pre-release
Pre-release

Enhancements

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)