Skip to content

release: 2.1.0 - #112

Merged
alessandrobellesia merged 9 commits into
mainfrom
develop
Sep 30, 2026
Merged

alessandrobellesia merged 9 commits into
mainfrom
develop

Conversation

@alessandrobellesia

Copy link
Copy Markdown
Member

Release 2.1.0

Awaitable actions, plus the fixes needed to make their guarantees hold (#110).

Added

  • read(), submit() and remove() return an awaitable object (a PromiseLike, like VueUse's useFetch). const { isSuccess } = await remove({ id }) now waits for the request and gives plain booleans. Before, await returned the reactive object at once and isSuccess was a ComputedRef, always truthy, so the success branch also ran on failed requests.
  • Awaiting never rejects, settles on the execution started by the call (the first one with autoExecute), resolves at once to the current snapshot when the call starts no execution, and never starts a request itself.

Changed

  • Code that awaited an action, or returned it from an async function, and then used its refs now gets plain values (migration note in the CHANGELOG and in the README "Await" section).
  • Actions are cleaned up when the effect scope that created them is disposed: components behave as before, and effectScope() and Pinia setup stores are now covered too.

Fix

  • An action awaited outside any effect scope (an event handler) now releases its query once it settles, instead of staying in the store for ever.
  • A request that cannot be built (a missing path parameter) no longer makes execute() reject: the query gets the error.
  • A read() joining an in-flight request no longer rejects when that request fails, keeps the shared error, and reports an aborted shared request as aborted: true.

Notes

Minor bump because the API change is additive; the one behavior change for existing code is documented under "Changed". Known limitation, tracked in #111: re-executing a query can abort a request that belongs to another query.

The skill files also drop em and en dashes (docs only).

See CHANGELOG.md for the full [2.1.0] entry.

🤖 Generated with Claude Code

Alessandro Bellesia and others added 6 commits September 30, 2026 16:35
Use a colon, a comma or a new sentence instead, matching the house style
for prose. Mechanical change: 59 lines, no wording changes otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const { isSuccess } = await remove({ id })` returned the reactive object
at once, before the request ended, and `isSuccess` was a ComputedRef,
always truthy, so the success branch also ran on failed requests.

The value returned by the three actions is now a PromiseLike, like
VueUse's useFetch. Awaiting it settles on the execution started by the
call and resolves to the plain snapshot `execute()` resolves to. It never
rejects, resolves at once to the current snapshot when the call starts no
execution (`immediate: false`, or `executeWhen` false), and never starts
a request itself, so thenable assimilation cannot run an action twice.
The template refs of the provider components stay non thenable.

Fixes found while making those guarantees hold:
- a read joining an in-flight request with the same params rejected when
  that request failed, lost the shared error, and reported an aborted
  shared request as not aborted;
- a request that could not be built (a missing path parameter) made
  `execute()` reject and left the query idle;
- actions are now cleaned up when their effect scope is disposed, and an
  action awaited outside any scope (an event handler) releases its query
  once it settles, unless `keepAlive`; such queries used to stay in the
  store for ever.

Code that awaited an action and then used its refs now gets plain
values: see the migration note in the CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SonarCloud rule S7739 flags any object with a `then` property, which
failed the quality gate on reliability. The awaitable is intentional, and
the rule exempts a `then` member of a class that declares
`implements PromiseLike`: move `then` into such a class so the intent is
stated in the code instead of suppressed. `then` stays an own arrow
function field, so destructuring, spreading and reactive proxies keep
working, and the public types are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prefer `toHaveLength()` and `toBeUndefined()` over generic `toBe()`
assertions for clearer failure reports (SonarCloud S5906). Only the lines
added by this branch; existing tests are left as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
S7739 exempts a `then` field declared by a class that implements
PromiseLike, but still flagged the `this.then = ...` assignment in the
constructor. Initialize the field directly and keep its state in `#`
private fields, which stay out of the object the action returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat: make read, submit and remove awaitable
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0021acd2-fc8e-4691-915b-43b547c62c5e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

SonarCloud rule S9383 (floating promises) flags the eight `execute()` and
`resubmit()` calls made by the autoExecute, executeWhen, window focus and
document visibility handlers, and fails the quality gate of the release
PR. They are fire and forget by design, and `execute()` never rejects: a
failure lands in the query state. Mark them with `void`, as the rule
suggests for promises that cannot practically reject. No behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Alessandro Bellesia and others added 2 commits September 30, 2026 17:27
Minor/patch bumps: @types/node, eslint, unplugin-dts, vite and vitest;
packageManager pnpm@12.4.2 -> pnpm@12.8.1.

Held back on purpose:
- typescript stays at 6.0.3: TS 7 drops the JavaScript Compiler API until
  7.1, which breaks declaration emit in unplugin-dts;
- vitest resolves to 5.0.2, not 5.0.3: 5.0.3 was published a few hours
  ago and pnpm's one-day minimum release age applies; the next update
  picks it up.

No newly locked package version is younger than one day. The emitted
.d.ts files are byte for byte identical to the ones before the update.
Type-check, lint, the 81 unit tests and the build all pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore: update dependencies (2026-09-30) and mark fire and forget executions
@sonarqubecloud

Copy link
Copy Markdown

@alessandrobellesia
alessandrobellesia merged commit 3b0424d into main Sep 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant