Skip to content
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

feature: Webpack Chunking #7645

Merged
merged 1 commit into from
May 27, 2021
Merged

feature: Webpack Chunking #7645

merged 1 commit into from
May 27, 2021

Conversation

icirellik
Copy link
Contributor

@icirellik icirellik commented May 27, 2021

This PR modifies our Webpack bundling strategy to follow several common patterns used elsewhere in the industry.

Creates a minimal chunk for each App
Creates a minimal commons chunk for each App
Create a framework chunk for @artsy framework code to ensure that it will not be cache-invalidated
Create a framework chunk for core framework code to ensure that it will not be cache-invalidated
Creates library chunks for any large node_module dependencies
Creates shard chunks for any code used by multiple pages

Additional Optimizations

  • Reduces the number of low KiB bundles by using naming common preloaded chunks
  • Restricts bundles to 240 KiB unzipped
  • Cleans up legacy code that was accidentally imported by the orders page

Notable Impacts:

Reduces the Artist page JS bundle payload by ~275 KiB compressed

* Reduces the number of sub KiB bundles by using V2 application scope as
  the common denominator.
* Restricts bundles to 240 KiB unzipped
* Cleans up legacy imports accidentally included by the orders page.
Copy link
Contributor

@joeyAghion joeyAghion left a comment

Choose a reason for hiding this comment

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

The dependency clean-up seems like an obvious win. Some of the other novo/22820 simplification also seems helpful. Hard to tell about the deep-webpack stuff though.

What should we monitor to understand the production impact? Ideas:

  • Total requests to assets CDN (after an initial warm-up period, given the name changes)
  • I don't think we expect initial/landing page times to be better, right? But if navigations between modern pages should improve, maybe pages per session?
  • ...others?

@joeyAghion joeyAghion merged commit 692f02b into master May 27, 2021
@joeyAghion joeyAghion deleted the feature-webpack-chunking branch May 27, 2021 17:36
@damassi
Copy link
Member

damassi commented May 27, 2021

Nice! 👍

This was referenced May 27, 2021
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.

3 participants