build: restore a shared NLS catalog across targets - #336476
Draft
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Draft
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Conversation
Extract and validate a source-wide NLS catalog before target bundling so products and the localization CDN use the same numeric indices. Give shared metadata one publisher and preserve complete translator output, source maps, ASCII serialization, and native cache identity behavior. Fixes #299425 Co-authored-by: Copilot <[email protected]>
Copilot started reviewing on behalf of
Dmitriy Vasyura (dmitrivMS)
September 16, 2026 20:20
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes release-wide localization indexing and packaging, while full signed packaging and live CDN deployment remain unverified.
Review effort: Balanced (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Balanced.
What changed in this PR
Restores deterministic, source-wide NLS indexing so all build targets share compatible localization catalogs.
Changes:
- Adds canonical NLS catalog extraction, validation, and publication.
- Makes production targets consume the shared catalog.
- Adds cross-target, failure-path, serialization, and source-map coverage.
| File | Description |
|---|---|
.github/instructions/buildNext.instructions.md |
Documents canonical NLS workflow. |
build/gulpfile.vscode.ts |
Prepares one catalog before parallel bundles. |
build/gulpfile.vscode.web.ts |
Prepares the catalog for web packaging. |
build/lib/esbuild.ts |
Adds NLS command orchestration and catalog arguments. |
build/lib/test/nlsMessages.test.ts |
Updates serialization tests for catalogs. |
build/next/index.ts |
Integrates catalog extraction and consumption. |
build/next/nls-catalog.ts |
Implements deterministic catalog management. |
build/next/nls-plugin.ts |
Validates and applies canonical indices. |
build/next/test/nls-catalog.test.ts |
Tests cross-target consistency and failures. |
build/next/test/nls-sourcemap.test.ts |
Uses canonical catalogs in source-map tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixes #299425.
Why
The old build assigned core NLS IDs before target bundling. The esbuild migration instead assigns IDs from each target's dependency graph, while browser localization still selects a CDN catalog by commit/version/locale, without a target identity.
This is a verified cross-target mismatch, not merely a suspected write race: the official 1.110.0 server-web bundle expects 16,545 entries, but its same-commit localized CDN supplies standalone web's 16,421-entry table. Fresh-browser reproduction matches the original
NLS MISSING: 16444exception and stack. Materializing the same language pack with server-web's ordered keys restores localized startup.Changes
localize/localize2slots, and reject conflicting default messages.core-cibundles. Targets consume its index map and write only their own catalogs, rather than overwriting shared metadata.out-build.Validation
npm run typecheck --prefix build -- --pretty falsepasses.npm run precommit), explicit changed-file ESLint with--max-warnings 0, andgit diff --checkpass.bundle --minify --nlsruns succeed for server, server-web, and standalone web. All four catalog files are byte-identical across those outputs, including the server's independent extraction path.Reviewer / rollout notes
The correctness trade-off is shipping the complete catalog in smaller targets. On the validated source snapshot, the English JSON is 1,238,251 bytes / 319,198 bytes gzip; these are total sizes, not per-target increases. Source-wide extraction took about 23 seconds, and loading plus full-source validation about 2 seconds, locally on Windows.
Reindexed bundles and catalogs must ship together under a new build identity; existing published commit catalogs must not be replaced with reordered arrays. This does not change browser fallback behavior, language-pack formats, or the CDN URL contract. Full signed release packaging and live CDN deployment have not been exercised.