-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(build): Parallelize integration bundling #4707
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
Conversation
size-limit report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Good idea to use environment variables to pass the file name!
Side question: As far as I can see, we're currently "only" producing ES5 versions of the integration bundles. Is this because of localforage?
No, with (I was about to say, "Anyway, soon enough we'll only have ES6 versions," but it occurs to me that in fact if we're going to continue to publish a legacy browser bundle, we also probably are going to want to publish legacy integration and tracing bundles as well. It'll just be a matter of which JS version is the default.) |
I see, makes sense, thanks. That's gonna be a lot of bundles 😅 |
Fortunately, you need two totally separate instances of the TS plugin to target ES5 vs ES6, so those definitely can be run side by side. (Famous last words...) |
69bacaa
to
e5355ce
Compare
Given that now most of our testing runs in parallel in CI, the biggest bottleneck has become the build step. Within that step, the single slowest thing we do is build integration bundles, simply because of the number of bundles which need to be created. (This is especially true now that we're creating three versions of each bundle rather than two.)
To speed things up a bit, this parallelizes the building of those bundles. Though it ends up not being as dramatic a time savings as one might hope (because the typescript plugin's caching mechanism doesn't play nicely with concurrent builds), it nonetheless drops the total build time from roughly two minutes down to 70-80 seconds in my local testing.
Ref: https://getsentry.atlassian.net/browse/WEB-664