Skip to content

ref: Clean up new integrations API and pave migration path #10165

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 2 commits into from

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Jan 12, 2024

This PR intends to supersede this PR and our current migration path because it is very convoluted and leads to potential typing issues. #10143

What is different?

  • We keep all the integration classes as we had them before (they need to stick around for v7 in any case - we can remove them in v8). This sadly involves reverting all of our class-removal work, however, the work wasn't entirely in-vain, as all the refactoring to reduce state will help us when we completely move the logic from classes to functions.
  • We introduce a helper function similar to rollup and vite's defineConfig() function that let's us and users create integration factories in a type-safe manner.
  • We expose functional-alternatives for all of our integrations that do nothing else than simply instantiating the class equivalent. For this, we can also use the helper function.

What will this do?

  • Will keep the typings for our class-based integrations.
  • The return types of the functional integrations will not be widened to Integration but will exactly represent the return value as it is. We can evaluate whether this is beneficial for us because it, in theory and counter-intuitively, widens our API. We could also decide on an integration-by-integration basis whether an integration should be of the type Integration or it's actual shape.

Are there any drawbacks?

No.

@lforst lforst force-pushed the lforst-pave-integrations-migration-path branch from d71199c to 974e6cd Compare January 12, 2024 12:53
Copy link
Contributor

github-actions bot commented Jan 12, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.05 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.41 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.05 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.44 KB (+0.16% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.03 KB (+0.11% 🔺)
@sentry/browser - Webpack (gzipped) 22.37 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 74.69 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 66.34 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 32.17 KB (+0.07% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 23.98 KB (+0.09% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 209.07 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 97.12 KB (+0.15% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 71.73 KB (+0.2% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 35.18 KB (+0.04% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.78 KB (+0.06% 🔺)
@sentry/react - Webpack (gzipped) 22.41 KB (+0.18% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.44 KB (+0.05% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.55 KB (+0.09% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17 KB (0%)

@lforst lforst closed this Jan 19, 2024
@lforst lforst deleted the lforst-pave-integrations-migration-path branch December 3, 2024 09:53
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.

1 participant