Simplify web worker registry to reduce bundle size #11511
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The web worker class registry
register
function previously accepted a class name, introduced in #5804. Since then, a lot has changed, including switch to ES / Rollup and dropping both IE11 & ES5 transpilation, so classes are now first-class citizen and we can rely on theirname
property.The class names we specified for
register
were strings scattered across the codebase that didn't get minified and no longer served any purpose. Getting rid of them (and having asserts to make sure classes have names and we register those that are transferred) lands us a free -566 bytes gzipped bundle reduction.Note that I also removed
shallow
option which was unused since its introduction, and had to adjust Flow handling in one unrelated part of code (no idea why Flow started complaining where it was silent before, probably a bug).Launch Checklist