refactor: rebase file-system routing onto @solidjs/file-routes#2227
Draft
brenelz wants to merge 1 commit into
Draft
refactor: rebase file-system routing onto @solidjs/file-routes#2227brenelz wants to merge 1 commit into
brenelz wants to merge 1 commit into
Conversation
Deletes the fs-routing machinery (scanner, export analysis, virtual module serializer, watcher, tree-shake — ~1,250 lines with specs) in favor of the router-neutral @solidjs/file-routes package extracted in solidjs/solid-router#572, per the architecture in solidjs/solid-router#571. Start keeps only its server conventions: SolidStartServerFileRouter now extends PageFileSystemRouter, adding the GET/POST/etc. export handling and the dataOnly flag. SolidStartClientFileRouter is the shared page convention re-exported. The config composes fileRoutes({ routers }) from @solidjs/file-routes/vite, and the virtual module id becomes the neutral solid:file-routes. Blocked on @solidjs/file-routes being published; the deleted specs already live in that package's test suite. Validated with a local file: link: tsc clean, 32/32 remaining tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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.
Note
Draft / blocked on
@solidjs/file-routespublishing — companion to solidjs/solid-router#572, implementing the split refined by @ryansolid in solidjs/solid-router#571. Once that PR merges and a release cuts, this needs a lockfile regen and can leave draft.What this does
Deletes Start's fs-routing machinery in favor of the router-neutral
@solidjs/file-routespackage, leaving Start with only its server conventions. +39 / −1,344 lines.Deleted (
src/config/fs-routes/, ~1,250 lines)router.ts(scanner / manifest) →BaseFileSystemRouterfrom@solidjs/file-routesindex.ts(virtual module serializer) →fileRoutes()from@solidjs/file-routes/vitefs-watcher.ts→ the plugin's watcher (with a fix: routes are pre-built before the reloader attaches, so the initial scan no longer invalidates the virtual module mid-load)tree-shake.ts→ identical port in the pluginrouter.spec.ts/tree-shake.spec.ts→ already live in@solidjs/file-routes' test suiteKept (Start's server conventions)
SolidStartServerFileRouternowextends PageFileSystemRouter, adding only theGET/POST/etc. export analysis,$HEADfallback, and thedataOnlyflagSolidStartClientFileRouteris the shared page convention, re-exportedserver/routes.ts(API matching), middleware, SSR<FileRoutes>— unchangedWiring changes
config/index.tscomposesfileRoutes({ routers })keyed by Vite environment; theglobalThis.ROUTERShand-off is now a plain local referencesolid-start:routes→ the neutralsolid:file-routes(internal only)Validation
Against a local
file:link to@solidjs/file-routes(built from solidjs/solid-router#572):tsc --noEmitcleanpackages/starttests pass🤖 Generated with Claude Code