-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Version 3: Split reporting UI from dependency graph size calculation #97
Conversation
Only the entrypoints to inner modules now calculate the chart data
It no longer functions the same as chartData fetching was moved to higher layers.
Move chart data calculation to source code edges
With this step, building and testing works but linting does not yet.
Setup Lerna monorepo, splitting reporter to new package
This was a blooper done in 14b6356
Switch lerna and yarn to use workspaces
@@ -3,6 +3,7 @@ sudo: false | |||
branches: | |||
only: | |||
- master | |||
- version-3 |
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.
This will need to be removed right before merging. This is needed here so that branches against this version-3
branch have their tests ran in CI. See #143 (comment)
* Extract Logger class to own package * Add README.md for logger package
I think I might get to this again at some point, but this branch has lived for long enough so far that continuing from here would cause undue hassle. I'll close this PR for now. |
This is a tracking PR for getting to version 3.
What? What is version 3?
Version 3 will split the reporting UI (the treemap reporter) from the webpack code.
This allows users to create any kind of reporter, while the webpack plugin and CLI would provide the raw data containing post-minification and gzipped sizes.
How can you help?
Please leave me a comment on your thoughts on this idea, or even add a reaction to this PR description so I could see how many are interested in this at all.
How did I come up with this idea?
The thing that started this eventual process was an experimental PR #25 — I wanted to see if I could add a sunburst chart visualizer to
webpack-bundle-analyzer
alongside the treemap visualizer.It seems that I wasn't the only one, @bitpshr had also done a much more finished version of a sunburst chart:
And sunbursts are just one possible visualizer. What about a VR-based bundle content visualizer? https://twitter.com/ken_wheeler/status/872939627656728578
What has happened before this PR?
I have figured out how
webpack-bundle-analyzer
works and pondered what would be the best approach to have a custom reporter.And then me and @th0r figured that the best solution would be to split analyzer from the treemap UI code: #32
I've tested various different approaches to this problem: #40 (with explanation in #32 (comment)), a proof of concept of this in valscion#1 and generally just figuring things out.
Architectural changes
This repository is converted to a monorepo (like Babel), and the maintenance work is handled with Lerna.
New packages (to be) created:
webpack-bundle-analyzer
plugin works to help in migrationThese package splits are still not set in stone, and I'll evaluate the best choices for split points as I go.
TODO (that will change as I think things through)
I intend to work on this by creating new PRs for distinct features that point to this branch instead of
master
. This way I can work in smaller steps, and hopefully have more focused PRs.build
automatically for all packages before publishing new versionsNice things to have:
chartData
boundaries, and use the same types in reporter and pluginreporterOptions
which reporters themselves can use