Repository navigation
feat(frontend): reactive error locale (#158), AOT i18n precompile + size gate (#159), image build smoke (#160) - #179
Merged
Merged
Conversation
…e, image build smoke #158 — errors re-translate on locale switch: services/locale.ts takes an injected reactive getter (setLocaleGetter) wired to the vue-i18n composer ref; error state stores the NormalizedError and pages/banners resolve the catalog message at render time (errorText computed). Services stay vue-i18n-free (node tests use the plain-mirror fallback). Both locking i18n e2e specs now assert re-translation; new locale.reactive unit test pins the getter contract. #159 — @intlify/unplugin-vue-i18n precompiles the UI catalogs (default- export TS modules, explicit include paths) and production builds bundle vue-i18n runtime-only; main chunk 251.7->133.8 KB (user) and 248.6->143.1 KB (admin). New scripts/check-frontend-size.mjs gates total + entry-chunk raw JS at baseline +10% (wired into _frontend.yml); production builds of both apps verified against vite preview in en + zh-CN. #160 — frontend-image-smoke job in _frontend.yml builds both frontend Docker images (push: false) on PRs touching frontends/** or deploy/docker/**, mirroring release.yml's builds with GHA layer cache, so image regressions fail the PR instead of the release.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…mage-smoke paths filter
A reusable workflow cannot escalate above the caller's permissions —
nested job 'frontend-image-smoke' requesting 'pull-requests: read' made
ci.yml fail startup validation ('only allowed pull-requests: none').
Set the ceiling on the calling job per GitHub's reusable-workflow model.
…t imports #160 smoke caught a real, latent master break: the frontend-runtime image builds in an isolated context copying ONLY frontends/user/, but tsc (via npm run build) type-checks src tests that dynamically import ../../../admin/** — added in #156 and unbuildable in the container since. No release has shipped an image build since #156, so it went unnoticed. tsconfig.build.json excludes *.test.ts from the build type-check; tests stay type-checked in-repo via the base tsconfig. Admin app is unchanged (its image context is self-contained and its tests keep container type-checking).
Owner
Author
Finding: the #160 smoke caught a real, latent master break on its first runThe new
Fix in this PR: |
wangrh0909
approved these changes
Sep 8, 2026
wangrh0909
pushed a commit
that referenced
this pull request
Sep 10, 2026
… and hooks Consolidates the recurring lessons from the 2026-08/09 engineering sessions (previously only in AI-session memory) into versioned, tool-agnostic assets: - skills: ci-gate-sync (sync-point policies for error codes/endpoints/ migrations/headers), ci-failure-triage (cross-compiler WERROR blind spots, flake taxonomy), release-engineering (six-point + ~15 version carriers, tag recovery, PyPI first publish), pr-workflow (rebase-merge repair, rebase value-loss audit, PAT permission boundary), local-env-runbook (Windows/WSL/Docker/Mimosa/multi-session rules), test-methodology (two test layers, mock injection seam, Playwright pitfalls), and benchmark-methodology (wrk Lua model, A/B discipline, measurement-artifact taxonomy). - rules (path-scoped): sync-points (8-point error-code and 5-point endpoint hard checklists), frontend-contract (verified frontend/backend contract facts), async-cpp-gotchas (traps beyond db-operations: Session::insert no-overwrite, callback double-move, ::drogon:: shadowing). - commands: /preflight (local gate sweep before pushing), /ci-triage (failure classification workflow). - hooks: local-gates.sh (wired to the git-commit PreToolUse hook, replacing the broken full-ctest gate), port-guard.sh, redis-watchdog.ps1. Provenance (source retrospectives): ci-gate-sync/rules.sync-points from PR #115/#141/#149/#157/#179/#180 CI post-mortems; release-engineering from the v1.0.0-v1.1.0 release runs; test-methodology from the coverage push (48.5%->57.2%) and PR #140/#156 e2e work; benchmark-methodology from the four-product comparison campaign; local-env-runbook from environment incident records. AGENTS.md indexes the new rules and skills.
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
Closes the three i18n follow-up issues from the PR #156 review in one tranche (frontend-only; no API/SDK/protocol impact):
#158 — errors re-translate on locale switch
Two stacked one-time resolutions caused the snapshot behavior:
services/locale.tsheld a plain module variable (not Vue-trackable), and error state stored the already-resolved string.services/locale.tsgains an injectable getter (setLocaleGetter);getCurrentLocale()prefers it, falling back to the plain mirror so node-env tests and the cross-app property test keep exact pre-Errors do not re-translate on locale switch (reactive error locale — ADR-0013 follow-up) #158 behavior. The services layer stays vue-i18n-free.src/i18n/index.tsinjectssetLocaleGetter(() => i18n.global.locale.value); underlegacy: falsethat is a ref, so agetErrorMessage(code)call inside a render effect tracks the locale.NormalizedError(ref<NormalizedError | string | null>) and resolve at render time via anerrorTextcomputed. Plain strings (parameterized chrome copy viat('key', {param})) keep snapshot semantics by design. One deliberate exception stays imperative:window.alert(...)in the user SecurityPage link flow.locale.reactive.test.tspins the getter contract (preference over the mirror, re-resolution, afterEach cleanup).#159 — AOT precompile + bundle-size budget gate
@intlify/unplugin-vue-i18n@11.2.5precompiles the UI catalogs (converted toexport defaultper the plugin contract; explicitincludepaths so application code is never matched). Production builds bundle vue-i18n runtime-only: main chunk 251.7→133.8 KB (user) and 248.6→143.1 KB (admin); dev/vitest keep the full build (separate vitest config), so tests exercise identical message resolution semantics.services/messages/*) is intentionally untouched — it is a plain lookup table that never goes through vue-i18n.scripts/check-frontend-size.mjsgates total + entry-chunk raw JS at baseline +10% (wired into_frontend.ymlafter builds). The entry-chunk cap doubles as the AOT guard: the compiler re-entering the bundle costs ~90-118 KB on the main chunk and trips the gate mechanically. Raise baselines only with written PR justification (coverage-ratchet discipline).vite preview+ Playwright in en and zh-CN (dev-server e2e alone cannot see the runtime-only path).#160 — frontend Docker image build smoke
New
frontend-image-smokejob in_frontend.yml: path-filtered (frontends/**,deploy/docker/**, the workflow itself)docker buildwithpush: falseof exactly the two imagesrelease.ymlbuilds — admin (contextfrontends/admin) and the user portal (deploy/docker/Dockerfiletargetfrontend-runtime). GHA layer cache keeps warm runs cheap. If cold-cache runtime ever disappoints, the documented fallback iscontinue-on-error, not removal. Becauseci.yml'sbuild-testneeds thefrontendcall, the smoke gates the main gate.Testing
tsc && vite buildgreen; vitest green (user 37 incl. 3 new, admin 4); ESLint 0 errors (warning counts identical to master); Playwright e2e green (user 119 passed / 2 skipped, admin 190 passed / 6 skipped — both skip sets pre-existing).node scripts/check-frontend-size.mjsgreen;check-ui-sync.mjsgreen (shared UI kit untouched).Docs
ADR-0013 (limitation removed),
docs/contribute/frontend-i18n.md(reactive resolution + plugin section),docs/contribute/ci-cd-guide.md(frontend gate section, sections renumbered), CHANGELOG[Unreleased].