feat(sparkling-history): Vue Router adapter (sparkling-history/vue) [stack 2/6] - #9
Open
Huxpro wants to merge 1 commit into
Open
feat(sparkling-history): Vue Router adapter (sparkling-history/vue) [stack 2/6]#9Huxpro wants to merge 1 commit into
Huxpro wants to merge 1 commit into
Conversation
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
|
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
Adds
sparkling-history/vue:createSparklingRouter()builds a standard vue-routerRouterwhose history is the shim'sHybridRouterHistory. 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 nativerouter.openthat 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.ts—createSparklingRouter,SparklingRouter; wraps onlypush/replace(incl. cross-bundle named routes,history.state,replace), leaving in-heap behavior untouched../vuesubpath export + optionalvue-routerpeer dependency.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
Checklist
CONTRIBUTING.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01ARyWgB3243gQx1exWK61Qb
Generated by Claude Code