Skip to content

feat(effect-ts): support Effect v4 - #880

Merged
jorisre merged 2 commits into
masterfrom
feat/effect-ts-v4
Oct 19, 2026
Merged

jorisre merged 2 commits into
masterfrom
feat/effect-ts-v4

Conversation

@jorisre

@jorisre jorisre commented Oct 18, 2026

Copy link
Copy Markdown
Member

Migrate the Effect resolver to Effect v4 Schema APIs:

  • decode with Schema.decodeUnknownEffect (replaces the removed ParseResult module)
  • format issues with SchemaIssue.makeFormatterStandardSchemaV1, keeping the issue _tag as the error type
  • accept Schema.Codec<Output, Input> schemas

Closes #878

BREAKING CHANGE: the effect-ts resolver now requires effect@^4.0.0; Effect v3 is no longer supported. Schemas must be migrated to the Effect v4 Schema API (e.g. Schema.nonEmptyString() -> .check(Schema.isNonEmpty()), Schema.Union(a, b) -> Schema.Union([a, b]), Schema.transform -> Schema.decodeTo). Error type values follow Effect v4 issue tags: Type -> InvalidType, Missing -> MissingKey, Refinement -> Filter, Unexpected -> UnexpectedKey, plus new AnyOf and InvalidValue. Default error messages now come from Effect v4 (e.g. is missing -> Missing key, and the received value is no longer included).

Copilot AI balanced review requested due to automatic review settings October 18, 2026 13:41
Migrate the Effect resolver to Effect v4 Schema APIs:
- decode with `Schema.decodeUnknownEffect` (replaces the removed `ParseResult` module)
- format issues with `SchemaIssue.makeFormatterStandardSchemaV1`, keeping the issue `_tag` as the error `type`
- accept `Schema.Codec<Output, Input>` schemas

Closes #878

BREAKING CHANGE: the effect-ts resolver now requires `effect@^4.0.0`; Effect v3 is no longer supported.
Schemas must be migrated to the Effect v4 Schema API (e.g. `Schema.nonEmptyString()` -> `.check(Schema.isNonEmpty())`, `Schema.Union(a, b)` -> `Schema.Union([a, b])`, `Schema.transform` -> `Schema.decodeTo`).
Error `type` values follow Effect v4 issue tags: `Type` -> `InvalidType`, `Missing` -> `MissingKey`, `Refinement` -> `Filter`, `Unexpected` -> `UnexpectedKey`, plus new `AnyOf` and `InvalidValue`.
Default error messages now come from Effect v4 (e.g. `is missing` -> `Missing key`, and the received value is no longer included).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃煝 Approval recommended

Static review found no blocking issues, and focused tests cover the migrated behavior; tests were not executed.

No open issues 馃帀

What changed in this PR

Migrates the Effect resolver to Effect v4, replacing v3 support and updating integration guidance.

Changes:

  • Uses v4 decoding and issue-formatting APIs while preserving error tags.
  • Updates dependencies and schema examples.
  • Expands validation, transformation, asynchronous decoding, and type-inference coverage.
File Description
tsconfig.json Adds Effect module-resolution paths.
README.md Documents v4 requirements and usage.
package.json Updates Effect dependencies and build globals.
effect-ts/鈥媠rc/鈥媏ffect-ts.ts Migrates decoding, schema types, and error formatting.
effect-ts/鈥媠rc/鈥媉_tests__/鈥媠pecial-path-names.ts Migrates special-field-name validation.
effect-ts/鈥媠rc/鈥媉_tests__/鈥婩orm.tsx Updates form schemas to v4.
effect-ts/鈥媠rc/鈥媉_tests__/鈥婩orm-native-validation.tsx Updates native-validation schemas to v4.
effect-ts/鈥媠rc/鈥媉_tests__/鈥媏ffect-ts.ts Expands coverage and migrates inference tests.
effect-ts/鈥媠rc/鈥媉_tests__/鈥媉_snapshots__/鈥媏ffect-ts.ts.snap Updates expected error messages and tags.
effect-ts/鈥媠rc/鈥媉_tests__/鈥媉_fixtures__/鈥媎ata.ts Migrates shared schema fixtures.
effect-ts/鈥媝ackage.json Requires Effect v4.
bun.lock Locks the updated Effect dependency.

Review effort: Balanced

@jorisre
jorisre requested a review from bluebill1049 October 18, 2026 13:45

@bluebill1049 bluebill1049 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice one! LGTM

@jorisre
jorisre merged commit a5ab308 into master Oct 19, 2026
6 of 7 checks passed
@jorisre
jorisre deleted the feat/effect-ts-v4 branch October 19, 2026 05:11
@github-actions

Copy link
Copy Markdown
Contributor

馃帀 This PR is included in version 6.0.0 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Effect v4 now that it is stable

3 participants