Skip to content

chore(deps): upgrade Effect to 4.2 and replace TypeScript with tsrs - #7923

Merged
jgoux merged 7 commits into
developfrom
chore/effect-4.2-tsrs
Dec 3, 2026
Merged

jgoux merged 7 commits into
developfrom
chore/effect-4.2-tsrs

Conversation

@jgoux

@jgoux jgoux commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Upgrades Effect to 4.2, refreshes the mise toolchain, and moves type checking and type-aware linting from TypeScript and tsgolint to tsrs.

Effect 4.2

  • effect and @effect/* are on 4.2.0, and the local patches are rebased onto it.
  • API contract generation uses Codegen.Module.
  • Tests that relied on 4.1 scheduling or handle shapes are adjusted, for example the bench-cli test now uses TestClock.
  • The Effect skill is reviewed against 4.2.0: it covers withRateLimiter's failsWith, capping Retry-After waits, reason-based error recovery, shared test layers and empty-string config values.

Toolchain

  • mise tools are refreshed, including Node 26.14.0 and Bun. The setup action pins mise-action v5.3.0.
  • tsrs replaces typescript and oxlint-tsgolint:
    • types:check runs tsrs --noEmit;
    • the config package emits its declarations with tsrs, byte-identical to the TypeScript 7.0.2 output;
    • oxlint's type-aware rules run on tsrs-lint.
  • effect-tsgo patch now patches oxlint and the tsrs binary (--oxlint --tsrs). packageExtensions keep those patched copies private in the pnpm store.
  • knip moves to 6.48, whose tsrs plugin enables itself from the tsrs dependency.

New Effect lint rules

@effect/tsgo 0.73.4 adds recommended rules, and this PR adopts them across the repo:

  • Schema.TaggedError classes carry a brand type.
  • Conditional catches use catchIf and filterOrFail.
  • Cleanups that only run on failure use onError.
  • Optional values use succeedNone, succeedSome and asSome.

unstable-api-usage is off, because most Effect v4 platform modules are marked unstable. experimental-api-usage is off only for the API codegen scripts, which depend on effect/Codegen.

This PR touches .github/actions/setup, a release-infrastructure path. The change only bumps the mise-action version, which v2.x does not need in order to keep releasing, so no backport is planned.

- Upgrade effect and @effect/* to 4.2.0, rebase the patches, and migrate
  API contract generation to Codegen.Module.
- Refresh the mise toolchain, including Node 26.14.0 and Bun.
- Replace typescript and oxlint-tsgolint with tsrs for type checking,
  declaration emit, and type-aware linting.
- Upgrade @effect/tsgo to 0.73.4 and adopt its new recommended rules.
@jgoux
jgoux requested review from a team and supabase-oss as code owners December 2, 2026 15:25
@jgoux
jgoux requested a review from Coly010 December 2, 2026 15:25
@jgoux jgoux self-assigned this Dec 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@4da4e91 supplied to reviewers (advisory, not a style pass).

Both independent reviews were available. Seven findings merged into five. The review confirms a new ARM64 musl build prerequisite, a benchmark test that can hang on early launch failure, two native test wrappers that lose signal status, and stale config build instructions. The reported functions download directory replacement is refuted by the order of operations. The diff contains no changed CLI reference prose. Verification was by source inspection because the checkout lacked installed dependencies.

Findings

Severity Location Category Sources Claim
🟡 MINOR mise.lock:134 toolchain claude+codex The new Node pin requires a local build toolchain on ARM64 musl. A minimal Alpine environment that could install the previous binary can now fail during setup.
🟡 MINOR apps/cli/scripts/bench-cli.integration.test.ts:469 test-reliability claude+codex The benchmark timeout test can hang if the launch fails before writing its PID.
🟡 MINOR packages/stack/src/host/CommandRunner.native-cleanup.integration.test.ts:95 test-fidelity codex Two native cleanup fixtures lose signal termination status when wrapping real child processes.
⚪ NIT packages/config/AGENTS.md:136 docs claude The @<!---->supabase/config build documentation still names tsc after the build switched to tsrs.

Findings outside the diff

  • ⚪ NIT packages/config/AGENTS.md:136 — The @<!---->supabase/config build documentation still names tsc after the build switched to tsrs.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/src/commands/functions/download/download.integration.test.ts:593 (filesystem): The Bun upgrade lets functions download remove an empty directory at the temporary bundle path and replace it with a file in the same invocation.
    Refuted: apps/cli/src/shared/functions/download.ts:978–995 writes the bundle before extraction and skips cleanup if the write fails at the fixed legacy path. The test at apps/cli/src/commands/functions/download/download.integration.test.ts:518–534 covers a pre-existing empty directory and expects a write failure. A directory introduced during extraction can reach the cleanup at apps/cli/src/shared/functions/download.ts:1084, after the sole bundle write.

Stats

Claude findings: 3 · Codex findings: 4 · Confirmed: 4 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread mise.lock Resolved
Forward real exit status in native wrapper fixtures and name tsrs in the config build docs.
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit b24f0a5 against develop at db9167e · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 99 ms 104 ms no real change
supabase --help help 104 ms 102 ms no real change
supabase init init 131 ms 128 ms no real change
supabase migration new bench migration-new 149 ms 137 ms no real change (-8%, within normal variation)
supabase config convert config-convert 151 ms 148 ms no real change
supabase config validate config-validate 157 ms 156 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 173 ms 167 ms no real change
supabase projects list projects-list 139 ms 139 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 153 ms 153 ms no real change

API calls: unchanged for all 9 commands.

Binary size: 135.3 MB, up 132.0 KB from 135.2 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 93-122 ms 91-115 ms +5 ms (+5%) within noise
supabase --help help 92-116 ms 93-125 ms -3 ms (-2%) within noise
supabase init init 98-140 ms 102-145 ms -2 ms (-2%) within noise
supabase migration new bench migration-new 131-170 ms 128-179 ms -11 ms (-8%) within noise
supabase config convert config-convert 143-169 ms 129-174 ms -2 ms (-2%) within noise
supabase config validate config-validate 147-192 ms 147-170 ms -1 ms (-1%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 153-197 ms 147-178 ms -5 ms (-3%) within noise
supabase projects list projects-list 127-171 ms 130-184 ms 0 ms (0%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 128-168 ms 134-177 ms 0 ms (0%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

jgoux added 3 commits December 3, 2026 09:41
Bump knip to 6.48.0, whose tsrs plugin enables itself from the tsrs dependency, and drop the forced TypeScript plugin.
jgoux added 2 commits December 3, 2026 11:30
Effect 4.2 maps ENOTEMPTY to the new DirectoryNotEmpty reason. The
telemetry allowlist is now exhaustive over SystemErrorTag, so a new
reason is a type error. The bench launch fixture writes its PID to a
relative path, so the temp directory name is never shell-expanded.
@jgoux
jgoux added this pull request to the merge queue Dec 3, 2026
Merged via the queue into develop with commit c1a04a9 Dec 3, 2026
53 checks passed
@jgoux
jgoux deleted the chore/effect-4.2-tsrs branch December 3, 2026 12:06
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