Skip to content

Commit ab1121e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents db6eff6 + 3f92126 commit ab1121e

File tree

22 files changed

+136
-24
lines changed

22 files changed

+136
-24
lines changed

.github/workflows/size-data.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
if_no_artifact_found: warn
4848

4949
- name: Upload Size Data
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: size-data
5353
path: temp/size
@@ -56,7 +56,7 @@ jobs:
5656
if: ${{ github.event_name == 'pull_request' }}
5757
run: echo ${{ github.event.number }} > ./pr.txt
5858

59-
- uses: actions/upload-artifact@v3
59+
- uses: actions/upload-artifact@v4
6060
if: ${{ github.event_name == 'pull_request' }}
6161
with:
6262
name: pr-number

.github/workflows/size-report.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: pnpm install
3737

3838
- name: Download PR number
39-
uses: dawidd6/action-download-artifact@v2
39+
uses: dawidd6/action-download-artifact@v3
4040
with:
4141
name: pr-number
4242
run_id: ${{ github.event.workflow_run.id }}
@@ -48,14 +48,14 @@ jobs:
4848
path: ./pr.txt
4949

5050
- name: Download Size Data
51-
uses: dawidd6/action-download-artifact@v2
51+
uses: dawidd6/action-download-artifact@v3
5252
with:
5353
name: size-data
5454
run_id: ${{ github.event.workflow_run.id }}
5555
path: temp/size
5656

5757
- name: Download Previous Size Data
58-
uses: dawidd6/action-download-artifact@v2
58+
uses: dawidd6/action-download-artifact@v3
5959
with:
6060
branch: main
6161
workflow: size-data.yml

CHANGELOG.md

