Repository navigation
chore: update effect to v4 release candidate - #162
Closed
antonin-morel-spiko wants to merge 1 commit into
Closed
antonin-morel-spiko wants to merge 1 commit into
antonin-morel-spiko wants to merge 1 commit into
Conversation
antonin-morel-spiko
requested review from
nicolas-assouad-spiko
and
a lite review from Copilot
September 28, 2026 08:26
antonin-morel-spiko
force-pushed
the
chore/effect-v4
branch
from
September 28, 2026 08:30
80ac640 to
f620424
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical layer scope regressions and unresolved dependency and listener-lifecycle issues must be addressed.
Review effort: Lite
Findings: 3
Open (5)
Use Layer.scoped for scope-dependent resource layer · New Use Layer.scoped to consume the layer's scope requirement · New Use Layer.scoped for the NATS drain finalizer · New Vitest version conflicts with @effect/vitest peer requirement · New Lockfile resolves Vitest version incompatible with @effect/vitest · New
What changed in this PR
This pull request migrates the repository from Effect 3 to Effect 4 RC across dependencies, integrations, tests, and examples.
Changes:
- Updates Effect packages and lockfile.
- Migrates services, layers, schemas, streams, schedules, and concurrency APIs.
- Updates AMQP/NATS tests and examples.
- Adds an Effect v4 changeset.
Review findings include unresolved scope/layer regressions in AMQP and NATS, an incompatible Vitest peer dependency, and missing listener cleanup in closeStream.
| File | Reviewed changes |
|---|---|
pnpm-lock.yaml |
Updates Effect v4 RC resolutions; Vitest peer remains incompatible. |
packages/nats/test/NATSSubscriber.test.ts |
Updates subscriber tests for Effect v4 APIs. |
packages/nats/test/NATSConnection.test.ts |
Updates connection tests, collections, fibers, and clocks. |
packages/nats/test/JetStreamSubscriber.test.ts |
Updates scheduling, fibers, and test APIs. |
packages/nats/test/JetStreamManager.test.ts |
Updates collections and test APIs. |
packages/nats/test/JetStreamClient.test.ts |
Updates collections and test APIs. |
packages/nats/src/NATSSubscription.ts |
Updates option construction. |
packages/nats/src/NATSPublisher.ts |
Updates retry defaults and tracing. |
packages/nats/src/NATSMessage.ts |
Migrates options and service APIs. |
packages/nats/src/NATSHeaders.ts |
Updates HTTP tracing imports. |
packages/nats/src/NATSError.ts |
Migrates defect schema definitions. |
packages/nats/src/NATSConnection.ts |
Migrates connection services and layers; scope consumption needs correction. |
packages/nats/src/JetStreamStreamAPI.ts |
Updates option construction. |
packages/nats/src/JetStreamStream.ts |
Updates option construction. |
packages/nats/src/JetStreamPublisher.ts |
Updates retry defaults and tracing. |
packages/nats/src/JetStreamMessage.ts |
Migrates options and service APIs. |
packages/nats/src/JetStreamManager.ts |
Migrates manager services and layers. |
packages/nats/src/JetStreamDirectStreamAPI.ts |
Updates option construction. |
packages/nats/src/JetStreamConsumer.ts |
Updates option construction. |
packages/nats/src/JetStreamClient.ts |
Migrates client services and layers. |
packages/nats/package.json |
Updates Effect dependencies. |
packages/nats/examples/publisher.ts |
Migrates service declaration syntax. |
packages/core/test/SubscriberRunner.test.ts |
Updates Effect v4 test APIs. |
packages/core/src/SubscriberError.ts |
Migrates schema syntax. |
packages/core/src/PublisherError.ts |
Migrates schema syntax. |
packages/core/src/internal/SubscriberRunner.ts |
Updates concurrency and duration APIs. |
packages/core/src/internal/SubscriberOTel.ts |
Updates cause handling. |
packages/core/package.json |
Updates Effect dependencies. |
packages/amqp/test/AMQPSubscriber.test.ts |
Updates fibers, schedules, and clocks. |
packages/amqp/test/AMQPConnection.test.ts |
Updates test clock usage. |
packages/amqp/test/AMQPChannel.test.ts |
Updates test clock usage. |
packages/amqp/src/internal/closeStream.ts |
Migrates callback stream handling; listener cleanup remains needed. |
packages/amqp/src/internal/AMQPConnection.ts |
Migrates connection internals. |
packages/amqp/src/internal/AMQPChannel.ts |
Migrates channel and callback internals. |
packages/amqp/src/AMQPSubscriber.ts |
Updates HTTP tracing imports. |
packages/amqp/src/AMQPPublisher.ts |
Updates retry defaults. |
packages/amqp/src/AMQPError.ts |
Migrates schema syntax. |
packages/amqp/src/AMQPConsumeMessage.ts |
Migrates the context service API. |
packages/amqp/src/AMQPConnection.ts |
Migrates connection services and layers; scope consumption needs correction. |
packages/amqp/src/AMQPChannel.ts |
Migrates service, duration, and layer APIs; scope consumption needs correction. |
packages/amqp/package.json |
Updates Effect dependencies. |
packages/amqp/examples/subscriber.ts |
Updates generator syntax. |
packages/amqp/examples/publisher.ts |
Migrates service syntax. |
packages/amqp/examples/establish-connection.ts |
Updates generator syntax. |
package.json |
Updates Effect tooling; Vitest remains incompatible with @effect/vitest. |
.changeset/effect-v4.md |
Documents the Effect v4 migration. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| AMQPError.AMQPChannelError | AMQPError.AMQPConnectionError, | ||
| AMQPConnection.AMQPConnection | ||
| > => Layer.scoped(AMQPChannel, make(options)) | ||
| > => Layer.effect(AMQPChannel, make(options)) |
| AMQPConnection, | ||
| AMQPError.AMQPConnectionError | ||
| > => Layer.scoped(AMQPConnection, make(url, options)) | ||
| > => Layer.effect(AMQPConnection, make(url, options)) |
| NATSConnection, | ||
| NATSError.NATSConnectionError | ||
| > => Layer.scoped(NATSConnection, make(() => NATSCore.wsconnect(options))) | ||
| > => Layer.effect(NATSConnection, make(() => NATSCore.wsconnect(options))) |
| "@effect/platform": "^0.96.0", | ||
| "@effect/vitest": "^0.29.0", | ||
| "@effect/language-service": "^0.87.2", | ||
| "@effect/vitest": "^4.0.0-rc.117", |
| effect: ^3.21.0 | ||
| vitest: ^3.2.0 | ||
| effect: ^4.0.0-rc.117 | ||
| vitest: '>=5.0.0 <6.0.0' |
Author
|
Full migration in #163 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.