$ the-wire · showcase
Vue's compiler preserves CDN base URLs, and deep watchers stop over-tracking arrays
By RepoJournal · Filed · About Vue.js · Composed from the cited sources · methodology
vuejs/core landed a reactivity fix that removes N+1 dependency tracking per reactive array and three compiler and runtime correctness fixes, the most likely of which to bite production apps is srcset URLs resolving against the wrong host.
fix(compiler-sfc): preserve full base URLs in srcset vuejs/core
The srcset transform passed a full `transformAssetUrls.base` through `path.join`, which collapsed `https://` to `https:/` and, with protocol-relative bases, dropped a leading slash, so generated image URLs could resolve against the application host instead of the CDN. With `includeAbsolute: true`, a corrupted entry in a mixed srcset list could also be turned into a local asset import: check any...
perf(reactivity): track reactive arrays once in traverse vuejs/core
`traverse()` read `length` and every index through the proxy, giving a deep watcher N+1 deps for one array, and since `vModelCheckbox` and `vModelSelect` are deep, 100 checkboxes bound to 20 selected items meant 2,000 proxy reads and `track()` calls per re-render. Reactive, non-readonly, non-shallow arrays now track a single array key instead.
fix(runtime-core): release the unmounted owner of a watcher in a longer-lived scope vuejs/core
Watchers created in a longer-lived scope than the component they reference now drop that component reference when it is disposed; the PR also adds an `onStop` watch option, invoked after cleanup when a watcher stops. Long-lived effect scopes holding disposed components are the retention path this closes.
fix(teleport): mount missing hydration children within target anchors vuejs/core
Hydration of Teleport content no longer depends on server-rendered target anchors being present: missing children are mounted within the target anchors while the app root and existing target content are preserved, and child ordering for empty text nodes and fragments during hydration is corrected.
fix: select the option bound to the value in setValue on select vuejs/test-utils
`setValue` on a `<select>` compared against each option's `value` string while `v-model` compares against the value bound by `:value`, which is why `setValue(null)` on `<option :value="null">` produced `undefined` and `setValue([1, 3])` on a number-bound `multiple` select selected nothing. Tests currently work around it with `selectedIndex`; the PR aligns the comparison with what `v-model` actu...