Skip to content

CAT-1335: tree shake phosphor icons#16338

Merged
benjiaming merged 28 commits into
masterfrom
CAT-1335-refactor-icon
Mar 18, 2026
Merged

CAT-1335: tree shake phosphor icons#16338
benjiaming merged 28 commits into
masterfrom
CAT-1335-refactor-icon

Conversation

@benjiaming

@benjiaming benjiaming commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Summary: Phase 1 of FE performance optimizations

The DataHub frontend currently produces around 20MB of minified JavaScript across 5 chunks, compressing to approximately 5 MB when gzipped. This is a substantial bundle size that impacts initial load time and performance, particularly on slower networks. Phase 1 addresses some of the issues:

  • ported chunking from SaaS to vite.config.ts
  • added antd to chunks
  • tree-shaking Phosphor icons (we were bundling all 4,539 icons despite using < 200)

Results

Metric Before After Improvement
Total Bundle 20.45 MB 12.9 MB -36.5% (-7.55 MB)
Gzipped 4.89 MB 3.28 MB -32.9% (-1.61 MB)
Phosphor Icons 6 MB (4,539 icons) 372 KB (133 icons) -95.7%
Page Load (3G) ~27s ~18s -9 seconds

Before

  • giant monolithic bundle: index-B3Suu7YI.js = 19,395 KB (~19 MB)
  • no chunking (everything bundled together)
  • all 4,539 Phosphor icons included (a large block)
  • no vendor separation
Screenshot 2026-02-10 at 12 12 24 PM

After

  1. vendor-yJ7kOkOV.js: 8.6 MB (8,999.72 KB) [KEY CHUNK]

    • React + ReactDOM (bundled together)
    • Ant Design + rc-* components (bundled together)
    • Material UI + @emotion (bundled together)
    • Apollo Client + GraphQL
    • Other dependencies (lodash, moment, etc.)
    • This is the FIX: React + Ant Design + MUI together = no load order issues
  2. source-CbhsHxku.js: 3.9 MB (4,042.65 KB)

    • Application source code
    • Custom components, pages, features
  3. phosphor-vendor-D8fS90Jx.js: 372 KB (408.51 KB) [OPTIMIZED]

    • Custom Phosphor icons bundle (133 icons only)
    • Down from 6 MB originally (95.7% reduction)
  4. index-CxYYPpoy.js: 4 KB (0.74 KB)

    • Entry point

Total Size:

  • Minified: 12.9 MB
  • Gzipped: 3.28 MB (what users actually download)
Screenshot 2026-02-12 at 11 28 05 AM

Bundle Analyzer

  • rollup-plugin-visualize installed as a dev dependency
  • run yarn build:analyze and open dist/stats.html

Risks

  • certain Phosphor icons not loading
    → Mitigation: npm run validate-bundle
  • chunking fails
    → Mitigation: added datahub-web-react/src/__tests__/bundle-optimization.test.ts
  • merge issues (acryl-main does chunking already but a bit differently)

Reference

https://www.notion.so/acryldata/DataHub-Frontend-Performance-Tech-Plan-246fc6a64277803e9976fdde565602d8

@alwaysmeticulous

alwaysmeticulous Bot commented Feb 24, 2026

Copy link
Copy Markdown

🔴 Meticulous spotted visual differences in 255 of 1652 screens tested: view and approve differences detected.

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

Last updated for commit d9df3a9. This comment will update as new commits are pushed.

@codecov

