feat(core): Export all feature flag integrations from core#16680
feat(core): Export all feature flag integrations from core#16680
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 frameworks, 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.
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-frameworks 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