Skip to content

perf(frontend): reduce initial load of FE bundle#18109

Merged
benjiaming merged 9 commits into
masterfrom
perf/frontend-bundle-reduce-initial-load
Jul 6, 2026
Merged

perf(frontend): reduce initial load of FE bundle#18109
benjiaming merged 9 commits into
masterfrom
perf/frontend-bundle-reduce-initial-load

Conversation

@benjiaming

@benjiaming benjiaming commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move remirror out of the eager initial bundle so it loads on-demand only when an editor actually renders.
  • Initial JS download shrinks by ~164 KB and Lighthouse TTI improves by ~30 ms (1,306 → 1,276 ms, median of 3 runs against the same server).

Drive-by

  • Lazy-load Remirror
  • Initial JS bundle size report on PR
  • Swapped 9 @mui/icons-material imports for visually equivalent Phosphor CSR path imports (@phosphor-icons/react/dist/csr/X)
Screenshot 2026-06-30 at 5 00 07 PM

@alwaysmeticulous

alwaysmeticulous Bot commented Jul 1, 2026

Copy link
Copy Markdown

🔴 Meticulous spotted visual differences in 161 of 1246 screens tested: view and approve differences detected.

Meticulous evaluated ~10 hours of user flows against your PR.

Last updated for commit 45936ae size. This comment will update as new commits are pushed.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Initial JS bundle size

Chunk Gzipped
Eager entry (index-*.js) 3.29 MB

Measures only the JS downloaded on first page load (eager chunks). Codecov reports total bundle including lazy chunks — these differ intentionally.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 147.28kB (0.48%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 30.52MB 147.28kB (0.48%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 1.52kB 3.88MB 0.04%
assets/index-*.js -580.68kB 8.43MB -6.45%
assets/index-*.js 3 bytes 502.08kB 0.0%
assets/EditorImpl-*.js (New) 554.35kB 554.35kB 100.0% 🚀
assets/es-*.js 955 bytes 338.28kB 0.28%
assets/de-*.js 965 bytes 337.22kB 0.29%
assets/pt-*.js 941 bytes 331.16kB 0.28%
assets/en-*.js 1.12kB 309.58kB 0.36%
assets/iconLoader-*.js -525 bytes 184.18kB -0.28%
assets/bigidlogo-*.png (New) 155.01kB 155.01kB 100.0% 🚀
assets/TextStrikethrough-*.js (New) 4.34kB 4.34kB 100.0% 🚀
assets/CodeBlock-*.js (New) 3.39kB 3.39kB 100.0% 🚀
assets/FileArrowUp-*.js (New) 3.12kB 3.12kB 100.0% 🚀
assets/LinkSimpleHorizontal-*.js (New) 2.6kB 2.6kB 100.0% 🚀
assets/TextB-*.js (New) 2.29kB 2.29kB 100.0% 🚀
assets/TextUnderline-*.js (New) 2.27kB 2.27kB 100.0% 🚀
assets/TextItalic-*.js (New) 1.99kB 1.99kB 100.0% 🚀
assets/Megaphone-*.js (Deleted) -3.82kB 0 bytes -100.0% 🗑️
assets/Timer-*.js (Deleted) -2.57kB 0 bytes -100.0% 🗑️

Files in assets/index-*.js:

  • ./src/app/entity/shared/components/legacy/DescriptionModal.tsx → Total Size: 2.51kB

  • ./src/alchemy-components/components/Editor/Editor.tsx → Total Size: 442 bytes

  • ./src/app/entity/shared/entityForm/Form.tsx → Total Size: 3.04kB

  • ./src/app/entity/shared/components/styled/StructuredProperty/RichTextInput.tsx → Total Size: 637 bytes

  • ./src/app/entity/shared/EntityDropdown/UpdateDeprecationModal.tsx → Total Size: 2.6kB

  • ./src/app/entity/dataset/profile/schema/components/SchemaDescriptionField.tsx → Total Size: 7.28kB

Files in assets/EditorImpl-*.js:

  • ./src/alchemy-components/components/Editor/EditorImpl.tsx → Total Size: 3.7kB

@benjiaming benjiaming changed the title perf(frontend): Frontend bundle reduce initial load perf: Frontend bundle reduce initial load Jul 1, 2026
@benjiaming benjiaming changed the title perf: Frontend bundle reduce initial load chore: Reduce initial load of FE bundle Jul 1, 2026
@benjiaming benjiaming changed the title chore: Reduce initial load of FE bundle perf(fe): Reduce initial load of FE bundle Jul 1, 2026
@benjiaming benjiaming changed the title perf(fe): Reduce initial load of FE bundle perf(fe): reduce initial load of FE bundle Jul 1, 2026
@benjiaming benjiaming changed the title perf(fe): reduce initial load of FE bundle perf(frontend): reduce initial load of FE bundle Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@benjiaming benjiaming changed the title perf(frontend): reduce initial load of FE bundle perf(frontend): reduce initial load of FE bundle Jul 1, 2026
@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Initial JS bundle size 🟢

Gzipped
Base (ce30384) 3.30 MB
This PR 3.14 MB
Diff -164 KB (-4.9%)

Eager entry chunks (dist/assets/index-*.js) only. Codecov reports total bundle including lazy chunks — these intentionally differ.

@chriscollins3456 chriscollins3456 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

def a fan of removing the old Editor component and consolidating on the one in alchemy-components

// from the initial bundle. Callers keep the same <Editor /> API including ref forwarding.
export const Editor = forwardRef<unknown, EditorProps>((props, ref) => (
<Suspense fallback={null}>
<EditorImpl {...props} ref={ref} />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this change doesn't cause the editor to be loaded laggily or anything? did it feel good locally when you tested it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tested with throttling on 3G and the editor still loaded almost instantly.

@benjiaming benjiaming merged commit e2e91bb into master Jul 6, 2026
49 of 50 checks passed
@benjiaming benjiaming deleted the perf/frontend-bundle-reduce-initial-load branch July 6, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants