refactor(i18n): align analysis with Vite environment graphs - #42656
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #42656 +/- ##
==========================================
+ Coverage 87.58% 87.61% +0.02%
==========================================
Files 5471 5475 +4
Lines 318394 319027 +633
Branches 63818 64074 +256
==========================================
+ Hits 278874 279518 +644
+ Misses 34129 34118 -11
Partials 5391 5391
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hyoban
marked this pull request as ready for review
September 21, 2026 13:05
hyoban
requested review from
CodingOnStar,
iamjoel and
lyzno1
as code owners
September 21, 2026 13:05
hyoban
enabled auto-merge
September 21, 2026 13:05
lyzno1
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #42655
The i18n analyzer could read disk modules that differed from Vite’s runtime imports. Analyze completed client, SSR and RSC graphs using environment-specific resolution, preserve query/JSON module identities, and block stale disk fallback after changed or untraceable imports. Connect environments only through explicit RSC client references.
Keep namespace inference limited to literals, inline arrays and immutable string constants. Runtime parameters, function results and bound arrays remain unknown. Expose an adapters option for custom translation APIs (source module, export name, namespace/selector argument indexes and optional private forwarding functions). Keep Dify registrations in vite.config.ts; the plugin only hardcodes official API names. Analyze registered calls through aliases/re-exports and verify Dify forwarding contracts against the actual wrappers. Dynamic adapter arguments remain unknown. Retain TypeScript selector/key matching and conservative dynamic-key protection; external dependencies and generated resource helpers are analysis boundaries rather than individual warnings.
Print a compact build summary and write full route groups, source evidence and shared dependency paths to
i18n-routes.json. Signin validates detected namespace usage; rejecting unknown namespaces remains opt-in. This is a static estimate, not proof of complete runtime coverage, and does not change translation loading.Make 12 finite business translation calls statically visible and remove five obsolete explore keys from all 25 locales. Reuse catalog indexes and identical multi-format analysis only within the current build.
Screenshots
No visual changes. Console output now shows counts and the report path instead of listing every route.
Validation
pnpm exec vp run -w checkandpnpm exec vp stagedpass.pnpm run build:vinextpasses, including standalone packaging; no additional unused keys.Checklist
vp staged(frontend); backend checks are not applicable.