Upgrade @vue/reactivity from ~3.1.1 to ~3.5.40#4861
Open
oddvalue wants to merge 1 commit into
Open
Conversation
Since Vue 3.2, the effect scheduler option is invoked with no arguments (in 3.1 it received the effect job), which is what has kept Alpine pinned to the 3.1 line. This adapts the reactivity engine registration in both the alpinejs and csp packages: the effect wrapper closes over the runner returned by @vue/reactivity and hands it to Alpine's scheduler itself. The runner is the same object Alpine stores in el._x_effects, preserving the identity that the scheduler queue (queue.includes) and dequeueJob rely on. The mergeProxies setter workaround in scope.js is still required: the "target === toRaw(receiver)" guard in @vue/reactivity's set trap is unchanged through 3.6. No public API or behavior changes. Full Cypress suite (569 tests) and Vitest suite (172 tests) pass identically before and after the bump. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Bumps
@vue/reactivityin thealpinejsandcsppackages from the ~3.1.1 line(2021) to ~3.5.40, and adapts the reactivity engine registration to the modern
effect API.
How
The registration in
packages/alpinejs/src/index.js(and the csp build) now closesover the runner returned by
effect()and hands it to Alpine's scheduler itself:The runner is the same object Alpine stores in
el._x_effects, preserving theidentity that the scheduler queue dedupe and
dequeueJob(mutation.js) rely on.Note: the
mergeProxiessetter workaround inscope.jsis still required — thetarget === toRaw(receiver)guard in @vue/reactivity's set trap is unchangedthrough 3.6.
Backward compatibility
No public API or behavior changes.
setReactivityEngineconsumers are unaffected —the adapter satisfies Alpine's existing engine contract. Full Cypress suite
(569 tests) and Vitest suite (172 tests) pass identically before and after.
Performance
Two harnesses, run against identical Alpine source with only the @vue/reactivity
version changed. Medians across repeated runs; deltas are relative to 3.1.5.
(3.6.0-rc.1 columns included for context on the follow-up bump below.)
Reactivity layer only (Node, Alpine's effect/scheduler usage pattern):
* within run-to-run noise (±20%); the array-tracking win is consistent across
every run and is the headline — it's the
x-forhot path (Vue 3.4/3.5 rewrotearray instrumentation).
End-to-end in headless Chrome (js-framework-benchmark-style x-for table):
End-to-end, 3.5.40 already lands in the same range as the 3.6 RC — DOM work
dominates, so most of the user-visible win ships with this PR. Memory at
Alpine-typical scale is unchanged across all three versions.
Follow-up
Vue 3.6 (the alien-signals reactivity rewrite, currently at 3.6.0-rc.1) keeps the
same contract — verified against the RC with the full suite green. Once 3.6 stable
tags, upgrading becomes a one-line version bump and picks up the remaining
reactivity-layer headroom in the tables above.