Skip to content

feat(sparkling-web-shell): full-page web host with native-style MPA transitions [stack 3/6] - #10

Open
Huxpro wants to merge 1 commit into
stack/2-sparkling-history-vuefrom
stack/3-sparkling-web-shell
Open

feat(sparkling-web-shell): full-page web host with native-style MPA transitions [stack 3/6]#10
Huxpro wants to merge 1 commit into
stack/2-sparkling-history-vuefrom
stack/3-sparkling-web-shell

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Stacked PR 3/6 — base: stack/2-sparkling-history-vue (#9).
Router-framework-agnostic: a web host for any Sparkling app. Independent of the shim (#8/#9) in code; stacked here for a linear review.

Summary

Adds sparkling-web-shell, a browser host that simulates the native container stack so multi-page navigation runs on the web (dev harness + embeddable preview).

Related issues

Enables in-browser preview/testing of MPA navigation without native simulators.

Changes

  • Stacks a <lynx-view> per container (own Worker heap); router.open pushes, router.close/browser-back pops, mirrored into browser history.
  • Provides the spkPipe bridge (onNativeModulesCall + nativeModulesMap) and injects globalProps (containerID + queryItems) mirroring the native SDK; sends viewAppeared/viewDisappeared.
  • Installs its behavior via sparkling-navigation's pluggable RouterWebHost; loads bundles from a runtime ?base=<url> and builds with a relative assetPrefix so it can be embedded.
  • Native-style transitions: push slides in from the right (iOS-like ease-out), close/back slides out, replace cross-fades; honors prefers-reduced-motion.
  • Extends the web RouterWebHost with replace + animated options (threaded from router.open/router.close).

How to test

pnpm --filter sparkling-navigation build
pnpm --filter sparkling-web-shell exec tsc --noEmit
# drive it against an example's dist via LYNX_BUNDLE_DIR + `rsbuild dev`

Checklist

  • I read CONTRIBUTING.md.
  • I linked a related issue (or explained why this is standalone).
  • I ran relevant checks (nav build + web-shell typecheck; verified push/back in a browser).
  • I updated docs/examples (README).
  • Tests: verified via browser (Playwright transform sampling); no unit suite for the DOM host.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ARyWgB3243gQx1exWK61Qb


Generated by Claude Code

…ransitions

A browser host that renders Sparkling apps and simulates the native container
stack, so multi-page navigation runs on the web (dev harness + embeddable
preview). Router-framework-agnostic — works for any Sparkling app.

- stacks a <lynx-view> per container (each its own Worker heap); router.open
  pushes, router.close / browser back pops, mirrored into browser history so
  back/forward/reload reconcile the stack
- provides the spkPipe method bridge (onNativeModulesCall + nativeModulesMap)
  and injects globalProps (containerID + queryItems) mirroring the native SDK;
  sends viewAppeared/viewDisappeared lifecycle events
- installs its behavior via sparkling-navigation's pluggable RouterWebHost
- loads bundles from a runtime ?base=<url> (one static build serves any
  example) and builds with a relative assetPrefix so it can be embedded
- native-style transitions: push slides the new container in from the right
  (iOS-like ease-out), close/back slides it out, replace cross-fades; honors
  prefers-reduced-motion

Extends the web RouterWebHost with replace + animated options (threaded from
router.open/close, mirroring the native OpenOptions/CloseOptions).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARyWgB3243gQx1exWK61Qb
@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 Ready Ready Preview, Comment Jul 13, 2026 1:16pm

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