feat: move ace-editor and mathjs to async modules#10837
feat: move ace-editor and mathjs to async modules#10837ktmud merged 11 commits intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10837 +/- ##
==========================================
+ Coverage 59.32% 61.34% +2.02%
==========================================
Files 776 380 -396
Lines 37060 24086 -12974
Branches 3310 0 -3310
==========================================
- Hits 21986 14776 -7210
+ Misses 14891 9310 -5581
+ Partials 183 0 -183
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
a9f4ae0 to
ee48ef6
Compare
cce2701 to
c6aa954
Compare
2582cb9 to
bfc0805
Compare
There was a problem hiding this comment.
@kristw @etr2460 @graceguo-supercat This is ready for review. Would you mind taking a look?
superset-frontend/webpack.config.js
Outdated
There was a problem hiding this comment.
Don't add names to chunkFiles (they are just single digit numbers anyway).
superset-frontend/webpack.config.js
Outdated
There was a problem hiding this comment.
react-ace itself is quite small.
superset-frontend/webpack.config.js
Outdated
There was a problem hiding this comment.
Different brace modes/themes now load separately and asynchronously.
There was a problem hiding this comment.
Added debounce to text inputs in Explore view's Datasource editor.
There was a problem hiding this comment.
Removed this prop according to a console warning from Ace.
There was a problem hiding this comment.
Enable completion for only the related language.
There was a problem hiding this comment.
Set default tabSize for all AceEditor. Previously there were some places where tabSize was not set and would default to 4.
superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
Outdated
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/integration/explore/visualizations/line.test.ts
Outdated
Show resolved
Hide resolved
rusackas
left a comment
There was a problem hiding this comment.
LGTM! The cleanup this brings, and the performance improvement, are both appreciated.
Left some general questions & comments you're already addressing, so thanks for that.
There was a problem hiding this comment.
Could/should these be based on % values or use a flexbox layout (using the built-in "stretch" features) to avoid hard-coding these dimensions?
There was a problem hiding this comment.
The goal here is to make sure the popover renders at the right position so that the left caret always points to the popover trigger when the content of the popover is fully loaded. We wouldn't want the popover to "stretch" since there is no way to update its position after it was re-rendered.
superset-frontend/webpack.config.js
Outdated
There was a problem hiding this comment.
typo
||interpolateformat => |interpolate|format
There was a problem hiding this comment.
Wow, just wow... Thanks for spotting this!
Load markdown async Add a test case for markdown edit
Follow up on apache#10831, move brace and mathjs to async modules so that the initial page load for dashboards most pages can be faster.


SUMMARY
Follow up on #10831, move
braceandmathjsto async modules so that the initial page load fordashboardsmost pages can be faster.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
On a dashboard page,
braceloads only after users add a markdown widget to dashboard:Optimized bundle config further helps reduce the overall bundle size:
Initial page load time with production assets and without cache was reduced by 30% (9.8s -> 6.9s in Fast 3G network).
On Explore and CRUD page,
braceandmathjsare also loaded on demand.TEST PLAN
Expected behaviors:
brace.jsandmathjsby default.brace.js, even when users haven't started editing the markdown.mathjsautomatically.mathjswill load only for charts that support annotation layers.ADDITIONAL INFORMATION