Skip to content

ref(build): Programmatically generate base CDN rollup config #4650

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

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Feb 28, 2022

As part of the new build process, this continues the work centralizing the rollup config for our CDN bundles. More specifically, this creates a function to generate the base configs for @sentry/tracing, @sentry/vue, and @sentry/wasm, and changes each of their respective rollup configs to use it. As expected with a pure refactor, there are no bundle changes.

Not included in this PR are @sentry/browser and @sentry/integrations. Because their respective rollup configs are more complicated, they'll be handled in future PRs. As a result, code which will, once those are handled, replace much of the code in the repo-level rollup.config.js has instead been added, so as to not break their current build processes.

Note that the added dev dependency doesn't actually change yarn.lock, because deepmerge is already included, as a transitive dependency.

ref: https://getsentry.atlassian.net/browse/WEB-632

@github-actions
Copy link
Contributor

github-actions bot commented Feb 28, 2022

size-limit report

Path Base Size (7525490) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.77 KB 19.77 KB 0%
@sentry/browser - ES5 CDN Bundle (minified) 63.47 KB 63.47 KB 0%
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.44 KB 18.44 KB -0.01% 🔽
@sentry/browser - ES6 CDN Bundle (minified) 56.6 KB 56.6 KB 0%
@sentry/browser - Webpack (gzipped + minified) 22.2 KB 22.2 KB 0%
@sentry/browser - Webpack (minified) 76.36 KB 76.36 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.23 KB 22.23 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 46.4 KB 46.4 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.23 KB 27.23 KB -0.01% 🔽

@lobsterkatie lobsterkatie merged commit 995928b into master Mar 1, 2022
@lobsterkatie lobsterkatie deleted the kmclb-programmatically-generate-base-CDN-rollup-config branch March 1, 2022 14:17
lobsterkatie added a commit that referenced this pull request Mar 1, 2022
…#4652)

This uses the config-generating function introduced in #4650 to generate the rollup config for the integrations package. There is no effect on bundle contents.
lobsterkatie added a commit that referenced this pull request Mar 1, 2022
…4654)

This builds on #4650, which introduced a function to generate rollup configs for our CDN bundles, allowing that function to handle both ES5 and ES6 compilation. No change to bundle contents.

Note: This doesn't make any difference for the four packages the change is applied to here, but will enable `@sentry/browser` to use the new config generation function, a change which will come in a future PR.
lobsterkatie added a commit that referenced this pull request Mar 2, 2022
As part of centralizing and unifying our CDN rollup config, this uses the config generation function introduced in #4650 to generate the config for all browser bundles.

Unlike many of the other PRs in this series, this one does actually have an effect on certain bundles, to wit:

- `_mergeOptions` is no longer a protected-from-minifcation property, as it's about to be extracted into a stand-alone function. (See #4625.)

- Up until this point, one difference between the `@sentry/browser` rollup config and all of the other rollup configs was the former's use of the `__SENTRY_NO_DEBUG__` flag to suppress logs in the minified bundles. Rather than add a parameter to the function controlling whether or not each package should use the flag, I decided it was better to just apply the flag to all minified bundles.
AbhiPrasad pushed a commit that referenced this pull request Mar 2, 2022
…#4652)

This uses the config-generating function introduced in #4650 to generate the rollup config for the integrations package. There is no effect on bundle contents.
AbhiPrasad pushed a commit that referenced this pull request Mar 2, 2022
…4654)

This builds on #4650, which introduced a function to generate rollup configs for our CDN bundles, allowing that function to handle both ES5 and ES6 compilation. No change to bundle contents.

Note: This doesn't make any difference for the four packages the change is applied to here, but will enable `@sentry/browser` to use the new config generation function, a change which will come in a future PR.
AbhiPrasad pushed a commit that referenced this pull request Mar 2, 2022
As part of centralizing and unifying our CDN rollup config, this uses the config generation function introduced in #4650 to generate the config for all browser bundles.

Unlike many of the other PRs in this series, this one does actually have an effect on certain bundles, to wit:

- `_mergeOptions` is no longer a protected-from-minifcation property, as it's about to be extracted into a stand-alone function. (See #4625.)

- Up until this point, one difference between the `@sentry/browser` rollup config and all of the other rollup configs was the former's use of the `__SENTRY_NO_DEBUG__` flag to suppress logs in the minified bundles. Rather than add a parameter to the function controlling whether or not each package should use the flag, I decided it was better to just apply the flag to all minified bundles.
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