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

feat(build): webpack visualizer #29875

Merged
merged 5 commits into from
Aug 7, 2024
Merged

feat(build): webpack visualizer #29875

merged 5 commits into from
Aug 7, 2024

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Aug 6, 2024

SUMMARY

Some updates to the bundle analyzer in honor of @kgabryje's recent efforts. This PR does several things:

  • Adds a new npm run bundle-stats script to run package bundle analysis
  • Makes webpack's production build process (a.k.a. npm run build) exits when complete.
  • Removes the earlier webpack-bundle-analyzer flag in favor of the new npm script
  • Sets webpack-bundle-analyzer to static mode rather than server mode.
  • Adds a new bundle analyzer with a sunburst chart, which makes some aspects easier
  • Has BOTH bundle analyzers open at the end of the build process in your browser.

Here's what the new bundle analyzer looks like:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas rusackas requested a review from kgabryje August 6, 2024 18:00
@dosubot dosubot bot added the change:frontend Requires changing the frontend label Aug 6, 2024
@kgabryje
Copy link
Member

kgabryje commented Aug 6, 2024

Nice! I wonder if we should run the plugin only if a flag is passed, like we do with bundle analyzer

@rusackas
Copy link
Member Author

rusackas commented Aug 6, 2024

@kgabryje check out the updated PR description, it all works pretty smoothly now.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM!

@rusackas rusackas merged commit 9b95acc into master Aug 7, 2024
35 checks passed
@rusackas rusackas deleted the webpack-visualizer branch August 7, 2024 16:21
@michael-s-molina
Copy link
Member

Given that we removed --analyzeBundle parameter, should we add something to UPDATING.md?

@rusackas
Copy link
Member Author

rusackas commented Aug 7, 2024

Given that we removed --analyzeBundle parameter, should we add something to UPDATING.md?

Happy to if you want. I only skipped it since neither Kamil nor I could get the --analyzeBundle parameter to actually WORK. We both just tweak the code to run the analyzer, it turns out. I figured this basically takes a broken tool and makes it work, and it's a dev tool rather than user-facing, so I wasn't sure how much value there is.

What might cover this would actually be a Wiki page explaining what all our scripts do, since there are a TON of them, and there's not really any real documentation on the whole lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants