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
fix: reduce toolbar bundle size by 60% #20122
Conversation
Size Change: -1.37 MB (-61%) 🏆 Total Size: 863 kB
|
📸 UI snapshots have been updated6 snapshot changes in total. 0 added, 6 modified, 0 deleted:
Triggered by this commit. |
@Twixes the toolbar is bundling more of lemon ui than I think it should... which means it's getting half a meg of formatting code it will never use. There don't seem to be any tools to investigate this other than thinking 😱 Tagging you since it's lemon ui... and in case you've any suggestions on how to investigate 😊 |
Oh wow, we definitely don't need a lot of this. @pauldambra By "investigate" do you mean finding out why this is not being tree-shaked? It definitely should be, but I have never looked into how we do tree-shaking at all, so would have to start with reading into that part of our ESBuild process 😅 |
Ah, that makes two of us 🙈 You're welcome to ignore this then and I'll keep it spinning in the background |
📸 UI snapshots have been updated756 snapshot changes in total. 0 added, 756 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated42 snapshot changes in total. 0 added, 42 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
LGTM but I don't feel confident enough to YOLO, maybe someone else with more experience on the codebase + bundlers can take a look as well. |
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.
Looks good.
Any idea where the remaining antd.less
styling is coming from? Based on this comment it suggests we removed it from the toolbar at some point
ah, no, is a dangling comment from me getting over excited in the past 🙈 |
Ah ok, maybe we can remove it though 🤔 I'll have a look where we're still relying on antd in the toolbar because it's not imported directly anywhere in that directory |
I think in the tooltip component still? We use lemon-ui, so while we're still using antd there then I think we're stuck... |
Another reason to get this PR in #20160 💪 |
@joethreepwood in case you do changelog before wednesday all hands this one should definitely go in |
* output analyzable build info for the toolbar * don't use code snippet it adds half a meg * Update UI snapshots for `chromium` (2) * use esbuild visualizer instead * fix * allow treeshaking and remove circular dependency from imports toolbar uses * fix * lint the mjs files at the root of frontend folder * no need to mention lemonui at all * no ned to specify metafile * don't allow posthog-js to sneak into the toolbar * simpler date picker so fewer dependencies * maybe this * like this? * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * ragE * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * too easy to break things this way * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (1) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * around the houses * Reset snapshots to master * explain why there's a plugin * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (1) * Update UI snapshots for `chromium` (2) * Update UI snapshots for `webkit` (2) * Update UI snapshots for `chromium` (2) * fix * fix * Update UI snapshots for `webkit` (2) * fix * Update UI snapshots for `webkit` (2) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Toolbar is 2.2MB of JS, that's an awful lot...
a production build shows half a meg of syntax highlighting