feat(tanstack-router-demo): prove TanStack Router runs on ReactLynx - #15
Open
Huxpro wants to merge 1 commit into
Open
feat(tanstack-router-demo): prove TanStack Router runs on ReactLynx#15Huxpro wants to merge 1 commit into
Huxpro wants to merge 1 commit into
Conversation
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
|
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 2/5 (base:
tsr-01-sparkling-history). A feasibility spike: a single-page TanStack Router (memory history) running inside a ReactLynx bundle, with noreact-domand no DOM globals. This establishes the bundler-level shims the rest of the port depends on.📚 Stack (review bottom → top)
tsr-01-sparkling-history— router-agnostic web-history shimtsr-02-reactlynx-spike— prove TanStack Router runs on ReactLynx (this PR)tsr-03-mpa-codegen— file-based routing + native MPA + codegentsr-04-website-goweb— go-web example + in-card web bridgetsr-05-docs-guide— design guide + support matrix + RN comparisonRelated 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/useTransitionvia@lynx-js/react/compat; ausebinding for strict ESM linking).src/shims/react-dom.ts: aflushSyncshim (router-core batches with it).src/shims/env.ts: minimal global polyfills (scrollTo/queueMicrotask/AbortController) for a Lynx JS context with nowindow/document.src/spike/index.tsx: the live proof — a typed in-page route transition.lynx.config.tsaliasesreact/react-domto the shims; package/tsconfig scaffold.How to test
pnpm --filter tanstack-router-demo build # emits spike.lynx.bundleChecklist
buildemits the spike bundle)🤖 Generated with Claude Code
https://claude.ai/code/session_01H1EU55YA4e1zj2oVHh7Zme
Generated by Claude Code