codecov Bot commented Feb 24, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 5.83MB (-19.7%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 23.78MB -5.83MB (-19.7%) ⬇️

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 -5.83MB 13.61MB -30.01%

Files in assets/index-*.js:

  • ./src/alchemy-components/components/Drawer/Drawer.tsx → Total Size: 1.27kB

  • ./src/alchemy-components/components/Alert/Alert.tsx → Total Size: 1.67kB

  • ./src/alchemy-components/components/Editor/extensions/fileDragDrop/FileNodeView.tsx → Total Size: 5.85kB

  • ./src/alchemy-components/components/FileNode/FileIcon.tsx → Total Size: 321 bytes

  • ./src/alchemy-components/components/EmptyState/EmptyState.tsx → Total Size: 1.6kB

  • ./src/alchemy-components/components/Avatar/Avatar.tsx → Total Size: 1.5kB

  • ./src/alchemy-components/components/Editor/toolbar/Toolbar.tsx → Total Size: 4.93kB

  • ./src/alchemy-components/components/Editor/toolbar/AddLinkButton.tsx → Total Size: 683 bytes

  • ./src/alchemy-components/components/Editor/toolbar/AddImageButton.tsx → Total Size: 1.84kB

  • ./src/alchemy-components/components/FileNode/FileNode.tsx → Total Size: 2.74kB

  • ./src/alchemy-components/components/DatePicker/variants/common/components.tsx → Total Size: 423 bytes

  • ./src/alchemy-components/components/Editor/toolbar/AddImageButtonV2.tsx → Total Size: 2.84kB

  • ./src/alchemy-components/components/FileNode/utils.ts → Total Size: 914 bytes

  • ./src/alchemy-components/components/Icon/Icon.tsx → Total Size: 746 bytes

  • ./src/alchemy-components/components/Breadcrumb/Breadcrumb.tsx → Total Size: 1.64kB

  • ./src/alchemy-components/components/FileDragAndDropArea/FileDragAndDropArea.tsx → Total Size: 3.28kB

  • ./src/alchemy-components/components/Card/Card.tsx → Total Size: 2.72kB

@datahub-cyborg datahub-cyborg Bot added the needs-review Label for PRs that need review from a maintainer. label Feb 24, 2026
@codecov

codecov Bot commented Feb 24, 2026

Copy link
Copy Markdown

@AdrianMachado

Copy link
Copy Markdown
Contributor

@benjiaming I scanned through meticulous and here are the classes of errors I found

  • Icons appearing where they were not before
  • Icons disappearing where they were before
  • Arrow, X, three-dot, and trash icons seem to have switched. Maybe they were using different icons entirely before, or maybe just the size and weight changed, hard to tell

Claude can probably audit based on some of the surfaces mentioned below:

Error Before After
Column Sort Icon changed (gained some weight lol) image image
Plus icon also grew image image
We gained Icons on the tags menu? I like it tho image image
Lost thickness on tags 3-dot image image
We lost icons on the glossary menu image image
Went from outline to filled on owners icons image image
Structured property icons changed size image image
Also on structured properties, info icon thickness change image image
Trash icon totally changed on "create a view" modal image image

@datahub-cyborg datahub-cyborg Bot added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Feb 24, 2026
return FilePdf;
case 'doc':
case 'docx':
return 'FileWord';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you find a legit case of missing icons

@annadoesdesign annadoesdesign left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

approving with the caveat carets will be updated sizing

@AdrianMachado

Copy link
Copy Markdown
Contributor

Take a peek at the meticulous run for what Anna reject and please address before merging

@benjiaming

Copy link
Copy Markdown
Contributor Author

Take a peek at the meticulous run for what Anna reject and please address before merging

Addressing those as fast follow.

@benjiaming benjiaming merged commit cdb1ba7 into master Mar 18, 2026
30 of 32 checks passed
@benjiaming benjiaming deleted the CAT-1335-refactor-icon branch March 18, 2026 03:17
annadoesdesign added a commit that referenced this pull request Mar 18, 2026
Align with tree-shaking changes from #16338 — Icon component now
accepts React.ComponentType instead of string names with source prop.

Made-with: Cursor
annadoesdesign added a commit that referenced this pull request Mar 18, 2026
Update Phosphor icon usage in group identity components to pass
direct component references instead of string literals, aligning
with the new Icon API from #16338.

Made-with: Cursor
annadoesdesign added a commit that referenced this pull request Mar 18, 2026
Update Phosphor icon usage in ownership components to pass direct
component references instead of string literals, aligning with the
new Icon API from #16338.

Made-with: Cursor
annadoesdesign added a commit that referenced this pull request Mar 18, 2026
…r dependency

Merge master (includes tree-shaking PR #16338). Resolve conflict in
ActorsSearchSelect by keeping dataTestId prop and adopting master's
DEFAULT_ACTOR_TYPES rename.

Fix FileIcon.tsx circular dependency that caused GlossaryTermHeader
tests to fail — replace Icon wrapper with direct Phosphor component
usage to avoid barrel import cycle.

Made-with: Cursor
david-leifker pushed a commit that referenced this pull request May 27, 2026
Conflicts resolved by Claude AI.

Merged from commit cdb1ba7
Original author: Ben Blazke <benjiaming@users.noreply.github.com>
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