Skip to content

⬆️ Upgrade effection to 4.1.0 - #224

Merged
taras merged 4 commits into
mainfrom
deps/effection-4.1
Aug 4, 2026
Merged

⬆️ Upgrade effection to 4.1.0#224
taras merged 4 commits into
mainfrom
deps/effection-4.1

Conversation

@taras

@taras taras commented Jul 31, 2026

Copy link
Copy Markdown
Member

Why

Every package already declared effection: "^4", but the lockfile was pinned at 4.0.2, so the workspace never actually picked up 4.1. This refreshes the lockfile so all 28 workspace projects resolve 4.1.0.

What surfaced

Moving off 4.0.2 broke @effectionx/inline in two separate ways. Both are fixed here.

1. inline was silently a no-op on 4.1 (runtime bug)

inline splices an operation into the current frame by swapping the coroutine's iterator, which it did by redefining iterator on routine.data with a getter.

Up to 4.0.2 the reducer drove the routine by reading routine.data.iterator through that getter, so shadowing the property worked. Since the task/coroutine lifecycle unification, Coroutine.step() reads a closure variable that only data's setter writes, and never consults the property:

step() {
  ...
  return iterator.next(resumeWith.value);   // closure variable, not data.iterator
}

So the override was ignored and the routine kept driving the original iterator. inline did nothing. Fixed by assigning through the setter (data.iterator = ...) instead of redefining the property.

This was a real test failure, not a theoretical one — inline.test.ts was returning undefined/NaN where it expected values.

2. Coroutine["data"].iterator is no longer in the public types

It was dropped from the published Coroutine type in 4.0.3 — not 4.1 — and the repo never noticed because the lockfile hadn't moved. mod.ts now restates the field locally.

Worth raising upstream: inline is built entirely on this field, and there is currently no supported way to reach it — it is absent from the public types and step() bypasses the accessor. If swapping a routine's iterator is meant to be part of the low-level Effect/Coroutine surface, it probably needs both a type and a stable path through step().

3. inline had no devDependency on effection

Despite importing it in mod.ts, inline.test.ts, esbuild.test.ts and swc.test.ts. It was resolving through root hoisting. Now declared, matching every other package.

deno-deploy/deno.json was the last thing in the repo bound to effection 3 (npm:effection@^3^4). That package is deprecated and excluded from the pnpm workspace, so nothing else about it changes.

Version bumps

@effectionx/inline 0.0.10.0.2.

Verification

Run locally with the SWC wasm plugin built (pnpm build), matching CI:

  • pnpm install --frozen-lockfile — clean; all 28 projects resolve effection@4.1.0
  • pnpm check, pnpm check:tsrefs, pnpm lint, pnpm fmt:check — clean
  • pnpm test:node34 passed, 0 failed (was failing before the inline fix)
  • pnpm test381 passed, 6 skipped
  • pnpm test:matrixall 10 combinations pass, including effection 3.0.0 and 4.1.0

Follow-ups (separate PRs)

First of three. Next: a policy documenting that async teardown must use ensure() rather than a finally block, then the migration of the 8 sites in this repo that currently yield* inside finally.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@taras, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8712def2-b286-426e-bb13-1aebf0a56ac6

📥 Commits

Reviewing files that changed from the base of the PR and between 3c3a4e3 and 5e145e9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • deno-deploy/deno.json
  • inline/mod.ts
  • inline/package.json
📝 Walkthrough

Walkthrough

The changes update Effection imports to version 4, add typed access to the runtime iterator in inline, and increment the inline package version to 0.0.2.

Changes

Effection v4 compatibility

Layer / File(s) Summary
Inline runtime compatibility
inline/mod.ts, deno-deploy/deno.json, inline/package.json
inline defines RoutineData with the runtime iterator field and uses the type when accessing it. Effection references now use version ^4.
Package release metadata
inline/package.json
The inline package version changes from 0.0.1 to 0.0.2.

Estimated code review effort: 1 (Trivial) | ~5 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Policy Compliance ❌ Error The published inline/package.json has a valid description and version bump but no required keywords array under the Strict package metadata policy. Add an approved non-empty keywords array to inline/package.json, such as ["interop"], then update the lockfile if needed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: upgrading Effection to version 4.1.0.
Description check ✅ Passed The description provides detailed motivation, approach, scope, fixes, version changes, and verification results.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps/effection-4.1

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.

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@effectionx/inline@224

commit: 5e145e9

Comment thread inline/mod.ts Outdated
Comment thread inline/mod.ts Outdated
@taras
taras requested a review from cowboyd July 31, 2026 17:58
taras added 4 commits July 31, 2026 14:45
The lockfile was pinned at effection 4.0.2 while every package already
declared `effection: "^4"`, so the workspace never picked up 4.1. Refresh
the lockfile so all 28 workspace projects resolve 4.1.0.

Two things surfaced once the resolution moved:

- `@effectionx/inline` reads `Coroutine["data"].iterator` — swapping that
  iterator is the whole mechanism of the package. It is still there at
  runtime, but it was dropped from Effection's public `Coroutine` type in
  4.0.3, so the type check failed. Restate the field locally.

- `inline` imports effection in `mod.ts` and in its tests but had no
  devDependency on it, and was resolving through root hoisting. Declare it.

`deno-deploy/deno.json` was the last thing bound to effection 3; its import
map now points at ^4. The package is deprecated and excluded from the pnpm
workspace, so nothing else about it changes.
`inline` splices an operation into the current frame by swapping the
coroutine's iterator. It did that by redefining `iterator` on `routine.data`
with a getter.

That stopped working. Up to 4.0.2 the reducer drove the routine by reading
`routine.data.iterator` through its getter, so shadowing the property was
enough. Since the task/coroutine lifecycle unification, `Coroutine.step()`
reads a closure variable that only `data`'s setter writes, and never
consults the property — so the override was silently ignored and the
routine kept driving the original iterator.

Assign through the setter instead. Restores `inline`, `esbuild` and `swc`
node tests, which were failing on 4.1.0 with undefined/NaN results.
Both comments opened by narrating what the code does. Keep only what a
reader cannot infer: the field is absent from the published types, and
assigning is not interchangeable with defining the property.
The type comment gave the version the field was dropped in; what matters
is that the omission is deliberate because it's a private API. The
assignment comment described the mechanism; lead with the instruction,
since the failure it prevents is silent.
@taras
taras force-pushed the deps/effection-4.1 branch from 902cebb to 5e145e9 Compare July 31, 2026 18:45
@taras
taras merged commit d1ecfeb into main Aug 4, 2026
7 checks passed
@taras
taras deleted the deps/effection-4.1 branch August 4, 2026 22:41
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.

2 participants