+43
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
## [3.4.18](https://github.com/vuejs/core/compare/v3.4.17...v3.4.18) (2024-02-09)
2+
3+
4+
### Bug Fixes
5+
6+
* **dx:** warn against reserved keys as prop name ([77a804b](https://github.com/vuejs/core/commit/77a804b1d0d6a3f12fb3674cdceb85ebd6481e02)), closes [#10281](https://github.com/vuejs/core/issues/10281)
7+
* **runtime-dom:** ensure v-show respects display value set via v-bind ([#10297](https://github.com/vuejs/core/issues/10297)) ([c224897](https://github.com/vuejs/core/commit/c224897dd4e189a10ec601a97fe08cb638ebee19)), closes [#10151](https://github.com/vuejs/core/issues/10151)
8+
9+
10+
11+
## [3.4.17](https://github.com/vuejs/core/compare/v3.4.16...v3.4.17) (2024-02-09)
12+
13+
14+
### Reverts
15+
16+
* fix(runtime-dom): ensure v-show respects display value set via v-bind ([#10161](https://github.com/vuejs/core/issues/10161)) ([2cd5b05](https://github.com/vuejs/core/commit/2cd5b05c3bf171be5c0b473c084c01704a058ffa)), closes [#10294](https://github.com/vuejs/core/issues/10294) [#10151](https://github.com/vuejs/core/issues/10151)
17+
18+
19+
20+
## [3.4.16](https://github.com/vuejs/core/compare/v3.4.15...v3.4.16) (2024-02-08)
21+
22+
23+
### Bug Fixes
24+
25+
* **compiler-core:** handle same-name shorthand edge case for in-DOM templates ([cb87b62](https://github.com/vuejs/core/commit/cb87b6213d7b003fa7280712c285c7c9d9f291ca)), closes [#10280](https://github.com/vuejs/core/issues/10280)
26+
* **compiler-core:** support v-bind shorthand syntax for dynamic slot name ([#10218](https://github.com/vuejs/core/issues/10218)) ([91f058a](https://github.com/vuejs/core/commit/91f058a90cd603492649633d153b120977c4df6b)), closes [#10213](https://github.com/vuejs/core/issues/10213)
27+
* **deps:** update compiler ([#10269](https://github.com/vuejs/core/issues/10269)) ([336bb65](https://github.com/vuejs/core/commit/336bb65820243006efdf990e6ea3610696467508))
28+
* **hydration:** fix SFC style v-bind hydration mismatch warnings ([#10250](https://github.com/vuejs/core/issues/10250)) ([f0b5f7e](https://github.com/vuejs/core/commit/f0b5f7ed8ddf74f9f5ba47cb65e8300370875291)), closes [#10215](https://github.com/vuejs/core/issues/10215)
29+
* **reactivity:** avoid infinite recursion from side effects in computed getter ([#10232](https://github.com/vuejs/core/issues/10232)) ([0bced13](https://github.com/vuejs/core/commit/0bced13ee5c53a02d5f10e5db76fe38b6e131440)), closes [#10214](https://github.com/vuejs/core/issues/10214)
30+
* **reactivity:** handle `MaybeDirty` recurse ([#10187](https://github.com/vuejs/core/issues/10187)) ([6c7e0bd](https://github.com/vuejs/core/commit/6c7e0bd88f021b0b6365370e97b0c7e243d7d70b)), closes [#10185](https://github.com/vuejs/core/issues/10185)
31+
* **reactivity:** skip non-extensible objects when using `markRaw` ([#10289](https://github.com/vuejs/core/issues/10289)) ([2312184](https://github.com/vuejs/core/commit/2312184bc335e0d32aa4c0c0b49190b6334849b4)), closes [#10288](https://github.com/vuejs/core/issues/10288)
32+
* **runtime-core:** avoid inlining isShallow ([#10238](https://github.com/vuejs/core/issues/10238)) ([53eee72](https://github.com/vuejs/core/commit/53eee72c3a96420db35236b5e8e4d9308a56e1b4))
33+
* **runtime-core:** support for nested calls to runWithContext ([#10261](https://github.com/vuejs/core/issues/10261)) ([75e02b5](https://github.com/vuejs/core/commit/75e02b5099a08166bdf407127916734c48209ee9)), closes [#10260](https://github.com/vuejs/core/issues/10260)
34+
* **runtime-dom:** ensure v-show respects display value set via v-bind ([#10161](https://github.com/vuejs/core/issues/10161)) ([9b19f09](https://github.com/vuejs/core/commit/9b19f0912104bfccb10c8cf5beab02b21a648935)), closes [#10151](https://github.com/vuejs/core/issues/10151)
35+
* **runtime-dom:** fix option selected update failed ([#10200](https://github.com/vuejs/core/issues/10200)) ([f31d782](https://github.com/vuejs/core/commit/f31d782e4668050a188ac0f11ba8d5b861b913ca)), closes [#10194](https://github.com/vuejs/core/issues/10194) [#10267](https://github.com/vuejs/core/issues/10267)
36+
37+
38+
### Reverts
39+
40+
* perf(templateRef): avoid double render when using template ref on v-for ([eb1b911](https://github.com/vuejs/core/commit/eb1b9116d7cd4a5747e8dadcdc5ba921df011f64)), closes [#9908](https://github.com/vuejs/core/issues/9908) [#10210](https://github.com/vuejs/core/issues/10210) [#10234](https://github.com/vuejs/core/issues/10234)
41+
42+
43+
144
## [3.4.15](https://github.com/vuejs/core/compare/v3.4.14...v3.4.15) (2024-01-18)
245

346

packages/compiler-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

packages/compiler-core/src/errors.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export enum ErrorCodes {
7878
X_V_FOR_MALFORMED_EXPRESSION,
7979
X_V_FOR_TEMPLATE_KEY_PLACEMENT,
8080
X_V_BIND_NO_EXPRESSION,
81-
X_V_BIND_INVALID_SAME_NAME_ARGUMENT,
8281
X_V_ON_NO_EXPRESSION,
8382
X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET,
8483
X_V_SLOT_MIXED_SLOT_USAGE,
@@ -99,6 +98,10 @@ export enum ErrorCodes {
9998
X_SCOPE_ID_NOT_SUPPORTED,
10099
X_VNODE_HOOKS,
101100

101+
// placed here to preserve order for the current minor
102+
// TODO adjust order in 3.5
103+
X_V_BIND_INVALID_SAME_NAME_ARGUMENT,
104+
102105
// Special value for higher-order compilers to pick up the last code
103106
// to avoid collision of error codes. This should always be kept as the last
104107
// item.

packages/compiler-dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-sfc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-sfc",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/compiler-sfc",
55
"main": "dist/compiler-sfc.cjs.js",
66
"module": "dist/compiler-sfc.esm-browser.js",

packages/compiler-ssr/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-ssr",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/compiler-ssr",
55
"main": "dist/compiler-ssr.cjs.js",
66
"types": "dist/compiler-ssr.d.ts",

packages/reactivity/__tests__/reactive.spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ describe('reactivity/reactive', () => {
277277
expect(isReactive(obj.bar)).toBe(false)
278278
})
279279

280+
test('markRaw should skip non-extensible objects', () => {
281+
const obj = Object.seal({ foo: 1 })
282+
expect(() => markRaw(obj)).not.toThrowError()
283+
})
284+
280285
test('should not observe non-extensible objects', () => {
281286
const obj = reactive({
282287
foo: Object.preventExtensions({ a: 1 }),

packages/reactivity/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/reactivity",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/reactivity",
55
"main": "index.js",
66
"module": "dist/reactivity.esm-bundler.js",

packages/reactivity/src/reactive.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ export type Raw<T> = T & { [RawSymbol]?: true }
385385
* @see {@link https://vuejs.org/api/reactivity-advanced.html#markraw}
386386
*/
387387
export function markRaw<T extends object>(value: T): Raw<T> {
388-
def(value, ReactiveFlags.SKIP, true)
388+
if (Object.isExtensible(value)) {
389+
def(value, ReactiveFlags.SKIP, true)
390+
}
389391
return value
390392
}
391393

packages/runtime-core/__tests__/componentProps.spec.ts

+19
Original file line numberDiff line numberDiff line change
@@ -729,4 +729,23 @@ describe('component props', () => {
729729

730730
expect(Object.keys(props.msg).length).toBe(1)
731731
})
732+
733+
test('should warn against reserved prop names', () => {
734+
const Comp = defineComponent({
735+
props: {
736+
key: String,
737+
ref: String,
738+
$foo: String,
739+
},
740+
render() {},
741+
})
742+
743+
const root = nodeOps.createElement('div')
744+
745+
render(h(Comp, { msg: 'test' }), root)
746+
747+
expect(`Invalid prop name: "key"`).toHaveBeenWarned()
748+
expect(`Invalid prop name: "ref"`).toHaveBeenWarned()
749+
expect(`Invalid prop name: "$foo"`).toHaveBeenWarned()
750+
})
732751
})

packages/runtime-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/runtime-core",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/runtime-core",
55
"main": "index.js",
66
"module": "dist/runtime-core.esm-bundler.js",

packages/runtime-core/src/componentProps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ export function normalizePropsOptions(
586586
}
587587

588588
function validatePropName(key: string) {
589-
if (key[0] !== '$') {
589+
if (key[0] !== '$' && !isReservedProp(key)) {
590590
return true
591591
} else if (__DEV__) {
592592
warn(`Invalid prop name: "${key}" is a reserved property.`)

packages/runtime-dom/__tests__/directives/vShow.spec.ts

+33
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,37 @@ describe('runtime-dom: v-show directive', () => {
276276
await nextTick()
277277
expect($div.style.display).toEqual('')
278278
})
279+
280+
// #10294
281+
test('should record display by vShowOldKey only when display exists in style', async () => {
282+
const isVisible = ref(false)
283+
const style = ref({
284+
margin: '10px',
285+
})
286+
287+
const Component = {
288+
setup() {
289+
return () => {
290+
return withVShow(
291+
h('div', {
292+
style: style.value,
293+
}),
294+
isVisible.value,
295+
)
296+
}
297+
},
298+
}
299+
render(h(Component), root)
300+
const $div = root.children[0]
301+
302+
expect($div.style.display).toEqual('none')
303+
304+
style.value.margin = '20px'
305+
await nextTick()
306+
expect($div.style.display).toEqual('none')
307+
308+
isVisible.value = true
309+
await nextTick()
310+
expect($div.style.display).toEqual('')
311+
})
279312
})

packages/runtime-dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/runtime-dom",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/runtime-dom",
55
"main": "index.js",
66
"module": "dist/runtime-dom.esm-bundler.js",

packages/runtime-dom/src/modules/style.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { CSS_VAR_TEXT } from '../helpers/useCssVars'
55

66
type Style = string | Record<string, string | string[]> | null
77

8+
const displayRE = /(^|;)\s*display\s*:/
9+
810
export function patchStyle(el: Element, prev: Style, next: Style) {
911
const style = (el as HTMLElement).style
10-
const currentDisplay = style.display
1112
const isCssString = isString(next)
13+
const currentDisplay = style.display
14+
let hasControlledDisplay = false
1215
if (next && !isCssString) {
1316
if (prev && !isString(prev)) {
1417
for (const key in prev) {
@@ -18,6 +21,9 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
1821
}
1922
}
2023
for (const key in next) {
24+
if (key === 'display') {
25+
hasControlledDisplay = true
26+
}
2127
setStyle(style, key, next[key])
2228
}
2329
} else {
@@ -29,6 +35,7 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
2935
;(next as string) += ';' + cssVarText
3036
}
3137
style.cssText = next as string
38+
hasControlledDisplay = displayRE.test(next)
3239
}
3340
} else if (prev) {
3441
el.removeAttribute('style')
@@ -38,7 +45,7 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
3845
// so we always keep the current `display` value regardless of the `style`
3946
// value, thus handing over control to `v-show`.
4047
if (vShowOldKey in el) {
41-
el[vShowOldKey] = style.display
48+
el[vShowOldKey] = hasControlledDisplay ? style.display : ''
4249
style.display = currentDisplay
4350
}
4451
}

packages/server-renderer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/server-renderer",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "@vue/server-renderer",
55
"main": "index.js",
66
"module": "dist/server-renderer.esm-bundler.js",

packages/shared/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/shared",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "internal utils shared across @vue packages",
55
"main": "index.js",
66
"module": "dist/shared.esm-bundler.js",

packages/vue-compat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compat",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "Vue 3 compatibility build for Vue 2",
55
"main": "index.js",
66
"module": "dist/vue.runtime.esm-bundler.js",

packages/vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "3.4.15",
3+
"version": "3.4.18",
44
"description": "The progressive JavaScript framework for building modern web UI.",
55
"main": "index.js",
66
"module": "dist/vue.runtime.esm-bundler.js",

scripts/setup-vitest.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ vi.stubGlobal('MathMLElement', class MathMLElement {})
44

55
expect.extend({
66
toHaveBeenWarned(received: string) {
7-
asserted.add(received)
87
const passed = warn.mock.calls.some(args => args[0].includes(received))
98
if (passed) {
9+
asserted.add(received)
1010
return {
1111
pass: true,
1212
message: () => `expected "${received}" not to have been warned.`,
@@ -25,10 +25,10 @@ expect.extend({
2525
},
2626

2727
toHaveBeenWarnedLast(received: string) {
28-
asserted.add(received)
2928
const passed =
3029
warn.mock.calls[warn.mock.calls.length - 1][0].includes(received)
3130
if (passed) {
31+
asserted.add(received)
3232
return {
3333
pass: true,
3434
message: () => `expected "${received}" not to have been warned last.`,
@@ -44,7 +44,6 @@ expect.extend({
4444
},
4545

4646
toHaveBeenWarnedTimes(received: string, n: number) {
47-
asserted.add(received)
4847
let found = 0
4948
warn.mock.calls.forEach(args => {
5049
if (args[0].includes(received)) {
@@ -53,6 +52,7 @@ expect.extend({
5352
})
5453

5554
if (found === n) {
55+
asserted.add(received)
5656
return {
5757
pass: true,
5858
message: () => `expected "${received}" to have been warned ${n} times.`,

0 commit comments

Comments
 (0)