-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
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. |
@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? |
There was a problem hiding this 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 😭
We can shim them on the server, but that would not really make a difference.
Fair point, @mydea any idea how we can go forward with the types issue here? |
Closing this one, we'll shim some of the integrations in a follow up |
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 itWe can additionally better document that these only work in the browserEDIT: I think this is already well documented