Skip to content

feat(sparkling-history): Vue Router adapter (sparkling-history/vue) [stack 2/6] - #9

Open
Huxpro wants to merge 1 commit into
stack/1-sparkling-historyfrom
stack/2-sparkling-history-vue
Open

feat(sparkling-history): Vue Router adapter (sparkling-history/vue) [stack 2/6]#9
Huxpro wants to merge 1 commit into
stack/1-sparkling-historyfrom
stack/2-sparkling-history-vue

Conversation

@Huxpro

@Huxpro Huxpro commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Stacked PR 2/6 — base: stack/1-sparkling-history (#8). Review after 1/6.
This is the Router implementation on top of the router-agnostic shim — the key split the stack is organized around.

Summary

Adds sparkling-history/vue: createSparklingRouter() builds a standard vue-router Router whose history is the shim's HybridRouterHistory. Same-bundle navigations stay in-heap (normal vue-router SPA); navigations resolving to a route owned by another bundle (per the shared manifest) are diverted to a native router.open that stacks a new container.

Related issues

The Vue Router surface of the shared shim (#8). Analogous adapters for TanStack (#1) / Nuxt (#2) would sit on the same core.

Changes

  • src/vue/index.tscreateSparklingRouter, SparklingRouter; wraps only push/replace (incl. cross-bundle named routes, history.state, replace), leaving in-heap behavior untouched.
  • ./vue subpath export + optional vue-router peer dependency.
  • Tests: vue-adapter (real vue-router per simulated container) + vue-features (proves in-heap dynamic/nested/named/redirect/alias/guards/addRoute pass through unchanged).
  • COMPATIBILITY.md — full Vue Router feature matrix under the MPA model.

How to test

pnpm --filter sparkling-history test   # 57 tests total

Checklist

  • I read CONTRIBUTING.md.
  • I linked a related issue (or explained why this is standalone).
  • I ran relevant checks (57 tests pass).
  • I updated docs/examples (COMPATIBILITY.md).
  • I added/updated tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ARyWgB3243gQx1exWK61Qb


Generated by Claude Code

The Router implementation on top of the router-agnostic shim.
createSparklingRouter builds a standard vue-router Router whose history is a
HybridRouterHistory: navigations resolving to a route the current bundle owns
stay in-heap (normal vue-router SPA — nested views, params, guards), while
navigations resolving to a route owned by ANOTHER bundle (per the shared
manifest, incl. named routes) are diverted to a native router.open that stacks
a new container. Same-bundle behavior is untouched — the adapter only wraps
push/replace.

- src/vue/index.ts (createSparklingRouter, SparklingRouter)
- ./vue subpath export + optional vue-router peer dependency
- tests: vue-adapter (real vue-router instances per simulated container) and
  vue-features (proves in-heap dynamic/nested/named/redirect/alias/guards/
  addRoute pass through unchanged) — 22 tests, 57 total
- COMPATIBILITY.md: full Vue Router feature matrix under the MPA model

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

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