Skip to content

Commit b871358

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents e07eac9 + 6fcb801 commit b871358

File tree

33 files changed

+376
-58
lines changed

33 files changed

+376
-58
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## [3.5.7](https://github.com/vuejs/core/compare/v3.5.6...v3.5.7) (2024-09-20)
2+
3+
4+
### Bug Fixes
5+
6+
* **compile-core:** fix v-model with newlines edge case ([#11960](https://github.com/vuejs/core/issues/11960)) ([6224288](https://github.com/vuejs/core/commit/62242886d705ece88dbcad45bb78072ecccad0ca)), closes [#8306](https://github.com/vuejs/core/issues/8306)
7+
* **compiler-sfc:** initialize scope with null prototype object ([#11963](https://github.com/vuejs/core/issues/11963)) ([215e154](https://github.com/vuejs/core/commit/215e15407294bf667261360218f975b88c99c2e5))
8+
* **hydration:** avoid observing non-Element node ([#11954](https://github.com/vuejs/core/issues/11954)) ([7257e6a](https://github.com/vuejs/core/commit/7257e6a34200409b3fc347d3bb807e11e2785974)), closes [#11952](https://github.com/vuejs/core/issues/11952)
9+
* **reactivity:** do not remove dep from depsMap when unsubbed by computed ([960706e](https://github.com/vuejs/core/commit/960706eebf73f08ebc9d5dd853a05def05e2c153))
10+
* **reactivity:** fix dev-only memory leak by updating dep.subsHead on sub removal ([5c8b76e](https://github.com/vuejs/core/commit/5c8b76ed6cfbbcee4cbaac0b72beab7291044e4f)), closes [#11956](https://github.com/vuejs/core/issues/11956)
11+
* **reactivity:** fix memory leak from dep instances of garbage collected objects ([235ea47](https://github.com/vuejs/core/commit/235ea4772ed2972914cf142da8b7ac1fb04f7585)), closes [#11979](https://github.com/vuejs/core/issues/11979) [#11971](https://github.com/vuejs/core/issues/11971)
12+
* **reactivity:** fix triggerRef call on ObjectRefImpl returned by toRef ([#11986](https://github.com/vuejs/core/issues/11986)) ([b030c8b](https://github.com/vuejs/core/commit/b030c8bc7327877efb98aa3d9a58eb287a6ff07a)), closes [#11982](https://github.com/vuejs/core/issues/11982)
13+
* **scheduler:** ensure recursive jobs can't be queued twice ([#11955](https://github.com/vuejs/core/issues/11955)) ([d18d6aa](https://github.com/vuejs/core/commit/d18d6aa1b20dc57a8103c51ec4d61e8e53ed936d))
14+
* **ssr:** don't render comments in TransitionGroup ([#11961](https://github.com/vuejs/core/issues/11961)) ([a2f6ede](https://github.com/vuejs/core/commit/a2f6edeb02faedbb673c4bc5c6a59d9a79a37d07)), closes [#11958](https://github.com/vuejs/core/issues/11958)
15+
* **transition:** respect `duration` setting even when it is `0` ([#11967](https://github.com/vuejs/core/issues/11967)) ([f927a4a](https://github.com/vuejs/core/commit/f927a4ae6f7c453f70ba89498ee0c737dc9866fd))
16+
* **types:** correct type inference of all-optional props ([#11644](https://github.com/vuejs/core/issues/11644)) ([9eca65e](https://github.com/vuejs/core/commit/9eca65ee9871d1ac878755afa9a3eb1b02030350)), closes [#11733](https://github.com/vuejs/core/issues/11733) [vuejs/language-tools#4704](https://github.com/vuejs/language-tools/issues/4704)
17+
18+
19+
### Performance Improvements
20+
21+
* **hydration:** avoid observer if element is in viewport ([#11639](https://github.com/vuejs/core/issues/11639)) ([e075dfa](https://github.com/vuejs/core/commit/e075dfad5c7649c6045e3711687ec888e7aa1a39))
22+
23+
24+
125
## [3.5.6](https://github.com/vuejs/core/compare/v3.5.5...v3.5.6) (2024-09-16)
226

327

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "3.5.6",
3+
"version": "3.5.7",
44
"packageManager": "pnpm@9.10.0",
55
"type": "module",
66
"scripts": {

packages-private/sfc-playground/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ onMounted(() => {
212212
@keydown.ctrl.s.prevent
213213
@keydown.meta.s.prevent
214214
:ssr="useSSRMode"
215-
:autoSave="autoSave"
215+
:model-value="autoSave"
216+
:editorOptions="{ autoSaveText: false }"
216217
:store="store"
217218
:showCompileOutput="true"
218219
:autoResize="true"

packages/compiler-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.5.6",
3+
"version": "3.5.7",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

packages/compiler-core/src/transforms/vModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
3131

3232
// we assume v-model directives are always parsed
3333
// (not artificially created by a transform)
34-
const rawExp = exp.loc.source
34+
const rawExp = exp.loc.source.trim()
3535
const expString =
3636
exp.type === NodeTypes.SIMPLE_EXPRESSION ? exp.content : rawExp
3737

packages/compiler-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.5.6",
3+
"version": "3.5.7",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,29 @@ return (_ctx, _cache) => {
10841084
}"
10851085
`;
10861086
1087+
exports[`SFC compile <script setup> > inlineTemplate mode > v-model w/ newlines codegen 1`] = `
1088+
"import { unref as _unref, isRef as _isRef, vModelText as _vModelText, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
1089+
1090+
1091+
export default {
1092+
setup(__props) {
1093+
1094+
const count = ref(0)
1095+
1096+
return (_ctx, _cache) => {
1097+
return _withDirectives((_openBlock(), _createElementBlock("input", {
1098+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (_isRef(count) ? (count).value = $event : null))
1099+
}, null, 512 /* NEED_PATCH */)), [
1100+
[_vModelText,
1101+
_unref(count)
1102+
]
1103+
])
1104+
}
1105+
}
1106+
1107+
}"
1108+
`;
1109+
10871110
exports[`SFC compile <script setup> > inlineTemplate mode > with defineExpose() 1`] = `
10881111
"
10891112
export default {

packages/compiler-sfc/__tests__/compileScript.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,23 @@ describe('SFC compile <script setup>', () => {
472472
assertCode(content)
473473
})
474474

475+
test('v-model w/ newlines codegen', () => {
476+
const { content } = compile(
477+
`<script setup>
478+
const count = ref(0)
479+
</script>
480+
<template>
481+
<input v-model="
482+
count
483+
">
484+
</template>
485+
`,
486+
{ inlineTemplate: true },
487+
)
488+
expect(content).toMatch(`_isRef(count) ? (count).value = $event : null`)
489+
assertCode(content)
490+
})
491+
475492
test('v-model should not generate ref assignment code for non-setup bindings', () => {
476493
const { content } = compile(
477494
`<script setup>

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-sfc",
3-
"version": "3.5.6",
3+
"version": "3.5.7",
44
"description": "@vue/compiler-sfc",
55
"main": "dist/compiler-sfc.cjs.js",
66
"module": "dist/compiler-sfc.esm-browser.js",

packages/compiler-sfc/src/script/definePropsDestructure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function transformDestructuredProps(
102102
return
103103
}
104104

105-
const rootScope: Scope = {}
105+
const rootScope: Scope = Object.create(null)
106106
const scopeStack: Scope[] = [rootScope]
107107
let currentScope: Scope = rootScope
108108
const excludedIds = new WeakSet<Identifier>()

0 commit comments

Comments
 (0)