feat(tanstack-router-demo): official file-based routing + native MPA over the shim - #16
Open
Huxpro wants to merge 1 commit into
Open
feat(tanstack-router-demo): official file-based routing + native MPA over the shim#16Huxpro wants to merge 1 commit into
Huxpro wants to merge 1 commit into
Conversation
…over the shim Drive native multi-page navigation with TanStack Router's own file-based routing, wired to sparkling-navigation through the sparkling-history shim. - src/routes/*: file-based routes via createFileRoute, each cross-page route carrying a `page` export (id + containerParams) that marks a native-page / bundle boundary — our MPA extension on top of the official convention. - src/routeTree.gen.ts: produced by the official @tanstack/router-generator (unmodified) running in the Rspeedy build; proves the generator is directly reusable in a Lynx project. - scripts/gen-mpa.mjs + routes.manifest.ts + page-entries.gen.ts: our codegen reads the `page` markers to emit the route->bundle manifest and one bundle entry per native page — the piece the official generator does not produce. - src/mpa/create-router.tsx: builds the router over createMpaHistory + createSparklingHost, reconstructing the launch location from queryItems. - Tests: a headless feature-support matrix (router-features) driving a real router over the shim, plus a generated-tree test proving the generated tree boots and navigates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Stacked PR 3/5 (base:
tsr-02-reactlynx-spike). Drives native multi-page navigation with TanStack Router's own file-based routing, wired tosparkling-navigationthrough thesparkling-historyshim. This is where the Router implementation meets the shim.📚 Stack (review bottom → top)
tsr-01-sparkling-history— router-agnostic web-history shimtsr-02-reactlynx-spike— prove TanStack Router runs on ReactLynxtsr-03-mpa-codegen— file-based routing + native MPA + codegen (this PR)tsr-04-website-goweb— go-web example + in-card web bridgetsr-05-docs-guide— design guide + support matrix + RN comparisonRelated issues
Standalone. Depends on PRs 1–2.
Changes
src/routes/*: file-based routes viacreateFileRoute, each cross-page route carrying apageexport (id + containerParams) marking a native-page / bundle boundary — our MPA extension on top of the official convention.src/routeTree.gen.ts: produced by the official@tanstack/router-generator(unmodified) running in the Rspeedy build — proves the generator is directly reusable in a Lynx project.scripts/gen-mpa.mjs+routes.manifest.ts+page-entries.gen.ts: our codegen reads thepagemarkers to emit the route→bundle manifest and one bundle entry per native page — the piece the official generator does not produce.src/mpa/create-router.tsx: builds the router overcreateMpaHistory+createSparklingHost, reconstructing the launch location fromqueryItems.router-features) driving a real router over the shim, plus agenerated-treetest proving the generated tree boots and navigates.How to test
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme
Generated by Claude Code