Moves phases 08–11 execution artifacts from .planning/phases/ to .planning/milestones/v0.2-phases/ to keep .planning/phases/ clean for the next milestone. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.3 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 11-visual-design-responsive-layout-cleanup | 2 | frontend/router |
|
|
|
|
|
|
Phase 11 Plan 2: Lazy-Load Non-Critical Routes Summary
Lazy-loaded 5 non-critical authenticated route components, reducing the main JS bundle from 264.63 kB to 180.17 kB and emitting 5 separate route chunks, satisfying PERF-03.
What Was Built
Tasks 1-4 — Router lazy-loading
frontend/src/router/index.js updated:
- Removed static
importstatements forTopicsView,DocumentView,SettingsView,CloudStorageView,CloudFolderView. - Replaced each with an inline
() => import('../views/...View.vue')dynamic import on the route'scomponentfield. - Kept
FileManagerViewas the sole static synchronous import (decision D-10). A comment block inrouter/index.jsdocuments the rationale. - Kept
/folders/:folderIdusing the synchronousFileManagerViewcomponent — no new chunk needed since the component is already in the initial bundle. - Preserved all existing lazy imports for admin children, auth views,
SharedView, andAdminLayout.
Acceptance criterion confirmed: grep "import .*View" frontend/src/router/index.js returns only FileManagerView.
Task 5 — Extended router guard tests
frontend/src/router/__tests__/router.guard.test.js extended with 15 new tests across 2 new describe blocks:
router — admin guardextended with: non-admin blocked from/admin/usersand/admin/quotas(child route inheritance viato.matched.some()), admin redirected away from/settingsand/cloud(D-09)router — refresh-before-guard(new): verifiesrefresh()is called whenaccessTokenis null, redirect to/loginwhen refresh fails, no refresh call for public routesrouter — lazy-loaded routes resolve(new): verifies all 5 newly-lazy routes (/topics,/topics/:name,/document/:id,/settings,/cloud,/cloud/:provider/:folderId) navigate correctly for authenticated regular users;/folders/:folderIdand/sharedalso covered
All 234 tests pass (up from 219 in Plan 11-01).
Task 6 — Build verification
npm run build succeeds; route chunks emitted:
| Chunk | Size |
|---|---|
CloudFolderView-*.js |
1.99 kB |
CloudStorageView-*.js |
2.32 kB |
DocumentView-*.js |
9.17 kB |
TopicsView-*.js |
10.98 kB |
SettingsView-*.js |
60.72 kB |
Main bundle (index-*.js) |
180.17 kB (was 264.63 kB) |
Main bundle reduction: 84.46 kB raw (~32%).
Verification
rg "import .*View" frontend/src/router/index.jsreturns onlyFileManagerView— confirmed- Admin child routes remain lazy-loaded — confirmed
npm test: 234 tests pass, 30 test filesnpm run build: succeeds, split route chunks emitted
Deviations from Plan
None — plan executed exactly as written.
Known Stubs
None.
Threat Flags
None — this plan makes no network, auth, or schema changes. Guard behavior is unchanged; only the loading strategy for view components was modified.
Self-Check: PASSED
frontend/src/router/index.js: modified, onlyFileManagerViewstatically importedfrontend/src/router/__tests__/router.guard.test.js: modified, 15 new tests- Commit
4fa07b3exists in git log - Build output shows 5 route chunk files