Skip to content

✨ add Result.cause alias and deprecate error in v4 - #1264

Open
jrandolf wants to merge 6 commits into
thefrontside:v4from
jrandolf:jrandolf/result-reason-v4
Open

jrandolf wants to merge 6 commits into
thefrontside:v4from
jrandolf:jrandolf/result-reason-v4

Conversation

@jrandolf

@jrandolf jrandolf commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Provide the v4 migration path for the field rename requested in #1229.

Approach

Add cause as a non-enumerable, read-only alias of error, and deprecate error. Keep cause optional in Result<T> so existing object literals remain valid. Error wrapping and unboxing stay compatible with v4.

Coverage includes alias identity, changes through error, legacy results, and allSettled(). Local Deno tests, lint, formatting, type checks, and the Node test build pass.

Fix CI by naming the benchmark package to prevent npm's audit crash.

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/effection@1264

commit: 1e7b52e

@codspeed

codspeed Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing jrandolf:jrandolf/result-reason-v4 (1e7b52e) with v4 (c623418)

Open in CodSpeed

@jrandolf jrandolf changed the title ✨ add Result.reason alias and deprecate error in v4 ✨ add Result.cause alias and deprecate error in v4 Nov 2, 2026

This branch was successfully deployed

1 active deployment
Preview — 1e7b52ed Deployed Nov 2, 2026 by jrandolf via deploy-preview #1449
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