Skip to content

feat(tanstack-router-demo): prove TanStack Router runs on ReactLynx - #15

Open
Huxpro wants to merge 1 commit into
claude/tsr-01-sparkling-historyfrom
claude/tsr-02-reactlynx-spike
Open

feat(tanstack-router-demo): prove TanStack Router runs on ReactLynx#15
Huxpro wants to merge 1 commit into
claude/tsr-01-sparkling-historyfrom
claude/tsr-02-reactlynx-spike

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked PR 2/5 (base: tsr-01-sparkling-history). A feasibility spike: a single-page TanStack Router (memory history) running inside a ReactLynx bundle, with no react-dom and no DOM globals. This establishes the bundler-level shims the rest of the port depends on.

📚 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 (this PR)
  3. tsr-03-mpa-codegen — file-based routing + native MPA + codegen
  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 PR 1/5.

Changes

  • src/shims/react.ts: adds the React 18/19 named bindings ReactLynx lacks but @tanstack/react-router's dist imports (startTransition/useTransition via @lynx-js/react/compat; a use binding for strict ESM linking).
  • src/shims/react-dom.ts: a flushSync shim (router-core batches with it).
  • src/shims/env.ts: minimal global polyfills (scrollTo/queueMicrotask/AbortController) for a Lynx JS context with no window/document.
  • src/spike/index.tsx: the live proof — a typed in-page route transition.
  • lynx.config.ts aliases react/react-dom to the shims; package/tsconfig scaffold.

How to test

pnpm --filter tanstack-router-demo build   # emits spike.lynx.bundle

Checklist

  • I ran relevant checks (build emits the spike bundle)
  • Tests — the headless feature matrix lands in PR 3/5
  • Docs — design guide lands in PR 5/5

🤖 Generated with Claude Code

https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme


Generated by Claude Code

Feasibility spike: a single-page TanStack Router (memory history) running inside
a ReactLynx bundle, with no react-dom and no DOM globals. This establishes the
bundler-level shims the rest of the port depends on.

- src/shims/react.ts: adds the React 18/19 named bindings ReactLynx lacks but
  @tanstack/react-router's dist imports (startTransition/useTransition via
  @lynx-js/react/compat; a `use` binding for strict ESM linking).
- src/shims/react-dom.ts: a flushSync shim (router-core batches with it).
- src/shims/env.ts: minimal global polyfills (scrollTo/queueMicrotask/
  AbortController) for a Lynx JS context with no window/document.
- src/spike/index.tsx: the live proof — a typed in-page route transition.
- lynx.config.ts aliases react/react-dom to the shims; package/tsconfig scaffold.

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:30pm

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