Skip to content

feat(ui): lazy load home page widgets to improve initial load performance#28079

Merged
shah-harshit merged 12 commits into
mainfrom
feat/lazy-load-home-page-widgets
May 19, 2026
Merged

feat(ui): lazy load home page widgets to improve initial load performance#28079
shah-harshit merged 12 commits into
mainfrom
feat/lazy-load-home-page-widgets

Conversation

@shah-harshit
Copy link
Copy Markdown
Contributor

@shah-harshit shah-harshit commented May 13, 2026

Summary

  • Replace static widget imports with React.lazy() in CustomizeMyDataPageClassBase
  • Wrap widget renders in Suspense with a skeleton fallback in CustomizableLandingPageUtils
  • Each widget now loads as a separate JS chunk, reducing the initial bundle size of the home page

Test Plan

  • Home page loads correctly with all widgets visible
  • No regression in widget functionality

Closes https://github.com/open-metadata/openmetadata-collate/issues/4075


Summary by Gitar

  • Dependency management:
    • Reverted lodash-es to lodash across multiple utility files to resolve bundling compatibility issues.
    • Updated vite.config.ts to alias lodash to lodash-es, enabling tree-shaking while maintaining runtime stability.
  • Cleanup:
    • Removed a large set of unused components, utility functions, and constants to reduce project footprint.

This will update automatically on new commits.

…ance

Replace static widget imports with React.lazy() in CustomizeMyDataPageClassBase
and wrap widget renders in Suspense with a skeleton fallback in
CustomizableLandingPageUtils. Each widget now loads as a separate JS chunk,
reducing the initial bundle size of the home page.

Closes open-metadata/openmetadata-collate#4075

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shah-harshit shah-harshit requested a review from a team as a code owner May 13, 2026 09:12
@shah-harshit shah-harshit added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels May 13, 2026
@shah-harshit shah-harshit self-assigned this May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.35% (65399/103219) 44.17% (35857/81178) 46.89% (10540/22477)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🟡 Playwright Results — all passed (13 flaky)

✅ 4135 passed · ❌ 0 failed · 🟡 13 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 298 0 1 4
🟡 Shard 2 777 0 4 8
🟡 Shard 3 800 0 4 7
🟡 Shard 4 751 0 1 12
🟡 Shard 5 772 0 1 47
🟡 Shard 6 737 0 2 8
🟡 13 flaky test(s) (passed on retry)
  • Features/MetricCustomUnitFlow.spec.ts › Should create metric and test unit of measurement updates (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Add test case to existing Bundle Suite (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should start term as Draft when glossary has reviewers (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 2, 1 retry)
  • Features/LandingPageWidgets/DomainDataProductsWidgets.spec.ts › Data Product asset count should update when assets are removed (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/IngestionBot.spec.ts › Ingestion bot should be able to access domain specific domain (shard 3, 1 retry)
  • Flow/ObservabilityAlerts.spec.ts › Alert operations for a user with and without permissions (shard 3, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate UpdatedOn Rule Less than (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Users.spec.ts › Create and Delete user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/SchedularUtils.tsx Outdated
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/SchedularUtils.tsx
Comment thread openmetadata-ui/src/main/resources/ui/src/utils/ToastUtils.ts
…ataQuality tests

- Use `.first()` with `expect().toBeVisible()` instead of `.waitFor()` on
  multi-match locator `[data-testid="status-data-widget"]` (8 elements)
- Add `page.mouse.move(0, 0)` before sidebar hover in `sidebarClick` to
  dismiss tooltips that intercept pointer events
- Wrap all test bodies in `test.step()` for readability and granular
  failure reporting

Fixes open-metadata/openmetadata-collate#4132

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shah-harshit shah-harshit changed the title chore(ui): lazy load home page widgets and delete unused files fix(playwright): Fix DataQuality dashboard test flakiness - strict mode violation & tooltip intercept May 18, 2026
@shah-harshit shah-harshit changed the title fix(playwright): Fix DataQuality dashboard test flakiness - strict mode violation & tooltip intercept feat(ui): lazy load home page widgets to improve initial load performance May 18, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 18, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Lazy loads home page widgets using React.lazy and Suspense to improve initial bundle size, while reverting lodash-es to resolve compatibility issues and removing unused project artifacts. No issues found.

✅ 1 resolved
Edge Case: Missing per-widget error boundary for chunk load failures

📄 openmetadata-ui/src/main/resources/ui/src/utils/CustomizableLandingPageUtils.tsx:427-437
If a lazy-loaded widget chunk fails to download (network timeout, deploy during navigation, ad-blocker), React will throw an error. Currently the only error boundary is the global one in AppRoot.tsx, which will unmount the entire page — not just the failing widget. Adding a per-widget error boundary around the <Suspense> would isolate failures so that one broken widget doesn't take down the whole landing page.

This is particularly relevant for the home/landing page which loads up to 11 independent widget chunks in parallel.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

Comment thread openmetadata-ui/src/main/resources/ui/vite.config.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants