Skip to content

fix(vue): follow a new to in Link - #127

Open
leo-millennial wants to merge 5 commits into
effector:mainfrom
leo-millennial:vue/link-reactive-to
Open

leo-millennial wants to merge 5 commits into
effector:mainfrom
leo-millennial:vue/link-reactive-to

Conversation

@leo-millennial

Copy link
Copy Markdown

Summary

<Link> follows a new to prop. Before, href and the route opened on click stayed on the first to, because Link called useLink once in setup. Related: #124.

useLink resolves the route on every read and binds onOpen with the scope that useProvidedScope returns in setup. The public useLink(to) signature stays, Link uses an internal variant that takes a getter. The new test switches to from /first to /second/7 and checks href and the opened route.

useProvidedScope appeared in effector-vue 23.3.0, so the peer range is now >=23.3.0 and the changeset is minor.

Includes #125 (the first four commits). Please review the last commit, I will rebase after #125 is merged.

Type of change

  • 🐛 Bug fix

Checklist

  • I linked a related issue (or explained why there isn't one)
  • pnpm build passes
  • pnpm typecheck passes
  • pnpm test passes and I added/updated tests for my change
  • pnpm lint passes
  • I added a changeset (pnpm changeset), or an empty one for no-release changes (pnpm changeset --empty)

effector-vue 23.3.0 exports the scope plugin from the composition entry,
and its ESM entries load in Vitest with Vue 3. The tests no longer need
createRequire and a cast to reach the CJS build.

Bump the effector-vue dev dependency to ^23.3.0 and resolve the Vue
package's peer to the same version.
effector-vue 23.3.0 types a store ref as Readonly<Ref<T>>, so the
current query is a plain Query and passes to stringifyQuery as it is.
useOpenedViews combined the route stores into a new derived store on
every mount. Nothing cleared it, so each RoutesView or Outlet mount left
a node linked to the route stores.

The stores now go to useUnit as a list, which subscribes to them
directly and unsubscribes on unmount. The new test counts stores created
during three mounts with inspectGraph: three before, none after.
Point the Scope sections at the composition entry and mention the
forceScope option. Both need effector-vue 23.3.0.
Link called useLink once in setup, so href and the route opened on click
stayed on the first `to`. useLink now resolves the route on every read,
and binds its open event with the scope found in setup through
useProvidedScope.

useProvidedScope comes with effector-vue 23.3.0, so the peer range
starts there.
@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 Oct 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4504b8c

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

@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for effector-router failed. Why did it fail? →

Name Link
🔨 Latest commit 4504b8c
🔍 Latest deploy log https://app.netlify.com/projects/effector-router/deploys/6ae0a4ef320d68b1ef2d14eb

This branch has not been deployed

No deployments
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