Read bundled language packs directly from wp-files - #3214
Merged
Conversation
Collaborator
📊 Performance Test ResultsComparing 1ae72b1 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
bcotrim
force-pushed
the
stu-1537-debug-language-packs-blueprint-failure
branch
from
June 12, 2026 12:44
2baa279 to
1ae72b1
Compare
epeicher
approved these changes
Jun 12, 2026
epeicher
left a comment
Contributor
There was a problem hiding this comment.
Thanks @bcotrim, this is a great improvement! I have tested it, and I can verify that all steps work as expected. I can see that the languages file are stored there and they work as expected in the site. LGTM!
| Language packs | Migration deletes the languages in server-files | WordPress site |
|---|---|---|
![]() |
![]() |
![]() |
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.



Related issues
How AI was used in this PR
Claude Code reconstructed the April context (#3125's deferred section, this PR's original debug instrumentation, and the language-pack copy races later documented in #3492), re-applied the bundle-read change cleanly on top of current trunk.
Proposed Changes
Language packs were the last site dependency still copied from the read-only CLI bundle into the writable
~/.studio/server-files/cache on every CLI invocation. The copy was pure overhead: language packs are only ever read at site creation, to copy the matching locale's files into the new site'swp-content/languages/, and they only change when the app ships a new bundle.This PR has site creation read language packs directly from the bundled
wp-files/latest/languages/, and drops the per-invocation copy step — shaving the remaining recursive dir-walk (~1,400 files) off CLI startup.Side benefits:
ENOENTwarnings). With no copy and no writable cache, that bug class is gone by construction.WP_LOCALES).04-cleanup-obsolete-server-filesmigration also removes the now-unused~/.studio/server-files/language-packs/(and its lockfile) on first run after upgrade.On the April E2E failures that deferred this: they never reproduced locally — neither at the CLI level (3/3 ja-locale sites healthy, WPLANG=ja, wp-admin 200) nor with the packaged-app Playwright suites that failed in CI back then. The Playground worker-spawn stack has been rewritten since (#3602), and the failure was never root-caused, so CI on this PR is the deciding signal. If mac E2E reds again, this time it fails on a clean branch with inspectable artifacts.
Testing Instructions
npm run download-language-packs(plainnpm installdoes not populatewp-files/latest/languages), thennpm run cli:build."locale": "ja"in~/.studio/shared.jsonor via Studio Settings) and create a site.wp-content/languages/contains the locale's files (core +plugins/+themes/), wp-admin loads in that language, and Settings → General shows the locale selected under Site Language.~/.studio/server-files/language-packs/is deleted on first CLI run after upgrade and is not recreated.localization.test.ts(locale site creation + WPLANG) andblueprints.test.ts(blueprint provisioning).Verified locally on macOS arm64: typecheck, eslint, full unit suite (1963 tests), packaged-app e2e
localization.test.ts4/4 (twice) andblueprints.test.ts6/6.Pre-merge Checklist