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

perf: Lazy load React Ace #29796

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

kgabryje
Copy link
Member

SUMMARY

ace-builds was 1 of the largest libraries in our bundle. It was always fetched when opening a dashboard even though it's only used in dashboard's edit mode (if there are markdown components), SQL lab, and SQL Editor popover in Explore.
This PR implements lazy loading that library.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Notice that we no longer fetch a 1.3MB chunk when opening a dashboard

Before:

Screenshot 2024-07-31 at 16 36 23

After:

Screenshot 2024-07-31 at 18 17 22

TESTING INSTRUCTIONS

  1. Open a dashboard
  2. Verify that the chunk containing ace-builds is not fetched initially
  3. Open edit mode and try to edit a markdown component - verify that it works fine
  4. Open SQL Lab - verify that SQL editor works fine
  5. Open a chart and metrics edit popover - verify that SQL editor works fine

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

@dosubot dosubot bot added change:frontend Requires changing the frontend dashboard:editmode Related to te Dashboard edit mode labels Jul 31, 2024
@michael-s-molina michael-s-molina added the review:checkpoint Last PR reviewed during the daily review standup label Jul 31, 2024
@mistercrunch mistercrunch added the dashboard:performance Related to Dashboard performance label Jul 31, 2024
@mistercrunch
Copy link
Member

Oh nice! Looks like this will positively impact the Explore page loading times positively too

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

@kgabryje kgabryje merged commit d143b24 into apache:master Aug 1, 2024
39 checks passed
@michael-s-molina michael-s-molina removed the review:checkpoint Last PR reviewed during the daily review standup label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend dashboard:editmode Related to te Dashboard edit mode dashboard:performance Related to Dashboard performance packages size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants