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
#4000: Dynamically load brick UI to reduce bundle size #6777
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6777 +/- ##
==========================================
- Coverage 70.03% 69.98% -0.05%
==========================================
Files 1193 1195 +2
Lines 36967 36976 +9
Branches 6939 6939
==========================================
- Hits 25888 25877 -11
- Misses 11079 11099 +20
☔ View full report in Codecov by Sentry. |
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
@@ -37,6 +36,11 @@ class ToggleQuickbarEffect extends EffectABC { | |||
inputSchema: Schema = propertiesToSchema({}, []); | |||
|
|||
async effect(): Promise<void> { | |||
const { toggleQuickBar } = await import( | |||
/* webpackChunkName: "quickBarApp" */ | |||
"@/components/quickBar/QuickBarApp" |
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.
In these PRs make sure that these files are exclusively imported this way, because import()
alone doesn't guarantee that.
See
What does this PR do?
Refactored Imports
tourController
Discussion
Demo
Background Page without font-awesome/rjsf/etc.
Future Work
Most impactful?: Figure out why font-awesome tree-shaking is broken (I suspect it will still need to be in the entry point of sidebar/etc., but it should be significantly smaller), or switch to deep imports: https://fontawesome.com/docs/apis/javascript/tree-shakingUpdate: tree-shaking is working as expected. The problem is we include font-awesome's icon packs for dynamic Mod icon lookup:pixiebrix-extension/src/components/asyncIcon.ts
Line 27 in 35bf764
Checklist
src/tsconfig.strictNullChecks.json
(if possible)