Skip to content

feat(integrations): Make ES6 integration bundles #4718

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
Mar 18, 2022

Conversation

lobsterkatie
Copy link
Member

This changes the build config in the integrations package to generate ES6 bundles as well as ES5 bundles, in preparation for going ES6-first in v7. Which JS version to build is controlled by an environment variable, in order that the builds be parallelizable.

Ref: https://getsentry.atlassian.net/browse/WEB-693

@github-actions
Copy link
Contributor

github-actions bot commented Mar 15, 2022

size-limit report

Path Base Size (a7a6ea5) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.49 KB 19.49 KB 0%
@sentry/browser - ES5 CDN Bundle (minified) 62.17 KB 62.17 KB 0%
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.11 KB 18.11 KB -0.01% 🔽
@sentry/browser - ES6 CDN Bundle (minified) 55.5 KB 55.5 KB 0%
@sentry/browser - Webpack (gzipped + minified) 22.41 KB 22.41 KB 0%
@sentry/browser - Webpack (minified) 76.82 KB 76.82 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.45 KB 22.45 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 46.62 KB 46.62 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.36 KB 25.36 KB 0%
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.72 KB 23.72 KB 0%

Copy link
Contributor

@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.

Apart from a minor concern about the verbosity option the changes look good to me!

@lobsterkatie lobsterkatie force-pushed the kmclb-make-es6-integration-bundles branch from 6eac695 to 67c62c7 Compare March 18, 2022 00:24
@lobsterkatie lobsterkatie force-pushed the kmclb-make-es6-integration-bundles branch from 67c62c7 to 2724c3c Compare March 18, 2022 00:37
Copy link
Contributor

@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.

Looks good!

@lobsterkatie lobsterkatie merged commit a0cb3bb into master Mar 18, 2022
@lobsterkatie lobsterkatie deleted the kmclb-make-es6-integration-bundles branch March 18, 2022 08:09
lobsterkatie added a commit to getsentry/sentry-docs that referenced this pull request Mar 22, 2022
A number of PRs (see below) have recently added to the bundles available for use on the CDN. This documents the new options, and does some general wordsmithing on the page.

Bundle-adding PRs:
getsentry/sentry-javascript#4674
getsentry/sentry-javascript#4699
getsentry/sentry-javascript#4718
lobsterkatie added a commit that referenced this pull request Mar 23, 2022
In #4718, a change was made to use an environment variable to control the version of JS emitted when building integration bundles. Unfortunately, the values then given to that variable were uppercase, whereas our code assumes a lowercase version. Further, the default output is ES6 (in preparation for going ES6-first in v7), so when the version flag `ES5` doesn't match the checked-for `es5`, we emit ES6 in the supposedly-ES5 bundle.

This controls for casing by casting the value to lowercase before comparison.

Fixes #4768.
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