Repository navigation
fix: port solid-start route treeshake fixes (#2238, #2249) - #1
Merged
Merged
Conversation
- keep route module ids ending in a real extension (`?pick=...&lang.<ext>`) so ecosystem plugins with extension-anchored filters match route modules (solid-start #2249, fixes solid-start #1918/#1374), and sanitize chunk file names so route chunks keep their file-based names - don't strip TS namespace members from route files: `export` inside a namespace/module block is unrelated to the pick list (solid-start #2238) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
birkskyum
approved these changes
Jul 30, 2026
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.
Ports two file-system-routing fixes that landed on solid-start
mainafter routing moved to this package, so they were dropped in themain→upgrade-to-solid-2-betamerge. Reference implementations: solid-start #2249 and #2238.Keep route module ids ending in a real extension (solid-start #2249)
toModuleIdbuilt ids likeroute.tsx?pick=default&pick=$css, which silently excludes route modules from any plugin whose filter is anchored on the file extension — a very common default, e.g. unplugin-macros'/\.[cm]?[jt]sx?$/(solid-start #1918, #1374).toPickIdappends a&lang.<ext>marker (the Vue SFC convention,?vue&type=script&lang.ts) so ids end in a real extension again.sanitizeChunkFileName— the bundler's default sanitizer plus a pass that strips the?pick=...&langtail — is applied via the plugin'sconfig()hook so route chunks keep their short file-based names (index-<hash>.js, notindex.tsx_pick_default_pick__css_lang-<hash>.js). Applied top-level rather than per-environment so server chunk names stay clean too. Both helpers are exported fromfilesystem-routing/vite.Don't strip TS namespace members from route files (solid-start #2238)
The tree-shake transform treated
exportstatements inside TS namespace/module blocks as route exports and pruned them when they weren't in the pick list. Only module-level exports are route exports, so the visitor now skips anyExportNamedDeclarationwhose parent isn't the Program.Verification
toPickId,sanitizeChunkFileName, the&lang.<ext>id format in the virtual module/build inputs, and a namespace-member regression test.upgrade-to-solid-2-betabranch (basic fixture, patched dist): dev + prod SSR of a TS-namespace route renders correctly, and client/server chunk names are clean.Two patch changesets included. solid-start's 2.x branch will bump its dependency once this is released.
🤖 Generated with Claude Code