Skip to content

feat: Export browser integrations individually #5028

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

Merged
merged 3 commits into from
May 3, 2022

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented May 3, 2022

Currently users consume integrations like so:

const INTEGRATIONS = {
  ...windowIntegrations,
  ...CoreIntegrations,
  ...BrowserIntegrations,
};

export { INTEGRATIONS as Integrations };

This cannot be tree-shaken because a new object is being constructed with multiple object spreads.

In this PR, we switch to exporting everything individually. This means users don't have import the entire INTEGRATIONS object in, allowing it to be treeshaken.

@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone May 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 18.74 KB (-6.96% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 58.55 KB (-9.38% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 17.55 KB (-6.95% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 52.73 KB (-9.03% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.21 KB (-17.35% 🔽)
@sentry/browser - Webpack (minified) 62.08 KB (-24.03% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.23 KB (-17.39% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 42.9 KB (-10.73% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 24.51 KB (-5.99% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.09 KB (-5.67% 🔽)

Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

🎄

@AbhiPrasad AbhiPrasad merged commit 3532b33 into 7.x May 3, 2022
@AbhiPrasad AbhiPrasad deleted the v7-abhi-integration-tree-shake branch May 3, 2022 20:11
AbhiPrasad added a commit that referenced this pull request May 30, 2022
In this PR, we switch to exporting everything individually. This means users don't have import the entire `INTEGRATIONS` object in, allowing it to be treeshaken.
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.

2 participants