Skip to content

perf(web): improve vinext home startup time#38219

Merged
hyoban merged 4 commits into
mainfrom
codex/vinext-home-startup-perf
Jun 30, 2026
Merged

perf(web): improve vinext home startup time#38219
hyoban merged 4 commits into
mainfrom
codex/vinext-home-startup-perf

Conversation

@hyoban

@hyoban hyoban commented Jun 30, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

  • Lazy-load locale resource modules through per-locale entry files so vinext does not eagerly include every i18n JSON namespace on the first request.
  • Move common layout global mounts behind a client-only dynamic mount.
  • Lazy-load detail navigation panels that are not needed on the home route.

No linked issue; this came from local vinext dev startup performance investigation.

Rollback measurements for the retained changes:

Optimization Revert impact
Lazy-load detail navigation panels 14.4s -> 22.8s, +8.4s
Lazy-load common layout mounts 11.5s -> 14.4s, +2.9s
Lazy-load i18n locale resources 22.4s -> 23.7s, +1.3s

Screenshots

Before After
N/A N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This does not apply to typos!)
  • I have added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I have updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Validation:

  • pnpm --filter dify-web type-check
  • pnpm exec vp staged (no staged files)
  • pnpm -C web exec vp staged was attempted, but this checkout reports no staged config in web/vite.config.ts.

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.36%. Comparing base (44e85c0) to head (c4dd4a1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
web/i18n-config/load-resource.ts 38.46% 8 Missing ⚠️
...nts/main-nav/components/snippet-detail-section.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38219   +/-   ##
=======================================
  Coverage   85.36%   85.36%           
=======================================
  Files        4970     4972    +2     
  Lines      258774   258797   +23     
  Branches    49076    49076           
=======================================
+ Hits       220893   220914   +21     
- Misses      33576    33578    +2     
  Partials     4305     4305           
Flag Coverage Δ
dify-ui 94.93% <ø> (ø)
web 85.05% <71.87%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lyzno1
lyzno1 previously approved these changes Jun 30, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 30, 2026
@hyoban hyoban marked this pull request as ready for review June 30, 2026 10:28
@hyoban hyoban requested a review from iamjoel as a code owner June 30, 2026 10:28
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 30, 2026
@hyoban hyoban enabled auto-merge June 30, 2026 10:30
@hyoban hyoban added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit b1bb6ef Jun 30, 2026
37 of 38 checks passed
@hyoban hyoban deleted the codex/vinext-home-startup-perf branch June 30, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants