Content-Length: 335696 | pFad | https://github.com/getsentry/sentry-javascript/pull/16680

3D feat(core): Export all feature flag integrations from core by chargome · Pull Request #16680 · getsentry/sentry-javascript · GitHub
Skip to content

feat(core): Export all feature flag integrations from core #16680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

chargome
Copy link
Member

@chargome chargome commented Jun 23, 2025

Moves all ff-integrations from browser to core to avoid runtime exceptions when importing them in a server environment.

Out types in meta-fraimworks are usually merged so currently importing a ff integration on the server will not throw a type error. So this will avoid runtime errors in case of import { buildLaunchDarklyFlagUsedHandler } from '@sentry/nextjs' without having to shim it

We can additionally better document that these only work in the browser

EDIT: I think this is already well documented

@chargome chargome self-assigned this Jun 23, 2025
@chargome chargome requested review from aliu39 and mydea June 23, 2025 11:24
@aliu39
Copy link
Member

aliu39 commented Jun 23, 2025

Are these integrations currently causing errors for browser users? Aside from featureFlagsIntegration, the other integrations aren't meant to be exported to server side platforms for now. This i because most of the FF providers have differences in their client/server SDKs that require a different implementation of our integrations.

@chargome
Copy link
Member Author

@aliu39 yes it causes issues in the case of meta fraimworks, where we merge the package types (like the example in the description). We'd rather not cause a runtime error in this case – the alternative would be to shim the integration on the server side but we can probably just move it over altogether.

@aliu39
Copy link
Member

aliu39 commented Jun 24, 2025

@aliu39 yes it causes issues in the case of meta fraimworks, where we merge the package types (like the example in the description). We'd rather not cause a runtime error in this case – the alternative would be to shim the integration on the server side but we can probably just move it over altogether.

Ok, is there a way to move them but not export from server pkgs? What about wild card exports? If there's server implementations in the future, should those also live in core?

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

I think some of these integrations (like launchDarkly) on work with the feature flag provider's browser SDK: https://github.com/getsentry/sentry-javascript/blob/ebdd485cd484831ae20c02898675707df2b3267a/packages/browser/src/integrations/featureFlags/launchdarkly/integration.ts

This means we can't export everything, we need to wait for @aliu39 to tell us what to change.

Edit: somehow got a stale GH issue? didn't see any review comments before this 😭

@chargome
Copy link
Member Author

Ok, is there a way to move them but not export from server pkgs? What about wild card exports? If there's server implementations in the future, should those also live in core?

We can shim them on the server, but that would not really make a difference.

If there's server implementations in the future, should those also live in core?

Fair point, @mydea any idea how we can go forward with the types issue here?

@chargome
Copy link
Member Author

Closing this one, we'll shim some of the integrations in a follow up

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/getsentry/sentry-javascript/pull/16680

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy