Skip to content

build(cdn): Move tracing CDN bundle generation to @sentry/browser #7617

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 6 commits into from
Mar 27, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 27, 2023

Now all (standalone) CDN bundle generation is in a single place.

This allows us to streamline the build process a bit, as this is now all inside of browser.
It also means we can get rid of the (IMHO a bit confusing) PW_TRACING_ONLY flag for the browser integration tests. Now we just pass the bundle.

Finally, integration tests that depend on tracing will now actually only run in a tracing-enabled CDN bundle, the same as we do this for replay. This does mean a bit more boilerplate in the tests, but actually makes it very explicit which CDN bundle supports what. Previously, we'd just use the tracing bundle even when running in non-tracing builds for these tests.

Now all (main) CDN bundle generation is in a single place.
@mydea mydea added Package: browser Issues related to the Sentry Browser SDK Package: tracing Dev: Build labels Mar 27, 2023
@mydea mydea requested review from timfish, Lms24 and AbhiPrasad March 27, 2023 08:03
@mydea mydea self-assigned this Mar 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.57 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 64.2 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.13 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 56.58 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 21.59 KB (0%)
@sentry/browser - Webpack (minified) 71.66 KB (0%)
@sentry/react - Webpack (gzipped + minified) 21.61 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 51.95 KB (+0.14% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.12 KB (+0.68% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.33 KB (+0.85% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 44.37 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.44 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 63 KB (+0.67% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 56.1 KB (-0.01% 🔽)

@mydea
Copy link
Member Author

mydea commented Mar 27, 2023

I also updated the bundle build to run this in parallel for es5 & es6, as it is becoming quite slow.

@mydea
Copy link
Member Author

mydea commented Mar 27, 2023

For reference, this exports a few more things in the tracing CDN bundle than before:

image

This explains the slightly increased bundle size, because it now includes:

image

Is this OK, or should this not be in the tracing CDN bundles? (it was always in the browser CDN bundles, AFAIK)

@mydea mydea changed the title build(browser): Move tracing CDN bundle generation to @sentry/browser build(cdn): Move tracing CDN bundle generation to @sentry/browser Mar 27, 2023
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.

It's important the bundles have unified exports, esp for the loader, so I think the bundle size increase is fine.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

@mydea mydea merged commit 0ed4f87 into develop Mar 27, 2023
@mydea mydea deleted the fn/cdn-bundles-build branch March 27, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: Build Package: browser Issues related to the Sentry Browser SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants