Skip to content

feat(effect): Add Effect v4 beta support - #20395

Merged
JPeer264 merged 2 commits into
developfrom
jp/effect-v4
Apr 21, 2026
Merged

feat(effect): Add Effect v4 beta support#20395
JPeer264 merged 2 commits into
developfrom
jp/effect-v4

Conversation

@JPeer264

Copy link
Copy Markdown
Member

closes#20388

This PR adds support for Effect v4 - it also acts as umbrella PR for other PRs, so it is easier to review and digest. All information of each functionality can be viewed in the PRs of each squashed commit

@JPeer264JPeer264 self-assigned this Apr 20, 2026
@github-actions

github-actionsBot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser25.88 kB--
@sentry/browser - with treeshaking flags24.35 kB--
@sentry/browser (incl. Tracing)43.81 kB--
@sentry/browser (incl. Tracing + Span Streaming)45.5 kB--
@sentry/browser (incl. Tracing, Profiling)48.73 kB--
@sentry/browser (incl. Tracing, Replay)82.98 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags72.5 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)87.67 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)99.93 kB--
@sentry/browser (incl. Feedback)42.7 kB--
@sentry/browser (incl. sendFeedback)30.55 kB--
@sentry/browser (incl. FeedbackAsync)35.55 kB--
@sentry/browser (incl. Metrics)27.16 kB--
@sentry/browser (incl. Logs)27.29 kB--
@sentry/browser (incl. Metrics & Logs)27.98 kB--
@sentry/react27.62 kB--
@sentry/react (incl. Tracing)46.05 kB--
@sentry/vue30.71 kB--
@sentry/vue (incl. Tracing)45.62 kB--
@sentry/svelte25.89 kB--
CDN Bundle28.55 kB--
CDN Bundle (incl. Tracing)44.94 kB--
CDN Bundle (incl. Logs, Metrics)29.93 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)46.03 kB--
CDN Bundle (incl. Replay, Logs, Metrics)68.89 kB--
CDN Bundle (incl. Tracing, Replay)81.96 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)83.03 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)87.46 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)88.55 kB--
CDN Bundle - uncompressed83.4 kB--
CDN Bundle (incl. Tracing) - uncompressed134.3 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed87.55 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed137.72 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed211.12 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed251.75 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed255.14 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed264.66 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed268.05 kB--
@sentry/nextjs (client)48.58 kB--
@sentry/sveltekit (client)44.22 kB--
@sentry/node-core58.02 kB+0.02%+8 B 🔺
@sentry/node174.89 kB-0.01%-1 B 🔽
@sentry/node - without tracing97.98 kB+0.02%+13 B 🔺
@sentry/aws-serverless115.21 kB+0.02%+18 B 🔺

View base workflow run

@JPeer264
JPeer264 marked this pull request as ready for review April 21, 2026 08:44

@cursorcursorBot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2a84a99. Configure here.

Comment threadpackages/effect/src/metrics.ts
This PR is only renaming Effect v3 e2e tests, which had no versioning,
to one with a version. This makes it easier in the future to distinguish
between Effect v3 and v4 tests.
So effectively this has changed:
- `effect-node` -> `effect-3-node`
- `effect-browser` -> `effect-3-browser`
This adds support to Effect v4, but also keeps the compatibility for v3.
There is no way that we can unit test against v3, as the
`devDependencies` need to use `effect@4` and an updated `@effect/vitest`
version, which is not compatible with Effect v3 (this is added in
The API for Effect v4 has changed a little, so there are safeguards to
detect if it is v3 or v4 and uses the correct API. The good part is that
for users nothing changed, so they still can use the same methods in
their app as before (ofc, respecting the new Effect v4 API).
Before (Effect v3):
```ts
const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
dsn: '__DSN__',
tracesSampleRate: 1.0,
enableLogs: true,
}),
Layer.setTracer(Sentry.SentryEffectTracer),
Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
Sentry.SentryEffectMetricsLayer,
);
```
After (Effect v4):
```js
const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
dsn: '__DSN__',
tracesSampleRate: 1.0,
enableLogs: true,
}),
Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer),
Logger.layer([Sentry.SentryEffectLogger]),
Sentry.SentryEffectMetricsLayer,
);
```
Both usages still work and are represented in the E2E tests.
Comment threadpackages/effect/src/metrics.ts
@JPeer264
JPeer264 merged commit 57d6012 into developApr 21, 2026
246 checks passed
@JPeer264
JPeer264 deleted the jp/effect-v4 branch April 21, 2026 13:19
Sign up for freeto 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.

Support Effect v4 beta

2 participants

@JPeer264@nicohrubec