Skip to content

Add @effector/router-vue draft package#44

Draft
sergeysova wants to merge 2 commits into
mainfrom
sova/heuristic-brattain-474f79
Draft

Add @effector/router-vue draft package#44
sergeysova wants to merge 2 commits into
mainfrom
sova/heuristic-brattain-474f79

Conversation

@sergeysova

Copy link
Copy Markdown
Member

Summary

Draft of a new @effector/router-vue package — Vue 3 bindings for @effector/router, mirroring the @effector/router-react API surface but using Vue idioms (provide/inject, defineComponent, h(), effector-vue/composition).

Only the latest Vue 3 (^3.5) is supported (peer dependency vue: "^3.5.0").

Reference: argon-router Vue bindings (movpushmov/argon-router#11) — adapted to @effector/router core and cleaned up.

What's included

packages/vue/:

  • Components: RouterProvider, Link, Outlet
  • View builders: createRouteView, createLazyRouteView, createRoutesView, withLayout
  • Composables: useRouter / useRouterContext, useLink, useIsOpened, useOpenedViews
  • Reactivity and Effector Scope handling delegated to effector-vue
  • Vitest + @vue/test-utils tests, README, vite.config.ts

Monorepo wiring:

  • Root devDependencies: vue, effector-vue, @vitejs/plugin-vue, @vue/test-utils; :vue script
  • VitePress sidebar + docs/vue/* pages (section "Vue β")
  • Changeset (minor, new package at 0.1.0)

Notes / decisions

  • Fixed issues from the argon reference: stray console.logs, non-reactive createRoutesView (now recomputed via computed in the render function), and a working RouterProvider.
  • useLink compares route identity via toRaw() — when the router is provided through deeply-reactive props (e.g. under @vue/test-utils), knownRoutes entries arrive proxied and a raw === check would fail.
  • useOpenedViews uses combine + effector-vue's useUnit so scope handling stays idiomatic (vs. the manual createWatch in the React package).
  • Library is authored as .ts + h() (not .tsx) because the root tsconfig targets react-jsx.

Verification

  • pnpm typecheck — clean
  • pnpm lint — 0 errors
  • pnpm test — paths + core (47) + react (17) + vue (3) all pass
  • pnpm --filter @effector/router-vue build — ES + CJS + .d.ts

Open questions

  • Package starts at 0.1.0 and docs are marked "β" — intended as a draft for review before first publish.

Add a new `@effector/router-vue` package that mirrors the
`@effector/router-react` API for Vue 3. Only the latest Vue 3 (`^3.5`) is
supported.

- Components: RouterProvider, Link, Outlet
- View builders: createRouteView, createLazyRouteView, createRoutesView, withLayout
- Composables: useRouter/useRouterContext, useLink, useIsOpened, useOpenedViews
- Reactivity and Scope handling delegated to effector-vue
- Tests (@vue/test-utils), README, docs pages and changeset

Wire the package into the monorepo: root devDependencies (vue, effector-vue,
@vitejs/plugin-vue, @vue/test-utils), `:vue` script, and the VitePress sidebar.
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5da11e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effector/router-vue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sergeysova sergeysova changed the title feat(vue): @effector/router-vue draft (Vue 3 bindings) Add @effector/router-vue draft package Jul 4, 2026
Present the new Vue bindings everywhere the React/React Native bindings are
listed: root README (packages table, workspace shortcuts, project tree), core
package README, and the getting-started guide (Vue install section).
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.

1 participant