Skip to content

chore: update effect to v4 release candidate - #162

Closed
antonin-morel-spiko wants to merge 1 commit into
mainfrom
chore/effect-v4
Closed

antonin-morel-spiko wants to merge 1 commit into
mainfrom
chore/effect-v4

Conversation

@antonin-morel-spiko

Copy link
Copy Markdown

No description provided.

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.

Copilot review overview

🟡 Changes recommended

Critical layer scope regressions and unresolved dependency and listener-lifecycle issues must be addressed.

Review effort: Lite
Findings: 3 High severity · 2 Medium severity

Open (5)
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)))
Comment thread package.json
"@effect/platform": "^0.96.0",
"@effect/vitest": "^0.29.0",
"@effect/language-service": "^0.87.2",
"@effect/vitest": "^4.0.0-rc.117",
Comment thread pnpm-lock.yaml
effect: ^3.21.0
vitest: ^3.2.0
effect: ^4.0.0-rc.117
vitest: '>=5.0.0 <6.0.0'
@antonin-morel-spiko

Copy link
Copy Markdown
Author

Full migration in #163

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