Skip to content

perf(frontend): load locale catalogs in parallel and overlap setup check (WI-2150) - #522

Merged
stefan-ernst merged 2 commits into
mainfrom
feat/wi-2150-frontend-startup-latency
Nov 16, 2026
Merged

stefan-ernst merged 2 commits into
mainfrom
feat/wi-2150-frontend-startup-latency

Conversation

@stefan-ernst

@stefan-ernst stefan-ernst commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Load the English fallback and the selected locale catalog concurrently on a non-English cold start instead of awaiting English first.
  • Start the /setup/status check alongside locale and branding instead of after both resolve.

WI-2150.

Behavior

A non-English cold start now issues the en fallback chunk and the selected locale chunk in the same tick, and the setup-status request begins while locale and branding are still loading. Authorization, retry, deadline, capability-gated navigation and translation semantics are unchanged. The setup wizard is still shown only after i18n is ready, so its copy renders translated.

Measurement

Built with bun --bun run build:app. Locale chunks: en 315,870 B raw / 94,908 B gzip; de 428,475 B raw / 123,319 B gzip.

  • Before: request en → await → request de → await → apply locale. Two serial round trips on the critical path.
  • After: request en and de together → await both → apply locale. One round trip.
  • Setup: /setup/status previously started only after locale and branding resolved; it now overlaps them.

Unique startup byte totals are unchanged (the same two catalogs are requested); concurrency changes the waterfall, not the payloads. Namespace splitting of the aggregated catalogs is a larger change to the synchronous t() surface and is deferred (recorded on WI-2150).

Validation

Companion tests: merged in https://github.com/Windshiftapp/core-tests-internal/pull/57. Review fixes and final validation (175 tests) are documented in the review below.

From core/:

VITEST_RUNTIME=bun ../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/lib/stores/i18n-loading.test.js src/lib/stores/i18n-utils.spec.js src/lib/stores/i18n.svelte.test.js src/lib/locales/required-locale-coverage.test.js src/lib/locales/createLocale.test.js src/App.test.js
  • 6 files / 38 tests pass.
  • The new i18n-loading.test.js fails before the fix (selected:start is never recorded while the fallback is pending) and passes after.
  • The updated App.test.js stalled-locale and new overlap tests fail before the fix and pass after.

From frontend/:

  • bun --bun run typecheck: 0 errors, 3 pre-existing warnings.
  • bun --bun run build:app: passes, entry-asset check passes.
  • bun --bun x biome check src/lib/stores/i18n.svelte.js: passes.
  • Pre-commit frontend guards (Biome, i18n, hardcoded-i18n, silent errors, design tokens, HMR, OpenUI) pass.

Go/PostgreSQL and browser suites were not run: no backend, execution, schema or browser-test behavior changed.

@github-actions

Copy link
Copy Markdown

Size Change: 0 B 🆕

Total Size: 0 B

compressed-size-action

@stefan-ernst stefan-ernst left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review fixes

  • Fixed startup localization and document-title updates being gated on successful setup status. Locale/branding readiness now updates the recovery UI even while setup is pending or after it fails; setup and auth still wait for the required bootstrap results.
  • Fixed an early-retry race: branding callers now await the existing request instead of completing immediately with default branding.
  • Corrected two existing German timer strings that violated the catalog's required “Vorgang” terminology, found by the broader locale suite.
  • Extended companion coverage in https://github.com/Windshiftapp/core-tests-internal/pull/57 for both setup/locale completion orders, the setup wizard readiness boundary, branding retries, and English fallback keys when the selected catalog finishes first.

Validation

Node 24.18.0, using the repository's Node wrapper and overlay runner.

Regression reproduction before fixes:

../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/App.test.js
../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/lib/stores/brand.spec.js

The first run failed both new localization cases (English loader/recovery text). The second failed the new branding retry case (Windshift instead of Acme). The initial broader run also caught the two German terminology violations. Full logs are retained locally under pr-522/ (app-regression-before.log, brand-regression-before.log, and frontend-broader.log).

Final broader run, from core:

../core-tests/run-overlay-script.sh . scripts/run-frontend-tests.sh src/App.test.js src/lib/stores/i18n-loading.test.js src/lib/stores/i18n-utils.spec.js src/lib/stores/i18n.svelte.test.js src/lib/locales src/lib/services/authenticatedShellBootstrap.test.js src/lib/services/authenticatedShellUI.test.js src/lib/services/appShellHandlers.test.js src/lib/services/appShellHandlers.spec.js src/lib/stores/brand.spec.js

14 files / 175 tests passed.

From core/frontend:

../../core-tests/scripts/run-with-core-node.sh .. npm run check
../../core-tests/scripts/run-with-core-node.sh .. npm run typecheck
../../core-tests/scripts/run-with-core-node.sh .. npm run build:app

All passed. Type-check: zero errors, three existing warnings. Production build and entry-asset guard pass. Pre-commit checks, including the deprecated-v1, frontend-v2-field and inline-style guards, pass.

From core-tests:

scripts/run-with-core-node.sh ../core ../core/frontend/node_modules/.bin/biome check --write --vcs-enabled=false --config-path=../core/frontend/biome.json frontend/src/App.test.js frontend/src/lib/stores/i18n-loading.test.js frontend/src/lib/stores/brand.spec.js

Passed. The initial cross-repository Biome invocation crashed on its VCS root handling; running from core-tests with VCS discovery disabled resolved the tooling error.

Full frontend, Go/PostgreSQL, and browser suites were not run locally. Focused startup, shell bootstrap, branding and locale coverage was used for these changes.

@stefan-ernst
stefan-ernst merged commit dca5e1d into main Nov 16, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant