Skip to content

test: TanStack Router upstream compat on Lynx for Web (PR2) - #23

Draft
Huxpro wants to merge 1 commit into
cursor/sparkling-router-foundation-ea10from
cursor/tanstack-lynx-web-compat-ea10
Draft

test: TanStack Router upstream compat on Lynx for Web (PR2)#23
Huxpro wants to merge 1 commit into
cursor/sparkling-router-foundation-ea10from
cursor/tanstack-lynx-web-compat-ea10

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

PR2 verification of the Sparkling Router soft-nav stack: run a sufficiently large TanStack Router upstream-derived suite against experimental Lynx for Web.

Lynx Web on main? Gallery path yes (@lynx-js/web-core / @lynx-js/go-web on the website). Full sparkling-web-shell MPA host is not on main — it lives on PR #3 / stack/3-sparkling-web-shell. This suite uses a minimal <lynx-view> harness instead.

Stacked on PR1: #21 (cursor/sparkling-router-foundation-ea10).

Scoreboard

Layer Result
Unit (headless upstream ports) 26 / 26 passed
E2E (Playwright × lynx-view) 6 / 6 passed
Full upstream RTL suite (~250+) Not runnable as-is on ReactLynx

What works

  • @tanstack/history memory API
  • router.navigate path / params / search / replace / relative ..
  • Loaders, redirect(), notFound()
  • CompositeHistory soft + hard boundary + soft-back→hard-pop
  • Lynx Web boot of TanStack RouterProvider
  • UI re-renders after navigate when use-sync-external-store@lynx-js/use-sync-external-store
  • Playwright click → bindtap (after that alias)
  • globalProps.queryItems into lynx-view

What does not work / gaps

Gap Notes
Upstream RTL suite as-is Needs DOM React (button, getByRole, createBrowserHistory)
Missing uSES Lynx alias Critical: navigate updates router.state but UI never re-renders
createBrowserHistory Lynx has no History API
<Link> / <a> / IO preload Prefer useNavigate + bindtap
Full MPA web-shell stack e2e Needs PR #3 shell
Pure Node without window createRouter touches window.origin even with memory history

Details: examples/tanstack-lynx-web-compat/RESULTS.md

Changes

  • New examples/tanstack-lynx-web-compat (unit ports + Playwright harness)
  • Backport critical aliases to examples/router-demo (use-sync-external-store, react-dom flushSync shim)

How to test

pnpm --filter @sparkling-example/tanstack-lynx-web-compat test:unit
pnpm --filter @sparkling-example/tanstack-lynx-web-compat test:e2e

Checklist

  • I read CONTRIBUTING.md.
  • I linked a related issue (or explained why this is standalone).
  • I ran relevant checks
  • I updated docs/examples (if needed).
  • I added/updated tests (if applicable), or explained why not.
Open in Web Open in Cursor 

Add examples/tanstack-lynx-web-compat that ports a high-signal subset of
TanStack Router upstream cases and runs them against experimental Lynx
for Web (@lynx-js/web-core <lynx-view>).

Findings frozen in RESULTS.md — critical: without aliasing
use-sync-external-store to @lynx-js/use-sync-external-store, navigate()
updates router.state but the UI never re-renders. Also backport that
alias (+ react-dom flushSync shim) to router-demo.

Co-authored-by: Xuan Huang (黄玄) <Huxpro@users.noreply.github.com>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sparkling Ready Ready Preview, Comment Jul 26, 2026 8:30am

Request Review

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