feat(router,server,docs): file-based routing + single-source stability matrix (#149, #150) - #160
Merged
Merged
Conversation
…ns + single-source stability matrix (#149, #150) Closes #149, #150. #149 — Opt-in, bundler-agnostic file-route convention with typed load/action: - router: createFileRoutes(manifest) → RouteDefinition[] from a bundler glob or hand-written map; parseFilePath / filePathToRoutePattern ([id]→:id, [...rest]→*, (group) dropped); specificity sorting; typed Load/Action contracts; createRouteData/useRouteData run load on client navigation. - ssr: router-bridge now recognises meta.load (adapting SSRContext) alongside meta.loader, so loaders run on the server before render. - server: mountFileRoutes / createFileRouteServerRoutes expose each route's action over HTTP (skips eager no-action routes, 405 for lazy ones), with an optional JSON loader endpoint; composes with csrf(). - Programmatic routing unchanged; no bundler shipped. Wired into full.ts. - Tests: tests/router-file-routes.test.ts, tests/server-file-routes.test.ts. - Docs: new guide/file-routing.md + router.md / server.md sections + sidebar. #150 — Single-source stability matrix + per-module stability changelog: - scripts/stability-matrix.mjs is the canonical data; STABILITY.md is the human-facing source of truth with per-module status history. - README "Modules at a glance" and docs introduction.md matrix now reference and are validated against it by scripts/check-stability-matrix.mjs (bun run check:stability), so the surfaces cannot silently drift. - CHANGELOG gains a "Module status" section; release-notes index reconciled to list 1.14.2; release-process docs document the new gate. - Test: tests/check-stability-matrix.test.ts (runs in bun test, enforcing CI). Gates: lint, lint:types, test:types, build, bun test (2984 pass), check:full-bundle, check:ai-guidance, check:stability all green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Works through all open GitHub issues (#149, #150) in one branch.
Closes #149
Closes #150
#149 — File-based routing with typed loaders and actions
An opt-in, bundler-agnostic file-route convention that bridges
router,ssr, andserver. Programmatic routing (createRouter) stays fully supported and unchanged; no bundler is shipped — the input is a manifest (a bundler glob such asimport.meta.glob, or a hand-written map for zero-build).routercreateFileRoutes(manifest, options?)→{ routes, entries }— plainRouteDefinitionscreateRouter()already consumes.parseFilePath/filePathToRoutePattern—routes/users/[id]/+page.ts→/users/:id,[...rest]→*,(group)dropped; flat Next/Nuxt-style files supported.sortEntriesBySpecificity— static beats dynamic, catch-all sorts last (correct first-match resolution).Load/Actioncontracts;createRouteData(router)/useRouteData()runloadon client navigation with stale-response guarding.ssr— the router bridge now recognisesmeta.load(adaptingSSRContext) alongside the legacymeta.loader, so loaders run on the server before render viacreateSSRRouterContext.server—mountFileRoutes(app, entries, options?)/createFileRouteServerRoutes(entries, options?)expose each route'sactionover HTTP (eager no-action routes are skipped; lazy ones reply405), with an optional JSON loader endpoint underdataPath. Composes withcsrf().Docs: new File-based Routing guide + sections in
router.md/server.md+ sidebar entry.#150 — Reconcile version history + per-module stability changelog
The 1.11.0 date conflict and the version drift were already resolved in earlier PRs; this finishes the issue:
scripts/stability-matrix.mjs(canonical data) +STABILITY.md(human-facing matrix with per-module status history).introduction.mdmatrix now reference it and are validated against it byscripts/check-stability-matrix.mjs(bun run check:stability) — so the three surfaces can no longer silently drift.[Unreleased]gains a "Module status" section (per the issue's proposed shape);release-notes/index.mdreconciled to list 1.14.2; release-process docs document the new gate.tests/check-stability-matrix.test.ts(runs inbun test, mirroring howcheck:full-bundleis enforced).Validation
All green locally:
bun run lint·bun run lint:types·bun run test:typesbun run buildbun test— 2984 pass / 0 failbun run check:full-bundle·bun run check:ai-guidance·bun run check:stability🤖 Generated with Claude Code