Skip to content

feat(effect): Add base skaffolding for Effect.ts#19622

Open
JPeer264 wants to merge 3 commits intojp/add-effect-sdkfrom
jp/add-effect-sdk-stack/1
Open

feat(effect): Add base skaffolding for Effect.ts#19622
JPeer264 wants to merge 3 commits intojp/add-effect-sdkfrom
jp/add-effect-sdk-stack/1

Conversation

@JPeer264
Copy link
Member

@JPeer264 JPeer264 commented Mar 4, 2026

This is one of many PRs to create the effect SDK. Once this has been merged I will open the draft PR for the effect sdk and create the plan in there.

(the almost final SDK can be viewed here: https://github.com/getsentry/sentry-javascript/tree/jp/effect-sdk. It might be that some specifics change, especially when having browser + server split, and with tracing)


This PR focuses on the base skaffolding of @sentry/effect. This on its own is not really doing anything except setting up the skaffold. The README already reflects the actual usage, while the export doesn't exist yet, this will come in another PR (also init is exposed here, just for the sake of completeness)

@JPeer264 JPeer264 requested review from andreiborza and s1gr1d March 4, 2026 08:30
@JPeer264 JPeer264 self-assigned this Mar 4, 2026
} from '@sentry/core';

export { EffectClient } from './client';
export { init } from './sdk';
Copy link

Choose a reason for hiding this comment

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

Feat PR missing integration or E2E tests

Low Severity

This is a feat PR that introduces a new package (@sentry/effect) with exported init, EffectClient, and re-exported core APIs, but includes no integration or E2E tests. The review rules require that feat PRs include at least one integration or E2E test. Adding basic tests for init and EffectClient construction would help catch regressions early.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. That will come once implemented. They are already written, maybe not to perfection just yet.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.63 kB added added
@sentry/browser - with treeshaking flags 24.13 kB added added
@sentry/browser (incl. Tracing) 42.43 kB added added
@sentry/browser (incl. Tracing, Profiling) 47.09 kB added added
@sentry/browser (incl. Tracing, Replay) 81.25 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.87 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 85.95 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 98.21 kB added added
@sentry/browser (incl. Feedback) 42.44 kB added added
@sentry/browser (incl. sendFeedback) 30.3 kB added added
@sentry/browser (incl. FeedbackAsync) 35.35 kB added added
@sentry/browser (incl. Metrics) 26.8 kB added added
@sentry/browser (incl. Logs) 26.94 kB added added
@sentry/browser (incl. Metrics & Logs) 27.61 kB added added
@sentry/react 27.38 kB added added
@sentry/react (incl. Tracing) 44.77 kB added added
@sentry/vue 30.08 kB added added
@sentry/vue (incl. Tracing) 44.3 kB added added
@sentry/svelte 25.66 kB added added
CDN Bundle 28.17 kB added added
CDN Bundle (incl. Tracing) 43.26 kB added added
CDN Bundle (incl. Logs, Metrics) 29.01 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 44.1 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 68.09 kB added added
CDN Bundle (incl. Tracing, Replay) 80.14 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 85.65 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.53 kB added added
CDN Bundle - uncompressed 82.35 kB added added
CDN Bundle (incl. Tracing) - uncompressed 128.07 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.19 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.9 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.85 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.95 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.77 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.86 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.67 kB added added
@sentry/nextjs (client) 47.18 kB added added
@sentry/sveltekit (client) 42.89 kB added added
@sentry/node-core 52.24 kB added added
@sentry/node 174.61 kB added added
@sentry/node - without tracing 97.39 kB added added
@sentry/aws-serverless 113.19 kB added added

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,168 - - added
GET With Sentry 1,763 19% - added
GET With Sentry (error only) 6,120 67% - added
POST Baseline 1,186 - - added
POST With Sentry 605 51% - added
POST With Sentry (error only) 1,059 89% - added
MYSQL Baseline 3,292 - - added
MYSQL With Sentry 489 15% - added
MYSQL With Sentry (error only) 2,721 83% - added


const MainLive = HttpLive.pipe(
Layer.provide(
Sentry.effectLayer({
Copy link
Member

Choose a reason for hiding this comment

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

Do we export effectLayer? I only see init getting exported 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

The README already reflects the actual usage, while the export doesn't exist yet, this will come in another PR (also init is exposed here, just for the sake of completeness)

This will be added in later steps.

}),
transport: options.transport,
};

Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to call applySdkMetadata with the needed arguments here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed sdk.ts entirely, as we don't need it.

@JPeer264 JPeer264 force-pushed the jp/add-effect-sdk-stack/1 branch from 04bb301 to 86f7209 Compare March 4, 2026 11:00
Copy link

@cursor cursor bot left a comment

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 2 potential issues.

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

setMeasurement,
getSpanStatusFromHttpCode,
setHttpStatus,
} from '@sentry/core';
Copy link

Choose a reason for hiding this comment

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

Missing init export despite PR description claiming inclusion

Medium Severity

The PR description explicitly states "also init is exposed here, just for the sake of completeness" but init is neither defined nor exported anywhere in packages/effect/src/index.ts. Every other SDK package in this repo (nestjs, bun, svelte, react, etc.) defines its own init function that wraps initAndBind from @sentry/core and calls applySdkMetadata. Neither init nor applySdkMetadata exists in this package. A reviewer also flagged the missing applySdkMetadata call.

Fix in Cursor Fix in Web

it('has correct exports', () => {
expect(index.captureException).toBeDefined();
});
});
Copy link

Choose a reason for hiding this comment

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

No integration or E2E test for feat PR

Low Severity

Per the review rules, a feat PR needs at least one integration or E2E test. The only test present checks that captureException (a re-export from @sentry/core) is defined. It doesn't test any new behavior introduced by this package.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

@@ -0,0 +1,52 @@
# Sentry Effect SDK
Copy link
Member

Choose a reason for hiding this comment

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

l: Let's mark this alpha and follow our general structure for READMEs, e.g. https://github.com/getsentry/sentry-javascript/blob/develop/packages/tanstackstart-react/README.md#official-sentry-sdk-for-tanstack-start-react-alpha

And let's also add the notice below regarding potential breaking changes. Unlike our tss readme, I'd use Github's proper announcement boxes.

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.

3 participants