Skip to content

feat: Sparkling Router foundation (stack protocol + CompositeHistory + codegen) - #21

Draft
Huxpro wants to merge 1 commit into
mainfrom
cursor/sparkling-router-foundation-ea10
Draft

feat: Sparkling Router foundation (stack protocol + CompositeHistory + codegen)#21
Huxpro wants to merge 1 commit into
mainfrom
cursor/sparkling-router-foundation-ea10

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the Sparkling Router RFC foundation from scratch: URL-first dual-layer navigation (soft in-container TanStack + hard cross-container stack protocol), with codegen for _container boundaries and an S0 soft-nav demo.

Related issues

Standalone RFC foundation (Draft / seeking review). No prior branch work reused.

Changes

  • sparkling-navigation: router.stack.* JS API (push / pop / popTo / replace / reset / getState / prefetch / syncOwnLocation + sparklingStackChanged); iOS StackRouterService + PipeMethod stubs; Android IHostStackRouterDepend opt-in interface
  • sparkling-router (new): CompositeHistory, GlobalStackMirror, scheme↔manifest translation, in-memory stack for tests/demos, createSparklingHistory
  • sparkling-router-plugin (new): scans _container(.modal).tsxroute-manifest.gen.json + per-container entries (S3′ decision: keep _container* spelling; TanStack ignores via routeFileIgnorePattern)
  • sparkling-sdk iOS: SPKContainerRegistry, SPKStackCoordinator, present fallback when no UINavigationController, gesture/back → stack-changed broadcast
  • examples/router-demo: S0 soft-nav (TanStack + CompositeHistory + ReactLynx use shim) building cleanly

How to test

pnpm --filter sparkling-navigation test
pnpm --filter sparkling-router test
pnpm --filter sparkling-router-plugin test
pnpm --filter @sparkling-example/router-demo test
pnpm --filter @sparkling-example/router-demo build

Verification (2026-07-26)

Local re-run after CI green:

Check Result
sparkling-navigation jest 81 passed
sparkling-router jest 9 passed
sparkling-router-plugin jest 2 passed
router-demo rspeedy build (lynx + web) pass (main.web.bundle 344 kB)
GitHub/Vercel checks on PR SUCCESS

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.

Follow-ups

  • PR2: TanStack Router upstream compat suite on experimental Lynx-for-Web (@lynx-js/web-core / <lynx-view>) — what works / what doesn't
  • Full iOS StackRouterService host impl (S4), Android conformance (P3), awaitResult / loader (P1), multi-entry hard-nav e2e (P4)
Open in Web Open in Cursor 

… codegen

URL-first dual-layer navigation scaffold from the Sparkling Router RFC:

- sparkling-navigation: router.stack.* JS API + iOS StackRouterService stubs
- sparkling-router: CompositeHistory, GlobalStackMirror, scheme/manifest helpers
- sparkling-router-plugin: _container boundary scan → multi-entry + manifest
- sparkling-sdk iOS: SPKContainerRegistry, SPKStackCoordinator, present fallback
- examples/router-demo: S0 soft-nav demo + container-boundary authoring sample

S3′ decision: keep _container*.tsx markers; TanStack ignores via
routeFileIgnorePattern. Android stack host interface stubbed for P3.

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:05am

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