Skip to content

feat(tanstack-router-demo): official file-based routing + native MPA over the shim - #16

Open
Huxpro wants to merge 1 commit into
claude/tsr-02-reactlynx-spikefrom
claude/tsr-03-mpa-codegen
Open

feat(tanstack-router-demo): official file-based routing + native MPA over the shim#16
Huxpro wants to merge 1 commit into
claude/tsr-02-reactlynx-spikefrom
claude/tsr-03-mpa-codegen

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked PR 3/5 (base: tsr-02-reactlynx-spike). Drives native multi-page navigation with TanStack Router's own file-based routing, wired to sparkling-navigation through the sparkling-history shim. This is where the Router implementation meets the shim.

📚 Stack (review bottom → top)

  1. tsr-01-sparkling-history — router-agnostic web-history shim
  2. tsr-02-reactlynx-spike — prove TanStack Router runs on ReactLynx
  3. 👉 tsr-03-mpa-codegen — file-based routing + native MPA + codegen (this PR)
  4. tsr-04-website-goweb — go-web example + in-card web bridge
  5. tsr-05-docs-guide — design guide + support matrix + RN comparison

Related issues

Standalone. Depends on PRs 1–2.

Changes

  • src/routes/*: file-based routes via createFileRoute, each cross-page route carrying a page export (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 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.

How to test

pnpm --filter tanstack-router-demo test    # 16 passing (codegen runs in pretest)
pnpm --filter tanstack-router-demo build   # emits home/detail/settings/spike .lynx.bundle

Checklist

  • I ran relevant checks (16 tests + native build)
  • I added/updated tests
  • Docs — design guide lands in PR 5/5

🤖 Generated with Claude Code

https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme


Generated by Claude Code

…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
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sparkling Error Error Jul 13, 2026 1:31pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants