From d1764a142abada80283ec1134bad193c5622557a Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 22 Sep 2024 11:24:10 +0800 Subject: [PATCH 001/101] test: simplify computed last sub test case --- packages/reactivity/__tests__/computed.spec.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/reactivity/__tests__/computed.spec.ts b/packages/reactivity/__tests__/computed.spec.ts index 90987e867..873fd1161 100644 --- a/packages/reactivity/__tests__/computed.spec.ts +++ b/packages/reactivity/__tests__/computed.spec.ts @@ -1013,16 +1013,9 @@ describe('reactivity/computed', () => { }) test('computed should remain live after losing all subscribers', () => { - const toggle = ref(true) - const state = reactive({ - a: 1, - }) + const state = reactive({ a: 1 }) const p = computed(() => state.a + 1) - const pp = computed(() => { - return toggle.value ? p.value : 111 - }) - - const { effect: e } = effect(() => pp.value) + const { effect: e } = effect(() => p.value) e.stop() expect(p.value).toBe(2) From 0267a588017eee4951ac2a877fe1ccae84cad905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 22 Sep 2024 05:49:35 +0200 Subject: [PATCH 002/101] fix(reactivity): do not remove dep from depsMap when cleaning up deps of computed (#11995) --- packages/reactivity/__tests__/computed.spec.ts | 15 +++++++++++++++ packages/reactivity/src/effect.ts | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/reactivity/__tests__/computed.spec.ts b/packages/reactivity/__tests__/computed.spec.ts index 873fd1161..e4a337cb8 100644 --- a/packages/reactivity/__tests__/computed.spec.ts +++ b/packages/reactivity/__tests__/computed.spec.ts @@ -1022,4 +1022,19 @@ describe('reactivity/computed', () => { state.a++ expect(p.value).toBe(3) }) + + test('computed dep cleanup should not cause property dep to be deleted', () => { + const toggle = ref(true) + const state = reactive({ a: 1 }) + const p = computed(() => { + return toggle.value ? state.a : 111 + }) + const pp = computed(() => state.a) + effect(() => p.value) + + expect(pp.value).toBe(1) + toggle.value = false + state.a++ + expect(pp.value).toBe(2) + }) }) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index d0b7c7bd9..20bbada50 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -292,7 +292,7 @@ function prepareDeps(sub: Subscriber) { } } -function cleanupDeps(sub: Subscriber) { +function cleanupDeps(sub: Subscriber, fromComputed = false) { // Cleanup unsued deps let head let tail = sub.depsTail @@ -302,7 +302,7 @@ function cleanupDeps(sub: Subscriber) { if (link.version === -1) { if (link === tail) tail = prev // unused - remove it from the dep's subscribing effect list - removeSub(link) + removeSub(link, fromComputed) // also remove it from this effect's dep list removeDep(link) } else { @@ -394,7 +394,7 @@ export function refreshComputed(computed: ComputedRefImpl): undefined { } finally { activeSub = prevSub shouldTrack = prevShouldTrack - cleanupDeps(computed) + cleanupDeps(computed, true) computed.flags &= ~EffectFlags.RUNNING } } From 5e8898572fa63438b57a4b2b1de01a85dc49655e Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 22 Sep 2024 11:53:14 +0800 Subject: [PATCH 003/101] release: v3.5.8 --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- packages/compiler-core/package.json | 2 +- packages/compiler-dom/package.json | 2 +- packages/compiler-sfc/package.json | 2 +- packages/compiler-ssr/package.json | 2 +- packages/reactivity/package.json | 2 +- packages/runtime-core/package.json | 2 +- packages/runtime-dom/package.json | 2 +- packages/server-renderer/package.json | 2 +- packages/shared/package.json | 2 +- packages/vue-compat/package.json | 2 +- packages/vue/package.json | 2 +- 13 files changed, 21 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0cf53927..b96340860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [3.5.8](https://github.com/vuejs/core/compare/v3.5.7...v3.5.8) (2024-09-22) + + +### Bug Fixes + +* **reactivity:** do not remove dep from depsMap when cleaning up deps of computed ([#11995](https://github.com/vuejs/core/issues/11995)) ([0267a58](https://github.com/vuejs/core/commit/0267a588017eee4951ac2a877fe1ccae84cad905)) + + + ## [3.5.7](https://github.com/vuejs/core/compare/v3.5.6...v3.5.7) (2024-09-20) diff --git a/package.json b/package.json index a47aa79d7..46573eed7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.5.7", + "version": "3.5.8", "packageManager": "pnpm@9.10.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 2faea0d67..b2756de87 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/compiler-core", "main": "index.js", "module": "dist/compiler-core.esm-bundler.js", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index 001b63fcd..9966f34fc 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/compiler-dom", "main": "index.js", "module": "dist/compiler-dom.esm-bundler.js", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index ddbe932df..26e75caea 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index 8c008d2f8..daf2bbefe 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index 86bf037f4..000f8e0ee 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 40744ffbf..fb15f49da 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 2a3269e06..049b5c113 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 3911a1838..77e5a9aeb 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.7", + "version": "3.5.8", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index 109094a23..42ad47231 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.7", + "version": "3.5.8", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index ae5d55685..5a00a19f4 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.7", + "version": "3.5.8", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index 694d36489..77802db96 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.7", + "version": "3.5.8", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From a177092754642af2f98c33a4feffe8f198c3c950 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 23 Sep 2024 08:38:24 +0800 Subject: [PATCH 004/101] fix(runtime-core): make useId() always return a string --- packages/runtime-core/src/helpers/useId.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/helpers/useId.ts b/packages/runtime-core/src/helpers/useId.ts index f7a2b5fc3..4b51e0dda 100644 --- a/packages/runtime-core/src/helpers/useId.ts +++ b/packages/runtime-core/src/helpers/useId.ts @@ -4,7 +4,7 @@ import { } from '../component' import { warn } from '../warning' -export function useId(): string | undefined { +export function useId(): string { const i = getCurrentInstance() if (i) { return (i.appContext.config.idPrefix || 'v') + '-' + i.ids[0] + i.ids[1]++ @@ -14,6 +14,7 @@ export function useId(): string | undefined { `instance to be associated with.`, ) } + return '' } /** From 5d9e81d3da38b04549ff33b7004201c3ce83d274 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 24 Sep 2024 18:00:39 +0800 Subject: [PATCH 005/101] chore(types): disambiguate the `Comment` type in hydration.ts (#12009) --- packages/runtime-core/src/hydration.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 3cde4377e..82972e171 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -1,8 +1,8 @@ import { - Comment, Fragment, Static, Text, + Comment as VComment, type VNode, type VNodeHook, createTextVNode, @@ -195,7 +195,7 @@ export function createHydrationFunctions( nextNode = nextSibling(node) } break - case Comment: + case VComment: if (isTemplateNode(node)) { nextNode = nextSibling(node) // wrapped From 7a00f6f0931cec7a33cbd69881df5f10856591c3 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Tue, 24 Sep 2024 18:01:20 +0800 Subject: [PATCH 006/101] chore: remove unused argument (#12006) --- packages/runtime-dom/src/directives/vModel.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts index b3d127fbe..5a27b245a 100644 --- a/packages/runtime-dom/src/directives/vModel.ts +++ b/packages/runtime-dom/src/directives/vModel.ts @@ -160,7 +160,7 @@ export const vModelCheckbox: ModelDirective = { function setChecked( el: HTMLInputElement, - { value, oldValue }: DirectiveBinding, + { value }: DirectiveBinding, vnode: VNode, ) { // store the v-model value on the element so it can be accessed by the @@ -225,20 +225,20 @@ export const vModelSelect: ModelDirective = { }, // set value in mounted & updated because with // :true-value & :false-value @@ -128,14 +140,5 @@ function shouldSetAsProp( return false } - if (key in el) { - return true - } - - // #11081 force set props for possible async custom element - if ((el as VueElement)._isVueCE && (/[A-Z]/.test(key) || !isString(value))) { - return true - } - - return false + return key in el } From e2c19c20cfee9788519a80c0e53e216b78505994 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 27 Sep 2024 10:23:01 +0800 Subject: [PATCH 017/101] fix(types/ref): handle nested refs in UnwrapRef (#12049) close #12044 --- packages-private/dts-test/ref.test-d.ts | 18 ++++++++++++++++++ packages/reactivity/src/ref.ts | 8 +++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/packages-private/dts-test/ref.test-d.ts b/packages-private/dts-test/ref.test-d.ts index 929e3d1a1..89b80a70f 100644 --- a/packages-private/dts-test/ref.test-d.ts +++ b/packages-private/dts-test/ref.test-d.ts @@ -189,6 +189,24 @@ describe('allow getter and setter types to be unrelated', () => { f.value = ref(1) }) +describe('correctly unwraps nested refs', () => { + const obj = { + n: 24, + ref: ref(24), + nestedRef: ref({ n: ref(0) }), + } + + const a = ref(obj) + expectType(a.value.n) + expectType(a.value.ref) + expectType(a.value.nestedRef.n) + + const b = reactive({ a }) + expectType(b.a.n) + expectType(b.a.ref) + expectType(b.a.nestedRef.n) +}) + // computed describe('allow computed getter and setter types to be unrelated', () => { const obj = ref({ diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 1de8b9e33..43b26b78f 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -62,7 +62,9 @@ export function ref(value?: unknown) { declare const ShallowRefMarker: unique symbol -export type ShallowRef = Ref & { [ShallowRefMarker]?: true } +export type ShallowRef = Ref & { + [ShallowRefMarker]?: true +} /** * Shallow version of {@link ref()}. @@ -490,9 +492,9 @@ export type ShallowUnwrapRef = { type DistributeRef = T extends Ref ? V : T export type UnwrapRef = - T extends ShallowRef + T extends ShallowRef ? V - : T extends Ref + : T extends Ref ? UnwrapRefSimple : UnwrapRefSimple From 60c2029f777e0db801c66fceee5c367c9d2e34a3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 27 Sep 2024 11:06:34 +0800 Subject: [PATCH 018/101] test: add test case for #11928 --- .../reactivity/__tests__/computed.spec.ts | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/packages/reactivity/__tests__/computed.spec.ts b/packages/reactivity/__tests__/computed.spec.ts index 8e9b048e6..36c477adb 100644 --- a/packages/reactivity/__tests__/computed.spec.ts +++ b/packages/reactivity/__tests__/computed.spec.ts @@ -1057,4 +1057,54 @@ describe('reactivity/computed', () => { obj.flag = 1 expect(foo).toBe(2) }) + + // #11928 + test('should not lead to exponential perf cost with deeply chained computed', () => { + const start = { + prop1: shallowRef(1), + prop2: shallowRef(2), + prop3: shallowRef(3), + prop4: shallowRef(4), + } + + let layer = start + + const LAYERS = 1000 + + for (let i = LAYERS; i > 0; i--) { + const m = layer + const s = { + prop1: computed(() => m.prop2.value), + prop2: computed(() => m.prop1.value - m.prop3.value), + prop3: computed(() => m.prop2.value + m.prop4.value), + prop4: computed(() => m.prop3.value), + } + effect(() => s.prop1.value) + effect(() => s.prop2.value) + effect(() => s.prop3.value) + effect(() => s.prop4.value) + + s.prop1.value + s.prop2.value + s.prop3.value + s.prop4.value + + layer = s + } + + const t = performance.now() + start.prop1.value = 4 + start.prop2.value = 3 + start.prop3.value = 2 + start.prop4.value = 1 + expect(performance.now() - t).toBeLessThan(process.env.CI ? 100 : 30) + + const end = layer + expect([ + end.prop1.value, + end.prop2.value, + end.prop3.value, + end.prop4.value, + ]).toMatchObject([-2, -4, 2, 3]) + }) }) From aa9ef2386a0cd39a174e5a887ec2b1a3525034fc Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 27 Sep 2024 11:22:36 +0800 Subject: [PATCH 019/101] fix(reactivity): only clear notified flags for computed in first batch iteration close #12045 --- packages/reactivity/src/computed.ts | 6 +++- packages/reactivity/src/effect.ts | 9 +++++- .../runtime-core/__tests__/apiWatch.spec.ts | 28 ++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/packages/reactivity/src/computed.ts b/packages/reactivity/src/computed.ts index b16b011c5..628cf4636 100644 --- a/packages/reactivity/src/computed.ts +++ b/packages/reactivity/src/computed.ts @@ -84,9 +84,13 @@ export class ComputedRefImpl implements Subscriber { * @internal */ isSSR: boolean + /** + * @internal + */ + next?: Subscriber = undefined + // for backwards compat effect: this = this - // dev only onTrack?: (event: DebuggerEvent) => void // dev only diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index 15693ee39..b32355081 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -261,13 +261,20 @@ export function endBatch(): void { while (batchedSub) { let e: Subscriber | undefined = batchedSub let next: Subscriber | undefined + // 1st pass: clear notified flags for computed upfront + // we use the ACTIVE flag as a discriminator between computed and effect, + // since NOTIFIED is useless for an inactive effect anyway. while (e) { - e.flags &= ~EffectFlags.NOTIFIED + if (!(e.flags & EffectFlags.ACTIVE)) { + e.flags &= ~EffectFlags.NOTIFIED + } e = e.next } e = batchedSub batchedSub = undefined + // 2nd pass: run effects while (e) { + e.flags &= ~EffectFlags.NOTIFIED if (e.flags & EffectFlags.ACTIVE) { try { // ACTIVE flag is effect-only diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index 082d585b8..10a4fe659 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -1930,7 +1930,7 @@ describe('api: watch', () => { warn.mockRestore() }) - it('should be executed correctly', () => { + test('should be executed correctly', () => { const v = ref(1) let foo = '' @@ -1957,4 +1957,30 @@ describe('api: watch', () => { v.value++ expect(foo).toBe('12') }) + + // 12045 + test('sync watcher should not break pre watchers', async () => { + const count1 = ref(0) + const count2 = ref(0) + + watch( + count1, + () => { + count2.value++ + }, + { flush: 'sync' }, + ) + + const spy1 = vi.fn() + watch([count1, count2], spy1) + + const spy2 = vi.fn() + watch(count1, spy2) + + count1.value++ + + await nextTick() + expect(spy1).toHaveBeenCalled() + expect(spy2).toHaveBeenCalled() + }) }) From 93c95dd4cd416503f43a98a1455f62658d22b0b2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 27 Sep 2024 23:10:11 +0800 Subject: [PATCH 020/101] fix(reactivity): fix nested batch edge case --- packages/reactivity/__tests__/watch.spec.ts | 31 +++++++++++++++++++++ packages/reactivity/src/effect.ts | 4 +-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/reactivity/__tests__/watch.spec.ts b/packages/reactivity/__tests__/watch.spec.ts index f333d7c06..882e8a245 100644 --- a/packages/reactivity/__tests__/watch.spec.ts +++ b/packages/reactivity/__tests__/watch.spec.ts @@ -229,4 +229,35 @@ describe('watch', () => { expect(r.value).toBe(1) expect(c.value).toBe(1) }) + + // edge case where a nested endBatch() causes an effect to be batched in a + // nested batch loop with its .next mutated, causing the outer loop to end + // early + test('nested batch edge case', () => { + // useClamp from VueUse + const clamp = (n: number, min: number, max: number) => + Math.min(max, Math.max(min, n)) + function useClamp(src: Ref, min: number, max: number) { + return computed({ + get() { + return (src.value = clamp(src.value, min, max)) + }, + set(val) { + src.value = clamp(val, min, max) + }, + }) + } + + const src = ref(1) + const clamped = useClamp(src, 1, 5) + watch(src, val => (clamped.value = val)) + + const spy = vi.fn() + watch(clamped, spy) + + src.value = 2 + expect(spy).toHaveBeenCalledTimes(1) + src.value = 10 + expect(spy).toHaveBeenCalledTimes(2) + }) }) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index b32355081..dad800d14 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -274,6 +274,8 @@ export function endBatch(): void { batchedSub = undefined // 2nd pass: run effects while (e) { + next = e.next + e.next = undefined e.flags &= ~EffectFlags.NOTIFIED if (e.flags & EffectFlags.ACTIVE) { try { @@ -283,8 +285,6 @@ export function endBatch(): void { if (!error) error = err } } - next = e.next - e.next = undefined e = next } } From 4b09ab2074e7bafed5ded653bc81b700726bd1fb Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 27 Sep 2024 23:16:33 +0800 Subject: [PATCH 021/101] release: v3.5.10 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- packages/compiler-core/package.json | 2 +- packages/compiler-dom/package.json | 2 +- packages/compiler-sfc/package.json | 2 +- packages/compiler-ssr/package.json | 2 +- packages/reactivity/package.json | 2 +- packages/runtime-core/package.json | 2 +- packages/runtime-dom/package.json | 2 +- packages/server-renderer/package.json | 2 +- packages/shared/package.json | 2 +- packages/vue-compat/package.json | 2 +- packages/vue/package.json | 2 +- 13 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 344c5766a..eaf07a8d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [3.5.10](https://github.com/vuejs/core/compare/v3.5.9...v3.5.10) (2024-09-27) + + +### Bug Fixes + +* **custom-element:** properly set kebab-case props on Vue custom elements ([ea3efa0](https://github.com/vuejs/core/commit/ea3efa09e008918c1d9ba7226833a8b1a7a57244)), closes [#12030](https://github.com/vuejs/core/issues/12030) [#12032](https://github.com/vuejs/core/issues/12032) +* **reactivity:** fix nested batch edge case ([93c95dd](https://github.com/vuejs/core/commit/93c95dd4cd416503f43a98a1455f62658d22b0b2)) +* **reactivity:** only clear notified flags for computed in first batch iteration ([aa9ef23](https://github.com/vuejs/core/commit/aa9ef2386a0cd39a174e5a887ec2b1a3525034fc)), closes [#12045](https://github.com/vuejs/core/issues/12045) +* **types/ref:** handle nested refs in UnwrapRef ([#12049](https://github.com/vuejs/core/issues/12049)) ([e2c19c2](https://github.com/vuejs/core/commit/e2c19c20cfee9788519a80c0e53e216b78505994)), closes [#12044](https://github.com/vuejs/core/issues/12044) + + + ## [3.5.9](https://github.com/vuejs/core/compare/v3.5.8...v3.5.9) (2024-09-26) diff --git a/package.json b/package.json index 0551e34aa..f958d2521 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.5.9", + "version": "3.5.10", "packageManager": "pnpm@9.10.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 1ba0cf151..69458ec96 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/compiler-core", "main": "index.js", "module": "dist/compiler-core.esm-bundler.js", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index d4ad4adb6..2034e4800 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/compiler-dom", "main": "index.js", "module": "dist/compiler-dom.esm-bundler.js", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index d0e8e44f7..2487f621f 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index 563e8c8fe..b5f91635b 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index 5f0ec6add..7d5bf4b69 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 68460ff59..350b8b086 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index eb4e703b6..6dfb2d6a9 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 505bf97e9..36fb68c11 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.9", + "version": "3.5.10", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index 54c4fe032..f10dc1c5e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.9", + "version": "3.5.10", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index 80d0583a7..adb0b6280 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.9", + "version": "3.5.10", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index 4605bb4ec..c73e89334 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.9", + "version": "3.5.10", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From 2328b051f4efa1f1394b7d4e73b7c3f76e430e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Sat, 28 Sep 2024 09:56:09 +0800 Subject: [PATCH 022/101] fix(compiler-sfc): do not skip `TSSatisfiesExpression` when transforming props destructure (#12062) close #12061 --- packages/compiler-sfc/src/script/definePropsDestructure.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/compiler-sfc/src/script/definePropsDestructure.ts b/packages/compiler-sfc/src/script/definePropsDestructure.ts index 341b537d8..f9a56e32e 100644 --- a/packages/compiler-sfc/src/script/definePropsDestructure.ts +++ b/packages/compiler-sfc/src/script/definePropsDestructure.ts @@ -242,6 +242,7 @@ export function transformDestructuredProps( parent.type.startsWith('TS') && parent.type !== 'TSAsExpression' && parent.type !== 'TSNonNullExpression' && + parent.type !== 'TSSatisfiesExpression' && parent.type !== 'TSTypeAssertion' ) { return this.skip() From 29de6f8b0bb1a604f247b0712daac29e93aa6f3e Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 28 Sep 2024 19:24:55 +0800 Subject: [PATCH 023/101] chore: remove no longer used property on Dep --- packages/reactivity/src/dep.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/reactivity/src/dep.ts b/packages/reactivity/src/dep.ts index e7e9672dc..7e4048743 100644 --- a/packages/reactivity/src/dep.ts +++ b/packages/reactivity/src/dep.ts @@ -85,7 +85,6 @@ export class Dep { /** * For object property deps cleanup */ - target?: unknown = undefined map?: KeyToDepMap = undefined key?: unknown = undefined @@ -263,7 +262,6 @@ export function track(target: object, type: TrackOpTypes, key: unknown): void { let dep = depsMap.get(key) if (!dep) { depsMap.set(key, (dep = new Dep())) - dep.target = target dep.map = depsMap dep.key = key } From 126ce65d7db7747c5e346323112dc89d73d22f36 Mon Sep 17 00:00:00 2001 From: Doctor Wu Date: Mon, 30 Sep 2024 18:57:27 +0800 Subject: [PATCH 024/101] chore(benchmark): fix conflict args (#282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kevin Deng 三咲智子 --- benchmark/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/index.js b/benchmark/index.js index 2332761ec..884459c91 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -29,7 +29,7 @@ const { options: { skipLib: { type: 'boolean', - short: 'v', + short: 'l', }, skipApp: { type: 'boolean', From d3f5e6e5319b4ffaa55ca9a2ea3d95d78e76fa58 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 3 Oct 2024 23:16:52 +0800 Subject: [PATCH 025/101] fix(reactivity): prevent overwriting `next` property during batch processing (#12075) close #12072 --- packages/reactivity/__tests__/watch.spec.ts | 17 +++++++++++ packages/reactivity/src/computed.ts | 2 +- packages/reactivity/src/effect.ts | 33 ++++++++++++--------- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/packages/reactivity/__tests__/watch.spec.ts b/packages/reactivity/__tests__/watch.spec.ts index 882e8a245..245acfd63 100644 --- a/packages/reactivity/__tests__/watch.spec.ts +++ b/packages/reactivity/__tests__/watch.spec.ts @@ -260,4 +260,21 @@ describe('watch', () => { src.value = 10 expect(spy).toHaveBeenCalledTimes(2) }) + + test('should ensure correct execution order in batch processing', () => { + const dummy: number[] = [] + const n1 = ref(0) + const n2 = ref(0) + const sum = computed(() => n1.value + n2.value) + watch(n1, () => { + dummy.push(1) + n2.value++ + }) + watch(sum, () => dummy.push(2)) + watch(n1, () => dummy.push(3)) + + n1.value++ + + expect(dummy).toEqual([1, 2, 3]) + }) }) diff --git a/packages/reactivity/src/computed.ts b/packages/reactivity/src/computed.ts index 628cf4636..ea798e201 100644 --- a/packages/reactivity/src/computed.ts +++ b/packages/reactivity/src/computed.ts @@ -121,7 +121,7 @@ export class ComputedRefImpl implements Subscriber { // avoid infinite self recursion activeSub !== this ) { - batch(this) + batch(this, true) return true } else if (__DEV__) { // TODO warn diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index dad800d14..243518839 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -234,9 +234,15 @@ export class ReactiveEffect let batchDepth = 0 let batchedSub: Subscriber | undefined +let batchedComputed: Subscriber | undefined -export function batch(sub: Subscriber): void { +export function batch(sub: Subscriber, isComputed = false): void { sub.flags |= EffectFlags.NOTIFIED + if (isComputed) { + sub.next = batchedComputed + batchedComputed = sub + return + } sub.next = batchedSub batchedSub = sub } @@ -257,24 +263,23 @@ export function endBatch(): void { return } + if (batchedComputed) { + let e: Subscriber | undefined = batchedComputed + batchedComputed = undefined + while (e) { + const next: Subscriber | undefined = e.next + e.next = undefined + e.flags &= ~EffectFlags.NOTIFIED + e = next + } + } + let error: unknown while (batchedSub) { let e: Subscriber | undefined = batchedSub - let next: Subscriber | undefined - // 1st pass: clear notified flags for computed upfront - // we use the ACTIVE flag as a discriminator between computed and effect, - // since NOTIFIED is useless for an inactive effect anyway. - while (e) { - if (!(e.flags & EffectFlags.ACTIVE)) { - e.flags &= ~EffectFlags.NOTIFIED - } - e = e.next - } - e = batchedSub batchedSub = undefined - // 2nd pass: run effects while (e) { - next = e.next + const next: Subscriber | undefined = e.next e.next = undefined e.flags &= ~EffectFlags.NOTIFIED if (e.flags & EffectFlags.ACTIVE) { From 435e4fefad0df3a79a077d4b9a985af6ce830d70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:17:22 +0800 Subject: [PATCH 026/101] chore(deps): update all non-major dependencies (#12080) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- packages/compiler-sfc/package.json | 2 +- pnpm-lock.yaml | 135 ++++++++++------------------- 3 files changed, 51 insertions(+), 90 deletions(-) diff --git a/package.json b/package.json index f958d2521..a8c4b440d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "version": "3.5.10", - "packageManager": "pnpm@9.10.0", + "packageManager": "pnpm@9.12.0", "type": "module", "scripts": { "dev": "node scripts/dev.js", @@ -68,7 +68,7 @@ "@rollup/plugin-replace": "5.0.4", "@swc/core": "^1.7.28", "@types/hash-sum": "^1.0.2", - "@types/node": "^20.16.5", + "@types/node": "^20.16.10", "@types/semver": "^7.5.8", "@types/serve-handler": "^6.1.4", "@vitest/coverage-v8": "^2.1.1", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 2487f621f..4390d5097 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -62,6 +62,6 @@ "postcss-modules": "^6.0.0", "postcss-selector-parser": "^6.1.2", "pug": "^3.0.3", - "sass": "^1.78.0" + "sass": "^1.79.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index edcfab249..586fe7e1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,8 +60,8 @@ importers: specifier: ^1.0.2 version: 1.0.2 '@types/node': - specifier: ^20.16.5 - version: 20.16.5 + specifier: ^20.16.10 + version: 20.16.10 '@types/semver': specifier: ^7.5.8 version: 7.5.8 @@ -70,7 +70,7 @@ importers: version: 6.1.4 '@vitest/coverage-v8': specifier: ^2.1.1 - version: 2.1.1(vitest@2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0)) + version: 2.1.1(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -94,7 +94,7 @@ importers: version: 4.2.1(eslint@9.10.0)(typescript@5.6.2) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0)) + version: 0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -175,10 +175,10 @@ importers: version: 8.5.0(eslint@9.10.0)(typescript@5.6.2) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + version: 5.4.0(@types/node@20.16.10)(sass@1.79.4) vitest: specifier: ^2.1.1 - version: 2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0) + version: 2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4) packages-private/dts-built-test: dependencies: @@ -218,10 +218,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.16.5)(sass@1.78.0))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + version: 5.4.0(@types/node@20.16.10)(sass@1.79.4) packages-private/template-explorer: dependencies: @@ -236,10 +236,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: 'catalog:' - version: 5.1.2(vite@5.4.0(@types/node@20.16.5)(sass@1.78.0))(vue@packages+vue) + version: 5.1.2(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + version: 5.4.0(@types/node@20.16.10)(sass@1.79.4) vue: specifier: workspace:* version: link:../../packages/vue @@ -333,8 +333,8 @@ importers: specifier: ^3.0.3 version: 3.0.3 sass: - specifier: ^1.78.0 - version: 1.78.0 + specifier: ^1.79.4 + version: 1.79.4 packages/compiler-ssr: dependencies: @@ -1165,8 +1165,8 @@ packages: '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} - '@types/node@20.16.5': - resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} + '@types/node@20.16.10': + resolution: {integrity: sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1389,10 +1389,6 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - arch@2.2.0: resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==} @@ -1458,10 +1454,6 @@ packages: resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} - binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} - engines: {node: '>=8'} - boxen@7.0.0: resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==} engines: {node: '>=14.16'} @@ -1533,9 +1525,9 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} + chokidar@4.0.1: + resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} + engines: {node: '>= 14.16.0'} chromium-bidi@0.6.5: resolution: {integrity: sha512-RuLrmzYrxSb0s9SgpB+QN5jJucPduZQ/9SIe76MDxYJuecPW5mxMdacJ1f4EtgiV+R0p3sCkznTMvH0MPGFqjA==} @@ -2219,10 +2211,6 @@ packages: is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - is-core-module@2.15.0: resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} engines: {node: '>= 0.4'} @@ -2571,10 +2559,6 @@ packages: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - npm-normalize-package-bin@3.0.1: resolution: {integrity: sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -2881,9 +2865,9 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} + readdirp@4.0.1: + resolution: {integrity: sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==} + engines: {node: '>= 14.16.0'} registry-auth-token@3.3.2: resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==} @@ -2977,8 +2961,8 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass@1.78.0: - resolution: {integrity: sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==} + sass@1.79.4: + resolution: {integrity: sha512-K0QDSNPXgyqO4GZq2HO5Q70TLxTH6cIT59RdoCHMivrC8rqzaTw5ab9prjz9KUN1El4FLXrBXJhik61JR4HcGg==} engines: {node: '>=14.0.0'} hasBin: true @@ -3975,7 +3959,7 @@ snapshots: '@types/hash-sum@1.0.2': {} - '@types/node@20.16.5': + '@types/node@20.16.10': dependencies: undici-types: 6.19.6 @@ -3987,13 +3971,13 @@ snapshots: '@types/serve-handler@6.1.4': dependencies: - '@types/node': 20.16.5 + '@types/node': 20.16.10 '@types/trusted-types@2.0.7': {} '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.16.5 + '@types/node': 20.16.10 optional: true '@typescript-eslint/eslint-plugin@8.5.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0)(typescript@5.6.2))(eslint@9.10.0)(typescript@5.6.2)': @@ -4115,12 +4099,12 @@ snapshots: '@typescript-eslint/types': 8.5.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.16.5)(sass@1.78.0))(vue@packages+vue)': + '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))(vue@packages+vue)': dependencies: - vite: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) vue: link:packages/vue - '@vitest/coverage-v8@2.1.1(vitest@2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0))': + '@vitest/coverage-v8@2.1.1(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -4134,7 +4118,7 @@ snapshots: std-env: 3.7.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0) + vitest: 2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4) transitivePeerDependencies: - supports-color @@ -4145,13 +4129,13 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.5)(sass@1.78.0))': + '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))': dependencies: '@vitest/spy': 2.1.1 estree-walker: 3.0.3 magic-string: 0.30.11 optionalDependencies: - vite: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) '@vitest/pretty-format@2.1.1': dependencies: @@ -4243,11 +4227,6 @@ snapshots: ansi-styles@6.2.1: {} - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - arch@2.2.0: {} arg@5.0.2: {} @@ -4305,8 +4284,6 @@ snapshots: basic-ftp@5.0.5: {} - binary-extensions@2.3.0: {} - boxen@7.0.0: dependencies: ansi-align: 3.0.1 @@ -4387,17 +4364,9 @@ snapshots: check-error@2.1.1: {} - chokidar@3.6.0: + chokidar@4.0.1: dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 + readdirp: 4.0.1 chromium-bidi@0.6.5(devtools-protocol@0.0.1330662): dependencies: @@ -4778,12 +4747,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0)): + eslint-plugin-vitest@0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.10.0)(typescript@5.6.2) eslint: 9.10.0 optionalDependencies: - vitest: 2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0) + vitest: 2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4) transitivePeerDependencies: - supports-color - typescript @@ -5169,10 +5138,6 @@ snapshots: is-arrayish@0.2.1: {} - is-binary-path@2.1.0: - dependencies: - binary-extensions: 2.3.0 - is-core-module@2.15.0: dependencies: hasown: 2.0.2 @@ -5504,8 +5469,6 @@ snapshots: semver: 7.6.3 validate-npm-package-license: 3.0.4 - normalize-path@3.0.0: {} - npm-normalize-package-bin@3.0.1: {} npm-run-all2@6.2.3: @@ -5876,9 +5839,7 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 - readdirp@3.6.0: - dependencies: - picomatch: 2.3.1 + readdirp@4.0.1: {} registry-auth-token@3.3.2: dependencies: @@ -6001,9 +5962,9 @@ snapshots: safer-buffer@2.1.2: {} - sass@1.78.0: + sass@1.79.4: dependencies: - chokidar: 3.6.0 + chokidar: 4.0.1 immutable: 4.3.7 source-map-js: 1.2.1 @@ -6321,12 +6282,12 @@ snapshots: vary@1.1.2: {} - vite-node@2.1.1(@types/node@20.16.5)(sass@1.78.0): + vite-node@2.1.1(@types/node@20.16.10)(sass@1.79.4): dependencies: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 - vite: 5.4.0(@types/node@20.16.5)(sass@1.78.0) + vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) transitivePeerDependencies: - '@types/node' - less @@ -6338,20 +6299,20 @@ snapshots: - supports-color - terser - vite@5.4.0(@types/node@20.16.5)(sass@1.78.0): + vite@5.4.0(@types/node@20.16.10)(sass@1.79.4): dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.20.0 optionalDependencies: - '@types/node': 20.16.5 + '@types/node': 20.16.10 fsevents: 2.3.3 - sass: 1.78.0 + sass: 1.79.4 - vitest@2.1.1(@types/node@20.16.5)(jsdom@25.0.0)(sass@1.78.0): + vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4): dependencies: '@vitest/expect': 2.1.1 - '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.5)(sass@1.78.0)) + '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4)) '@vitest/pretty-format': 2.1.1 '@vitest/runner': 2.1.1 '@vitest/snapshot': 2.1.1 @@ -6366,11 +6327,11 @@ snapshots: tinyexec: 0.3.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.16.5)(sass@1.78.0) - vite-node: 2.1.1(@types/node@20.16.5)(sass@1.78.0) + vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) + vite-node: 2.1.1(@types/node@20.16.10)(sass@1.79.4) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.16.5 + '@types/node': 20.16.10 jsdom: 25.0.0 transitivePeerDependencies: - less From 3a55c3e4217ffcac394c7d9c5eab5d7224b217a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:17:36 +0800 Subject: [PATCH 027/101] chore(deps): update dependency rollup to ^4.24.0 (#12081) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 215 +++++++++++++++++++++++++------------------------ 2 files changed, 111 insertions(+), 106 deletions(-) diff --git a/package.json b/package.json index a8c4b440d..ea2f9109e 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "pug": "^3.0.3", "puppeteer": "~23.3.0", "rimraf": "^6.0.1", - "rollup": "^4.22.4", + "rollup": "^4.24.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-polyfill-node": "^0.13.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 586fe7e1c..e28c12cd5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,19 +40,19 @@ importers: version: 7.25.2 '@rollup/plugin-alias': specifier: ^5.1.1 - version: 5.1.1(rollup@4.22.4) + version: 5.1.1(rollup@4.24.0) '@rollup/plugin-commonjs': specifier: ^26.0.3 - version: 26.0.3(rollup@4.22.4) + version: 26.0.3(rollup@4.24.0) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.22.4) + version: 6.1.0(rollup@4.24.0) '@rollup/plugin-node-resolve': specifier: ^15.3.0 - version: 15.3.0(rollup@4.22.4) + version: 15.3.0(rollup@4.24.0) '@rollup/plugin-replace': specifier: 5.0.4 - version: 5.0.4(rollup@4.22.4) + version: 5.0.4(rollup@4.24.0) '@swc/core': specifier: ^1.7.28 version: 1.7.28 @@ -138,17 +138,17 @@ importers: specifier: ^6.0.1 version: 6.0.1 rollup: - specifier: ^4.22.4 - version: 4.22.4 + specifier: ^4.24.0 + version: 4.24.0 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.22.4)(typescript@5.6.2) + version: 6.1.1(rollup@4.24.0)(typescript@5.6.2) rollup-plugin-esbuild: specifier: ^6.1.1 - version: 6.1.1(esbuild@0.24.0)(rollup@4.22.4) + version: 6.1.1(esbuild@0.24.0)(rollup@4.24.0) rollup-plugin-polyfill-node: specifier: ^0.13.0 - version: 0.13.0(rollup@4.22.4) + version: 0.13.0(rollup@4.24.0) semver: specifier: ^7.6.3 version: 7.6.3 @@ -926,8 +926,8 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.22.4': - resolution: {integrity: sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==} + '@rollup/rollup-android-arm-eabi@4.24.0': + resolution: {integrity: sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==} cpu: [arm] os: [android] @@ -936,8 +936,8 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.22.4': - resolution: {integrity: sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==} + '@rollup/rollup-android-arm64@4.24.0': + resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} cpu: [arm64] os: [android] @@ -946,8 +946,8 @@ packages: cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.22.4': - resolution: {integrity: sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==} + '@rollup/rollup-darwin-arm64@4.24.0': + resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} cpu: [arm64] os: [darwin] @@ -956,8 +956,8 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.22.4': - resolution: {integrity: sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==} + '@rollup/rollup-darwin-x64@4.24.0': + resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} cpu: [x64] os: [darwin] @@ -966,8 +966,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': - resolution: {integrity: sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': + resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} cpu: [arm] os: [linux] @@ -976,8 +976,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.22.4': - resolution: {integrity: sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==} + '@rollup/rollup-linux-arm-musleabihf@4.24.0': + resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} cpu: [arm] os: [linux] @@ -986,8 +986,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.22.4': - resolution: {integrity: sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==} + '@rollup/rollup-linux-arm64-gnu@4.24.0': + resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} cpu: [arm64] os: [linux] @@ -996,8 +996,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.22.4': - resolution: {integrity: sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==} + '@rollup/rollup-linux-arm64-musl@4.24.0': + resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} cpu: [arm64] os: [linux] @@ -1006,8 +1006,8 @@ packages: cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': - resolution: {integrity: sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==} + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': + resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} cpu: [ppc64] os: [linux] @@ -1016,8 +1016,8 @@ packages: cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.22.4': - resolution: {integrity: sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==} + '@rollup/rollup-linux-riscv64-gnu@4.24.0': + resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} cpu: [riscv64] os: [linux] @@ -1026,8 +1026,8 @@ packages: cpu: [s390x] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.22.4': - resolution: {integrity: sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==} + '@rollup/rollup-linux-s390x-gnu@4.24.0': + resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} cpu: [s390x] os: [linux] @@ -1036,8 +1036,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.22.4': - resolution: {integrity: sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==} + '@rollup/rollup-linux-x64-gnu@4.24.0': + resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} cpu: [x64] os: [linux] @@ -1046,8 +1046,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.22.4': - resolution: {integrity: sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==} + '@rollup/rollup-linux-x64-musl@4.24.0': + resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} cpu: [x64] os: [linux] @@ -1056,8 +1056,8 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.22.4': - resolution: {integrity: sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==} + '@rollup/rollup-win32-arm64-msvc@4.24.0': + resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} cpu: [arm64] os: [win32] @@ -1066,8 +1066,8 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.22.4': - resolution: {integrity: sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==} + '@rollup/rollup-win32-ia32-msvc@4.24.0': + resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} cpu: [ia32] os: [win32] @@ -1076,8 +1076,8 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.22.4': - resolution: {integrity: sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==} + '@rollup/rollup-win32-x64-msvc@4.24.0': + resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} cpu: [x64] os: [win32] @@ -1162,6 +1162,9 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} @@ -2938,8 +2941,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.22.4: - resolution: {integrity: sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==} + rollup@4.24.0: + resolution: {integrity: sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3751,154 +3754,154 @@ snapshots: transitivePeerDependencies: - supports-color - '@rollup/plugin-alias@5.1.1(rollup@4.22.4)': + '@rollup/plugin-alias@5.1.1(rollup@4.24.0)': optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/plugin-commonjs@26.0.3(rollup@4.22.4)': + '@rollup/plugin-commonjs@26.0.3(rollup@4.24.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) commondir: 1.0.1 estree-walker: 2.0.2 glob: 10.4.5 is-reference: 1.2.1 magic-string: 0.30.11 optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/plugin-inject@5.0.5(rollup@4.22.4)': + '@rollup/plugin-inject@5.0.5(rollup@4.24.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) estree-walker: 2.0.2 magic-string: 0.30.11 optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/plugin-json@6.1.0(rollup@4.22.4)': + '@rollup/plugin-json@6.1.0(rollup@4.24.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/plugin-node-resolve@15.3.0(rollup@4.22.4)': + '@rollup/plugin-node-resolve@15.3.0(rollup@4.24.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/plugin-replace@5.0.4(rollup@4.22.4)': + '@rollup/plugin-replace@5.0.4(rollup@4.24.0)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) magic-string: 0.30.11 optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 - '@rollup/pluginutils@5.1.0(rollup@4.22.4)': + '@rollup/pluginutils@5.1.0(rollup@4.24.0)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.22.4 + rollup: 4.24.0 '@rollup/rollup-android-arm-eabi@4.20.0': optional: true - '@rollup/rollup-android-arm-eabi@4.22.4': + '@rollup/rollup-android-arm-eabi@4.24.0': optional: true '@rollup/rollup-android-arm64@4.20.0': optional: true - '@rollup/rollup-android-arm64@4.22.4': + '@rollup/rollup-android-arm64@4.24.0': optional: true '@rollup/rollup-darwin-arm64@4.20.0': optional: true - '@rollup/rollup-darwin-arm64@4.22.4': + '@rollup/rollup-darwin-arm64@4.24.0': optional: true '@rollup/rollup-darwin-x64@4.20.0': optional: true - '@rollup/rollup-darwin-x64@4.22.4': + '@rollup/rollup-darwin-x64@4.24.0': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.20.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.22.4': + '@rollup/rollup-linux-arm-gnueabihf@4.24.0': optional: true '@rollup/rollup-linux-arm-musleabihf@4.20.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.22.4': + '@rollup/rollup-linux-arm-musleabihf@4.24.0': optional: true '@rollup/rollup-linux-arm64-gnu@4.20.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.22.4': + '@rollup/rollup-linux-arm64-gnu@4.24.0': optional: true '@rollup/rollup-linux-arm64-musl@4.20.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.22.4': + '@rollup/rollup-linux-arm64-musl@4.24.0': optional: true '@rollup/rollup-linux-powerpc64le-gnu@4.20.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.22.4': + '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': optional: true '@rollup/rollup-linux-riscv64-gnu@4.20.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.22.4': + '@rollup/rollup-linux-riscv64-gnu@4.24.0': optional: true '@rollup/rollup-linux-s390x-gnu@4.20.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.22.4': + '@rollup/rollup-linux-s390x-gnu@4.24.0': optional: true '@rollup/rollup-linux-x64-gnu@4.20.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.22.4': + '@rollup/rollup-linux-x64-gnu@4.24.0': optional: true '@rollup/rollup-linux-x64-musl@4.20.0': optional: true - '@rollup/rollup-linux-x64-musl@4.22.4': + '@rollup/rollup-linux-x64-musl@4.24.0': optional: true '@rollup/rollup-win32-arm64-msvc@4.20.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.22.4': + '@rollup/rollup-win32-arm64-msvc@4.24.0': optional: true '@rollup/rollup-win32-ia32-msvc@4.20.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.22.4': + '@rollup/rollup-win32-ia32-msvc@4.24.0': optional: true '@rollup/rollup-win32-x64-msvc@4.20.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.22.4': + '@rollup/rollup-win32-x64-msvc@4.24.0': optional: true '@swc/core-darwin-arm64@1.7.28': @@ -3957,6 +3960,8 @@ snapshots: '@types/estree@1.0.5': {} + '@types/estree@1.0.6': {} + '@types/hash-sum@1.0.2': {} '@types/node@20.16.10': @@ -5880,29 +5885,29 @@ snapshots: glob: 11.0.0 package-json-from-dist: 1.0.0 - rollup-plugin-dts@6.1.1(rollup@4.22.4)(typescript@5.6.2): + rollup-plugin-dts@6.1.1(rollup@4.24.0)(typescript@5.6.2): dependencies: magic-string: 0.30.11 - rollup: 4.22.4 + rollup: 4.24.0 typescript: 5.6.2 optionalDependencies: '@babel/code-frame': 7.24.7 - rollup-plugin-esbuild@6.1.1(esbuild@0.24.0)(rollup@4.22.4): + rollup-plugin-esbuild@6.1.1(esbuild@0.24.0)(rollup@4.24.0): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.22.4) + '@rollup/pluginutils': 5.1.0(rollup@4.24.0) debug: 4.3.6 es-module-lexer: 1.5.4 esbuild: 0.24.0 get-tsconfig: 4.7.6 - rollup: 4.22.4 + rollup: 4.24.0 transitivePeerDependencies: - supports-color - rollup-plugin-polyfill-node@0.13.0(rollup@4.22.4): + rollup-plugin-polyfill-node@0.13.0(rollup@4.24.0): dependencies: - '@rollup/plugin-inject': 5.0.5(rollup@4.22.4) - rollup: 4.22.4 + '@rollup/plugin-inject': 5.0.5(rollup@4.24.0) + rollup: 4.24.0 rollup@4.20.0: dependencies: @@ -5926,26 +5931,26 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.20.0 fsevents: 2.3.3 - rollup@4.22.4: + rollup@4.24.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.22.4 - '@rollup/rollup-android-arm64': 4.22.4 - '@rollup/rollup-darwin-arm64': 4.22.4 - '@rollup/rollup-darwin-x64': 4.22.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.22.4 - '@rollup/rollup-linux-arm-musleabihf': 4.22.4 - '@rollup/rollup-linux-arm64-gnu': 4.22.4 - '@rollup/rollup-linux-arm64-musl': 4.22.4 - '@rollup/rollup-linux-powerpc64le-gnu': 4.22.4 - '@rollup/rollup-linux-riscv64-gnu': 4.22.4 - '@rollup/rollup-linux-s390x-gnu': 4.22.4 - '@rollup/rollup-linux-x64-gnu': 4.22.4 - '@rollup/rollup-linux-x64-musl': 4.22.4 - '@rollup/rollup-win32-arm64-msvc': 4.22.4 - '@rollup/rollup-win32-ia32-msvc': 4.22.4 - '@rollup/rollup-win32-x64-msvc': 4.22.4 + '@rollup/rollup-android-arm-eabi': 4.24.0 + '@rollup/rollup-android-arm64': 4.24.0 + '@rollup/rollup-darwin-arm64': 4.24.0 + '@rollup/rollup-darwin-x64': 4.24.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.24.0 + '@rollup/rollup-linux-arm-musleabihf': 4.24.0 + '@rollup/rollup-linux-arm64-gnu': 4.24.0 + '@rollup/rollup-linux-arm64-musl': 4.24.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.24.0 + '@rollup/rollup-linux-riscv64-gnu': 4.24.0 + '@rollup/rollup-linux-s390x-gnu': 4.24.0 + '@rollup/rollup-linux-x64-gnu': 4.24.0 + '@rollup/rollup-linux-x64-musl': 4.24.0 + '@rollup/rollup-win32-arm64-msvc': 4.24.0 + '@rollup/rollup-win32-ia32-msvc': 4.24.0 + '@rollup/rollup-win32-x64-msvc': 4.24.0 fsevents: 2.3.3 rrweb-cssom@0.6.0: {} From 577edca8e7795436efd710d1c289ea8ea2642b0e Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:21:31 +0100 Subject: [PATCH 028/101] fix(scheduler): job ordering when the post queue is flushing (#12090) --- .../runtime-core/__tests__/scheduler.spec.ts | 54 +++++++++++++++++++ packages/runtime-core/src/scheduler.ts | 22 +++----- 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/packages/runtime-core/__tests__/scheduler.spec.ts b/packages/runtime-core/__tests__/scheduler.spec.ts index cf961667e..3e454aec0 100644 --- a/packages/runtime-core/__tests__/scheduler.spec.ts +++ b/packages/runtime-core/__tests__/scheduler.spec.ts @@ -441,6 +441,29 @@ describe('scheduler', () => { await nextTick() expect(calls).toEqual(['job1', 'job2', 'cb1', 'cb2']) }) + + test('jobs added during post flush are ordered correctly', async () => { + const calls: string[] = [] + + const job1: SchedulerJob = () => { + calls.push('job1') + } + job1.id = 1 + + const job2: SchedulerJob = () => { + calls.push('job2') + } + job2.id = 2 + + queuePostFlushCb(() => { + queueJob(job2) + queueJob(job1) + }) + + await nextTick() + + expect(calls).toEqual(['job1', 'job2']) + }) }) test('sort job based on id', async () => { @@ -758,6 +781,37 @@ describe('scheduler', () => { expect(spy).toHaveBeenCalledTimes(1) }) + test('flushPreFlushCbs inside a post job', async () => { + const calls: string[] = [] + const callsAfterFlush: string[] = [] + + const job1: SchedulerJob = () => { + calls.push('job1') + } + job1.id = 1 + job1.flags! |= SchedulerJobFlags.PRE + + const job2: SchedulerJob = () => { + calls.push('job2') + } + job2.id = 2 + job2.flags! |= SchedulerJobFlags.PRE + + queuePostFlushCb(() => { + queueJob(job2) + queueJob(job1) + + // e.g. nested app.mount() call + flushPreFlushCbs() + callsAfterFlush.push(...calls) + }) + + await nextTick() + + expect(callsAfterFlush).toEqual(['job1', 'job2']) + expect(calls).toEqual(['job1', 'job2']) + }) + it('nextTick should return promise', async () => { const fn = vi.fn(() => { return 1 diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 798f850b7..b40c31d39 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -40,11 +40,8 @@ export interface SchedulerJob extends Function { export type SchedulerJobs = SchedulerJob | SchedulerJob[] -let isFlushing = false -let isFlushPending = false - const queue: SchedulerJob[] = [] -let flushIndex = 0 +let flushIndex = -1 const pendingPostFlushCbs: SchedulerJob[] = [] let activePostFlushCbs: SchedulerJob[] | null = null @@ -74,7 +71,7 @@ export function nextTick( // watcher should be inserted immediately before the update job. This allows // watchers to be skipped if the component is unmounted by the parent update. function findInsertionIndex(id: number) { - let start = isFlushing ? flushIndex + 1 : 0 + let start = flushIndex + 1 let end = queue.length while (start < end) { @@ -115,8 +112,7 @@ export function queueJob(job: SchedulerJob): void { } function queueFlush() { - if (!isFlushing && !isFlushPending) { - isFlushPending = true + if (!currentFlushPromise) { currentFlushPromise = resolvedPromise.then(flushJobs) } } @@ -141,8 +137,8 @@ export function queuePostFlushCb(cb: SchedulerJobs): void { export function flushPreFlushCbs( instance?: ComponentInternalInstance, seen?: CountMap, - // if currently flushing, skip the current job itself - i: number = isFlushing ? flushIndex + 1 : 0, + // skip the current job + i: number = flushIndex + 1, ): void { if (__DEV__) { seen = seen || new Map() @@ -211,8 +207,6 @@ const getId = (job: SchedulerJob): number => job.id == null ? (job.flags! & SchedulerJobFlags.PRE ? -1 : Infinity) : job.id function flushJobs(seen?: CountMap) { - isFlushPending = false - isFlushing = true if (__DEV__) { seen = seen || new Map() } @@ -255,15 +249,13 @@ function flushJobs(seen?: CountMap) { } } - flushIndex = 0 + flushIndex = -1 queue.length = 0 flushPostFlushCbs(seen) - isFlushing = false currentFlushPromise = null - // some postFlushCb queued jobs! - // keep flushing until it drains. + // If new jobs have been added to either queue, keep flushing if (queue.length || pendingPostFlushCbs.length) { flushJobs(seen) } From 57315ab9688c9741a271d1075bbd28cbe5f71e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:22:27 +0800 Subject: [PATCH 029/101] fix(types): correctly infer `TypeProps` when it is `any` (#12073) close #12058 --- .../runtime-core/src/apiDefineComponent.ts | 18 ++++++++---------- packages/shared/src/typeUtils.ts | 6 ++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 3748fc81c..d5e2feb5e 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -27,7 +27,7 @@ import type { EmitsToProps, TypeEmitsToOptions, } from './componentEmits' -import { extend, isFunction } from '@vue/shared' +import { type IsKeyValues, extend, isFunction } from '@vue/shared' import type { VNodeProps } from './vnode' import type { ComponentPublicInstanceConstructor, @@ -208,15 +208,13 @@ export function defineComponent< ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions : RuntimeEmitsOptions, - InferredProps = unknown extends TypeProps - ? keyof TypeProps extends never - ? string extends RuntimePropsKeys - ? ComponentObjectPropsOptions extends RuntimePropsOptions - ? {} - : ExtractPropTypes - : { [key in RuntimePropsKeys]?: any } - : TypeProps - : TypeProps, + InferredProps = IsKeyValues extends true + ? TypeProps + : string extends RuntimePropsKeys + ? ComponentObjectPropsOptions extends RuntimePropsOptions + ? {} + : ExtractPropTypes + : { [key in RuntimePropsKeys]?: any }, TypeRefs extends Record = {}, TypeEl extends Element = any, >( diff --git a/packages/shared/src/typeUtils.ts b/packages/shared/src/typeUtils.ts index 1fd161ceb..f5b9e6ec3 100644 --- a/packages/shared/src/typeUtils.ts +++ b/packages/shared/src/typeUtils.ts @@ -13,6 +13,12 @@ export type LooseRequired = { [P in keyof (T & Required)]: T[P] } // https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360 export type IfAny = 0 extends 1 & T ? Y : N +export type IsKeyValues = IfAny< + T, + false, + T extends object ? (keyof T extends K ? true : false) : false +> + /** * Utility for extracting the parameters from a function overload (for typed emits) * https://github.com/microsoft/TypeScript/issues/32164#issuecomment-1146737709 From c97bb84d0b0a16b012f886b6498e924415ed63e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:22:57 +0800 Subject: [PATCH 030/101] fix(types): infer the first generic type of `Ref` correctly (#12094) --- packages/reactivity/src/reactive.ts | 2 +- packages/reactivity/src/ref.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/reactivity/src/reactive.ts b/packages/reactivity/src/reactive.ts index 7d9c33aa4..729c85496 100644 --- a/packages/reactivity/src/reactive.ts +++ b/packages/reactivity/src/reactive.ts @@ -167,7 +167,7 @@ export type DeepReadonly = T extends Builtin ? WeakSet> : T extends Promise ? Promise> - : T extends Ref + : T extends Ref ? Readonly>> : T extends {} ? { readonly [K in keyof T]: DeepReadonly } diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 43b26b78f..6b8d54181 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -489,12 +489,12 @@ export type ShallowUnwrapRef = { [K in keyof T]: DistributeRef } -type DistributeRef = T extends Ref ? V : T +type DistributeRef = T extends Ref ? V : T export type UnwrapRef = - T extends ShallowRef + T extends ShallowRef ? V - : T extends Ref + : T extends Ref ? UnwrapRefSimple : UnwrapRefSimple From 6f8589437635706f825ccec51800effba1d2bf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:24:09 +0800 Subject: [PATCH 031/101] fix(type): should not intersect `PublicProps` with `Props` (#12077) --- packages/runtime-core/src/apiDefineComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index d5e2feb5e..9ae6b41a4 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -79,7 +79,7 @@ export type DefineComponent< Mixin, Extends, E, - PP & Props, + PP, Defaults, MakeDefaultsOptional, {}, From 6e4de8d75e064a220c57c942c4239ca46fc7fe49 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 3 Oct 2024 23:49:47 +0800 Subject: [PATCH 032/101] release: v3.5.11 --- CHANGELOG.md | 14 ++++++++++++++ package.json | 2 +- packages/compiler-core/package.json | 2 +- packages/compiler-dom/package.json | 2 +- packages/compiler-sfc/package.json | 2 +- packages/compiler-ssr/package.json | 2 +- packages/reactivity/package.json | 2 +- packages/runtime-core/package.json | 2 +- packages/runtime-dom/package.json | 2 +- packages/server-renderer/package.json | 2 +- packages/shared/package.json | 2 +- packages/vue-compat/package.json | 2 +- packages/vue/package.json | 2 +- 13 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf07a8d1..6a176ee1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [3.5.11](https://github.com/vuejs/core/compare/v3.5.10...v3.5.11) (2024-10-03) + + +### Bug Fixes + +* **compiler-sfc:** do not skip `TSSatisfiesExpression` when transforming props destructure ([#12062](https://github.com/vuejs/core/issues/12062)) ([2328b05](https://github.com/vuejs/core/commit/2328b051f4efa1f1394b7d4e73b7c3f76e430e7c)), closes [#12061](https://github.com/vuejs/core/issues/12061) +* **reactivity:** prevent overwriting `next` property during batch processing ([#12075](https://github.com/vuejs/core/issues/12075)) ([d3f5e6e](https://github.com/vuejs/core/commit/d3f5e6e5319b4ffaa55ca9a2ea3d95d78e76fa58)), closes [#12072](https://github.com/vuejs/core/issues/12072) +* **scheduler:** job ordering when the post queue is flushing ([#12090](https://github.com/vuejs/core/issues/12090)) ([577edca](https://github.com/vuejs/core/commit/577edca8e7795436efd710d1c289ea8ea2642b0e)) +* **types:** correctly infer `TypeProps` when it is `any` ([#12073](https://github.com/vuejs/core/issues/12073)) ([57315ab](https://github.com/vuejs/core/commit/57315ab9688c9741a271d1075bbd28cbe5f71e2f)), closes [#12058](https://github.com/vuejs/core/issues/12058) +* **types:** should not intersect `PublicProps` with `Props` ([#12077](https://github.com/vuejs/core/issues/12077)) ([6f85894](https://github.com/vuejs/core/commit/6f8589437635706f825ccec51800effba1d2bf5f)) +* **types:** infer the first generic type of `Ref` correctly ([#12094](https://github.com/vuejs/core/issues/12094)) ([c97bb84](https://github.com/vuejs/core/commit/c97bb84d0b0a16b012f886b6498e924415ed63e5)) + + + ## [3.5.10](https://github.com/vuejs/core/compare/v3.5.9...v3.5.10) (2024-09-27) diff --git a/package.json b/package.json index ea2f9109e..fcbf7c4f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.5.10", + "version": "3.5.11", "packageManager": "pnpm@9.12.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 69458ec96..4fb760168 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/compiler-core", "main": "index.js", "module": "dist/compiler-core.esm-bundler.js", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index 2034e4800..ed5950dc7 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/compiler-dom", "main": "index.js", "module": "dist/compiler-dom.esm-bundler.js", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 4390d5097..7cbeb9a3c 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index b5f91635b..16da421ad 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index 7d5bf4b69..cc02882d0 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 350b8b086..0e10386a0 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 6dfb2d6a9..f8c094d33 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 36fb68c11..c45d7c8f2 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.10", + "version": "3.5.11", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index f10dc1c5e..dbd2a8f2c 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.10", + "version": "3.5.11", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index adb0b6280..e8c292c94 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.10", + "version": "3.5.11", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index c73e89334..1a063eefe 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.10", + "version": "3.5.11", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From b094c72b3d40c52c7124f145a9db028509a11202 Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:09:23 +0100 Subject: [PATCH 033/101] fix(watch): watchEffect clean-up with SSR (#12097) close #11956 --- packages/runtime-core/src/apiWatch.ts | 16 +- .../__tests__/ssrWatch.spec.ts | 174 +++++++++++++++++- 2 files changed, 184 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 798b6e726..8f6168cdf 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -170,15 +170,14 @@ function doWatch( if (__DEV__) baseWatchOptions.onWarn = warn + // immediate watcher or watchEffect + const runsImmediately = (cb && immediate) || (!cb && flush !== 'post') let ssrCleanup: (() => void)[] | undefined if (__SSR__ && isInSSRComponentSetup) { if (flush === 'sync') { const ctx = useSSRContext()! ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []) - } else if (!cb || immediate) { - // immediately watch or watchEffect - baseWatchOptions.once = true - } else { + } else if (!runsImmediately) { const watchStopHandle = () => {} watchStopHandle.stop = NOOP watchStopHandle.resume = NOOP @@ -226,7 +225,14 @@ function doWatch( const watchHandle = baseWatch(source, cb, baseWatchOptions) - if (__SSR__ && ssrCleanup) ssrCleanup.push(watchHandle) + if (__SSR__ && isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle) + } else if (runsImmediately) { + watchHandle() + } + } + return watchHandle } diff --git a/packages/server-renderer/__tests__/ssrWatch.spec.ts b/packages/server-renderer/__tests__/ssrWatch.spec.ts index c157c90cd..40c49740d 100644 --- a/packages/server-renderer/__tests__/ssrWatch.spec.ts +++ b/packages/server-renderer/__tests__/ssrWatch.spec.ts @@ -1,4 +1,12 @@ -import { createSSRApp, defineComponent, h, ref, watch } from 'vue' +import { + createSSRApp, + defineComponent, + h, + nextTick, + ref, + watch, + watchEffect, +} from 'vue' import { type SSRContext, renderToString } from '../src' describe('ssr: watch', () => { @@ -27,4 +35,168 @@ describe('ssr: watch', () => { expect(html).toMatch('hello world') }) + + test('should work with flush: sync and immediate: true', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watch( + text, + () => { + msg = text.value + }, + { flush: 'sync', immediate: true }, + ) + expect(msg).toBe('start') + text.value = 'changed' + expect(msg).toBe('changed') + text.value = 'changed again' + expect(msg).toBe('changed again') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles!.length).toBe(1) + expect(html).toMatch('changed again') + await nextTick() + expect(msg).toBe('changed again') + }) + + test('should run once with immediate: true', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watch( + text, + () => { + msg = String(text.value) + }, + { immediate: true }, + ) + text.value = 'changed' + expect(msg).toBe('start') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles).toBeUndefined() + expect(html).toMatch('start') + await nextTick() + expect(msg).toBe('start') + }) + + test('should run once with immediate: true and flush: post', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watch( + text, + () => { + msg = String(text.value) + }, + { immediate: true, flush: 'post' }, + ) + text.value = 'changed' + expect(msg).toBe('start') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles).toBeUndefined() + expect(html).toMatch('start') + await nextTick() + expect(msg).toBe('start') + }) +}) + +describe('ssr: watchEffect', () => { + test('should run with flush: sync', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watchEffect( + () => { + msg = text.value + }, + { flush: 'sync' }, + ) + expect(msg).toBe('start') + text.value = 'changed' + expect(msg).toBe('changed') + text.value = 'changed again' + expect(msg).toBe('changed again') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles!.length).toBe(1) + expect(html).toMatch('changed again') + await nextTick() + expect(msg).toBe('changed again') + }) + + test('should run once with default flush (pre)', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watchEffect(() => { + msg = text.value + }) + text.value = 'changed' + expect(msg).toBe('start') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles).toBeUndefined() + expect(html).toMatch('start') + await nextTick() + expect(msg).toBe('start') + }) + + test('should not run for flush: post', async () => { + const text = ref('start') + let msg = 'unchanged' + + const App = defineComponent(() => { + watchEffect( + () => { + msg = text.value + }, + { flush: 'post' }, + ) + text.value = 'changed' + expect(msg).toBe('unchanged') + return () => h('div', null, msg) + }) + + const app = createSSRApp(App) + const ctx: SSRContext = {} + const html = await renderToString(app, ctx) + + expect(ctx.__watcherHandles).toBeUndefined() + expect(html).toMatch('unchanged') + await nextTick() + expect(msg).toBe('unchanged') + }) }) From abacf6327a2e2ffbd4fa6fe686b45f7ed7fc2d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 5 Oct 2024 11:41:54 +0800 Subject: [PATCH 034/101] chore(benchmark): dedupe deps --- benchmark/package.json | 2 +- pnpm-lock.yaml | 64 ++++-------------------------------------- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/benchmark/package.json b/benchmark/package.json index 0e3db18f4..81d55005c 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -12,7 +12,7 @@ "@vitejs/plugin-vue": "https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5", "connect": "^3.7.0", "sirv": "^2.0.4", - "vite": "^5.0.12" + "vite": "catalog:" }, "devDependencies": { "@types/connect": "^3.4.38", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b4986a5aa..631c4139b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -187,7 +187,7 @@ importers: dependencies: '@vitejs/plugin-vue': specifier: https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5 - version: https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5(vite@5.3.3(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0))(vue@3.5.11(typescript@5.6.2)) + version: https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5(vite@5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0))(vue@3.5.11(typescript@5.6.2)) connect: specifier: ^3.7.0 version: 3.7.0 @@ -195,8 +195,8 @@ importers: specifier: ^2.0.4 version: 2.0.4 vite: - specifier: ^5.0.12 - version: 5.3.3(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0) + specifier: 'catalog:' + version: 5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0) devDependencies: '@types/connect': specifier: ^3.4.38 @@ -2877,9 +2877,6 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} @@ -2932,10 +2929,6 @@ packages: postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - postcss@8.4.41: - resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.4.47: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} @@ -3542,34 +3535,6 @@ packages: '@nuxt/kit': optional: true - vite@5.3.3: - resolution: {integrity: sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - vite@5.4.0: resolution: {integrity: sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -4377,9 +4342,9 @@ snapshots: vite: 5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0) vue: link:packages/vue - '@vitejs/plugin-vue@https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5(vite@5.3.3(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0))(vue@3.5.11(typescript@5.6.2))': + '@vitejs/plugin-vue@https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5(vite@5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0))(vue@3.5.11(typescript@5.6.2))': dependencies: - vite: 5.3.3(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0) + vite: 5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0) vue: 3.5.11(typescript@5.6.2) '@vitejs/plugin-vue@https://pkg.pr.new/@vitejs/plugin-vue@e3c5ce5(vite@5.4.0(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0))(vue@packages+vue)': @@ -6051,8 +6016,6 @@ snapshots: perfect-debounce@1.0.0: {} - picocolors@1.0.1: {} - picocolors@1.1.0: {} picomatch@2.3.1: {} @@ -6101,12 +6064,6 @@ snapshots: postcss-value-parser@4.2.0: {} - postcss@8.4.41: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.1 - postcss@8.4.47: dependencies: nanoid: 3.3.7 @@ -6812,17 +6769,6 @@ snapshots: - rollup - supports-color - vite@5.3.3(@types/node@22.5.5)(sass@1.79.4)(terser@5.33.0): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.41 - rollup: 4.24.0 - optionalDependencies: - '@types/node': 22.5.5 - fsevents: 2.3.3 - sass: 1.79.4 - terser: 5.33.0 - vite@5.4.0(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0): dependencies: esbuild: 0.21.5 From 7e153f8a33ab0832adc7fe0fc26479c68d8f6e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 5 Oct 2024 15:58:10 +0800 Subject: [PATCH 035/101] ci: continuous release without checking --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9703a0c56..dfd8b0d0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,6 @@ jobs: continuous-release: if: github.repository == 'vuejs/core-vapor' runs-on: ubuntu-latest - needs: [unit-test, lint-and-test-dts] permissions: contents: read id-token: write From 3d487184ea33baf66b3ce85a4f3ad17863e87cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 5 Oct 2024 15:59:15 +0800 Subject: [PATCH 036/101] chore: rename repo name --- .github/workflows/close-cant-reproduce-issues.yml | 2 +- .github/workflows/lock-closed-issues.yml | 2 +- .github/workflows/size-data.yml | 2 +- .github/workflows/size-report.yml | 2 +- .github/workflows/test.yml | 2 +- packages-private/template-explorer/src/options.ts | 2 +- packages/compiler-core/package.json | 6 +++--- packages/compiler-dom/package.json | 6 +++--- packages/compiler-sfc/package.json | 6 +++--- packages/compiler-ssr/package.json | 6 +++--- packages/compiler-vapor/package.json | 6 +++--- packages/reactivity/package.json | 6 +++--- packages/runtime-core/package.json | 6 +++--- packages/runtime-dom/package.json | 6 +++--- packages/runtime-shared/package.json | 6 +++--- packages/runtime-test/package.json | 6 +++--- packages/runtime-vapor/package.json | 6 +++--- packages/runtime-vapor/src/dom/template.ts | 2 +- packages/server-renderer/package.json | 6 +++--- packages/shared/package.json | 6 +++--- packages/vue-compat/package.json | 6 +++--- packages/vue-vapor/package.json | 6 +++--- packages/vue/package.json | 6 +++--- 23 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/workflows/close-cant-reproduce-issues.yml b/.github/workflows/close-cant-reproduce-issues.yml index 37bd96226..90a3b0406 100644 --- a/.github/workflows/close-cant-reproduce-issues.yml +++ b/.github/workflows/close-cant-reproduce-issues.yml @@ -9,7 +9,7 @@ permissions: jobs: close-issues: - if: github.repository == 'vuejs/core-vapor' + if: github.repository == 'vuejs/vue-vapor' runs-on: ubuntu-latest steps: - name: can't reproduce diff --git a/.github/workflows/lock-closed-issues.yml b/.github/workflows/lock-closed-issues.yml index bc57ece04..cbb47c08e 100644 --- a/.github/workflows/lock-closed-issues.yml +++ b/.github/workflows/lock-closed-issues.yml @@ -9,7 +9,7 @@ permissions: jobs: action: - if: github.repository == 'vuejs/core-vapor' + if: github.repository == 'vuejs/vue-vapor' runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v5 diff --git a/.github/workflows/size-data.yml b/.github/workflows/size-data.yml index 1fd495fe2..78da7e931 100644 --- a/.github/workflows/size-data.yml +++ b/.github/workflows/size-data.yml @@ -18,7 +18,7 @@ env: jobs: upload: - if: github.repository == 'vuejs/core-vapor' + if: github.repository == 'vuejs/vue-vapor' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/size-report.yml b/.github/workflows/size-report.yml index 1695f0c5f..7e763e157 100644 --- a/.github/workflows/size-report.yml +++ b/.github/workflows/size-report.yml @@ -18,7 +18,7 @@ jobs: size-report: runs-on: ubuntu-latest if: > - github.repository == 'vuejs/core-vapor' && + github.repository == 'vuejs/vue-vapor' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dfd8b0d0b..bc5beb5ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,7 +55,7 @@ jobs: run: pnpm run test-dts continuous-release: - if: github.repository == 'vuejs/core-vapor' + if: github.repository == 'vuejs/vue-vapor' runs-on: ubuntu-latest permissions: contents: read diff --git a/packages-private/template-explorer/src/options.ts b/packages-private/template-explorer/src/options.ts index 6cf682adf..9f217dd29 100644 --- a/packages-private/template-explorer/src/options.ts +++ b/packages-private/template-explorer/src/options.ts @@ -44,7 +44,7 @@ const App = { h( 'a', { - href: `https://github.com/vuejs/core-vapor/tree/${__COMMIT__}`, + href: `https://github.com/vuejs/vue-vapor/tree/${__COMMIT__}`, target: `_blank`, }, `@${__COMMIT__}`, diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index e5eb2d673..c170f62dd 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -33,7 +33,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/compiler-core" }, "keywords": [ @@ -42,9 +42,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-core#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/compiler-core#readme", "dependencies": { "@babel/parser": "catalog:", "@vue/shared": "workspace:*", diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index b8d884e05..d66c796a2 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -38,7 +38,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/compiler-dom" }, "keywords": [ @@ -47,9 +47,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-dom#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/compiler-dom#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/compiler-core": "workspace:*" diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 1a989b291..72e62b4e8 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -29,7 +29,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/compiler-sfc" }, "keywords": [ @@ -38,9 +38,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-sfc#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/compiler-sfc#readme", "dependencies": { "@babel/parser": "catalog:", "@vue/compiler-core": "workspace:*", diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index 9c235e7a5..b8a31808e 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/compiler-ssr" }, "keywords": [ @@ -24,9 +24,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-ssr#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/compiler-ssr#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/compiler-dom": "workspace:*" diff --git a/packages/compiler-vapor/package.json b/packages/compiler-vapor/package.json index 99424c525..4c9270e17 100644 --- a/packages/compiler-vapor/package.json +++ b/packages/compiler-vapor/package.json @@ -24,7 +24,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/compiler-vapor" }, "keywords": [ @@ -33,9 +33,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-vapor#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/compiler-vapor#readme", "dependencies": { "@vue/compiler-dom": "workspace:*", "@vue/shared": "workspace:*", diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index d8b0ad1d4..547e78c3a 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -28,7 +28,7 @@ "sideEffects": false, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/reactivity" }, "buildOptions": { @@ -46,9 +46,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/reactivity#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/reactivity#readme", "dependencies": { "@vue/shared": "workspace:*" } diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index f6096c156..bef31c4bb 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -33,7 +33,7 @@ "sideEffects": false, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/runtime-core" }, "keywords": [ @@ -42,9 +42,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/runtime-core#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-core#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/reactivity": "workspace:*", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 75a2680e5..cb1d6ac63 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -36,7 +36,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/runtime-dom" }, "keywords": [ @@ -45,9 +45,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/runtime-dom#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-dom#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/runtime-core": "workspace:*", diff --git a/packages/runtime-shared/package.json b/packages/runtime-shared/package.json index cc3c35296..a23e6140e 100644 --- a/packages/runtime-shared/package.json +++ b/packages/runtime-shared/package.json @@ -32,7 +32,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/runtime-shared" }, "keywords": [ @@ -41,7 +41,7 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/runtime-shared#readme" + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-shared#readme" } diff --git a/packages/runtime-test/package.json b/packages/runtime-test/package.json index f9594d484..dd08aee59 100644 --- a/packages/runtime-test/package.json +++ b/packages/runtime-test/package.json @@ -12,7 +12,7 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/runtime-test" }, "keywords": [ @@ -21,9 +21,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/runtime-test#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-test#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/runtime-core": "workspace:*" diff --git a/packages/runtime-vapor/package.json b/packages/runtime-vapor/package.json index 1c9ba45c3..54e4a8231 100644 --- a/packages/runtime-vapor/package.json +++ b/packages/runtime-vapor/package.json @@ -22,7 +22,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/runtime-vapor" }, "keywords": [ @@ -31,9 +31,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/dev/packages/runtime-vapor#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/dev/packages/runtime-vapor#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/reactivity": "workspace:*", diff --git a/packages/runtime-vapor/src/dom/template.ts b/packages/runtime-vapor/src/dom/template.ts index c3a5dea14..1206987b6 100644 --- a/packages/runtime-vapor/src/dom/template.ts +++ b/packages/runtime-vapor/src/dom/template.ts @@ -14,7 +14,7 @@ export function template(html: string) { export function children(node: Node, ...paths: number[]): Node { for (const idx of paths) { // In various situations, select the quickest approach. - // See https://github.com/vuejs/core-vapor/pull/263 + // See https://github.com/vuejs/vue-vapor/pull/263 node = idx === 0 ? node.firstChild! diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 65bf90086..330269972 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -33,7 +33,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/server-renderer" }, "keywords": [ @@ -42,9 +42,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/server-renderer#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/server-renderer#readme", "peerDependencies": { "vue": "workspace:*" }, diff --git a/packages/shared/package.json b/packages/shared/package.json index bc2d6ce9a..1ee70f156 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -32,7 +32,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git", + "url": "git+https://github.com/vuejs/vue-vapor.git", "directory": "packages/shared" }, "keywords": [ @@ -41,7 +41,7 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/shared#readme" + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/shared#readme" } diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index 41eb7d9a0..4687ff098 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -40,7 +40,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git" + "url": "git+https://github.com/vuejs/vue-vapor.git" }, "keywords": [ "vue" @@ -48,9 +48,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/vue-compat#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vue-compat#readme", "dependencies": { "@babel/parser": "catalog:", "estree-walker": "catalog:", diff --git a/packages/vue-vapor/package.json b/packages/vue-vapor/package.json index 9057d409b..c15528a2c 100644 --- a/packages/vue-vapor/package.json +++ b/packages/vue-vapor/package.json @@ -45,7 +45,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git" + "url": "git+https://github.com/vuejs/vue-vapor.git" }, "keywords": [ "vue" @@ -53,9 +53,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/vapor#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vapor#readme", "dependencies": { "@vue/runtime-vapor": "workspace:*", "@vue/compiler-vapor": "workspace:*" diff --git a/packages/vue/package.json b/packages/vue/package.json index 930da5e34..b79bbd754 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -94,7 +94,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vuejs/core-vapor.git" + "url": "git+https://github.com/vuejs/vue-vapor.git" }, "keywords": [ "vue" @@ -102,9 +102,9 @@ "author": "Evan You", "license": "MIT", "bugs": { - "url": "https://github.com/vuejs/core-vapor/issues" + "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/vue#readme", + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/vue#readme", "dependencies": { "@vue/shared": "workspace:*", "@vue/vapor": "workspace:*", From 3867942ddb71fad711d8cabaf107cda533a35ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 5 Oct 2024 17:08:13 +0800 Subject: [PATCH 037/101] fix(runtime-vapor): stale memo cache --- packages/runtime-vapor/src/apiCreateFor.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/runtime-vapor/src/apiCreateFor.ts b/packages/runtime-vapor/src/apiCreateFor.ts index 8a566237e..29913ac04 100644 --- a/packages/runtime-vapor/src/apiCreateFor.ts +++ b/packages/runtime-vapor/src/apiCreateFor.ts @@ -266,15 +266,18 @@ export const createFor = ( block.nodes = scope.run(() => { if (getMemo) { return withMemo( - () => block.memo!, + () => + getMemo( + block.state[0].value, + block.state[1].value, + block.state[2].value, + ), () => renderItem(state), ) } return renderItem(state) })! - // TODO v-memo - // if (getMemo) block.update() if (parent) insert(block.nodes, parent, anchor) return block From c1c316d392e7b1e5c5a5ceea58d4ad86a5f447e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 5 Oct 2024 21:23:37 +0800 Subject: [PATCH 038/101] feat(runtime-vapor): fast path for clear all children --- .../__snapshots__/vFor.spec.ts.snap | 2 +- .../__snapshots__/vOnce.spec.ts.snap | 2 +- packages/compiler-vapor/src/generators/for.ts | 14 ++++++++- packages/compiler-vapor/src/ir/index.ts | 1 + .../compiler-vapor/src/transforms/vFor.ts | 10 +++++++ packages/runtime-vapor/src/apiCreateFor.ts | 30 ++++++++++++++----- 6 files changed, 49 insertions(+), 10 deletions(-) diff --git a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap index 49b1f5734..6780439ec 100644 --- a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap +++ b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vFor.spec.ts.snap @@ -71,7 +71,7 @@ export function render(_ctx) { const n4 = t0() _renderEffect(() => _setText(n4, _ctx1[0].value+_ctx0[0].value)) return n4 - }) + }, null, null, n5) _insert(n2, n5) return n5 }) diff --git a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap index 68fe53dd8..2a2f16920 100644 --- a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap +++ b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap @@ -70,7 +70,7 @@ export function render(_ctx) { const n0 = _createFor(() => (_ctx.list), (_ctx0) => { const n2 = t0() return n2 - }, null, null, null, true) + }, null, null, null, null, true) return n0 }" `; diff --git a/packages/compiler-vapor/src/generators/for.ts b/packages/compiler-vapor/src/generators/for.ts index 21fb2ed02..ddfd61e1b 100644 --- a/packages/compiler-vapor/src/generators/for.ts +++ b/packages/compiler-vapor/src/generators/for.ts @@ -16,7 +16,18 @@ export function genFor( context: CodegenContext, ): CodeFragment[] { const { vaporHelper } = context - const { source, value, key, index, render, keyProp, once, id, memo } = oper + const { + source, + value, + key, + index, + render, + keyProp, + once, + id, + memo, + container, + } = oper let isDestructureAssignment = false let rawValue: string | null = null @@ -61,6 +72,7 @@ export function genFor( blockFn, genCallback(keyProp), genCallback(memo), + container != null && `n${container}`, false, // todo: hydrationNode once && 'true', ), diff --git a/packages/compiler-vapor/src/ir/index.ts b/packages/compiler-vapor/src/ir/index.ts index f4157a516..8e10ab0a7 100644 --- a/packages/compiler-vapor/src/ir/index.ts +++ b/packages/compiler-vapor/src/ir/index.ts @@ -86,6 +86,7 @@ export interface ForIRNode extends BaseIRNode, IRFor { keyProp?: SimpleExpressionNode render: BlockIRNode once: boolean + container?: number } export interface SetPropIRNode extends BaseIRNode { diff --git a/packages/compiler-vapor/src/transforms/vFor.ts b/packages/compiler-vapor/src/transforms/vFor.ts index a5ed245c2..735c086bf 100644 --- a/packages/compiler-vapor/src/transforms/vFor.ts +++ b/packages/compiler-vapor/src/transforms/vFor.ts @@ -56,6 +56,15 @@ export function processFor( return (): void => { exitBlock() + const { parent } = context + let container: number | undefined + if ( + parent && + parent.block.node !== parent.node && + parent.node.children.length === 1 + ) { + container = parent.reference() + } context.registerOperation({ type: IRNodeTypes.FOR, id, @@ -67,6 +76,7 @@ export function processFor( render, once: context.inVOnce, memo: memo && memo.exp, + container, }) } } diff --git a/packages/runtime-vapor/src/apiCreateFor.ts b/packages/runtime-vapor/src/apiCreateFor.ts index 29913ac04..dabeb27e7 100644 --- a/packages/runtime-vapor/src/apiCreateFor.ts +++ b/packages/runtime-vapor/src/apiCreateFor.ts @@ -38,6 +38,7 @@ export const createFor = ( renderItem: (block: ForBlock['state']) => Block, getKey?: (item: any, key: any, index?: number) => any, getMemo?: (item: any, key: any, index?: number) => any[], + container?: ParentNode, hydrationNode?: Node, once?: boolean, ): Fragment => { @@ -45,7 +46,11 @@ export const createFor = ( let oldBlocks: ForBlock[] = [] let newBlocks: ForBlock[] let parent: ParentNode | undefined | null - const parentAnchor = __DEV__ ? createComment('for') : createTextNode() + const parentAnchor = container + ? undefined + : __DEV__ + ? createComment('for') + : createTextNode() const ref: Fragment = { nodes: oldBlocks, [fragmentKey]: true, @@ -71,14 +76,22 @@ export const createFor = ( isMounted = true mountList(source) } else { - parent = parent || parentAnchor.parentNode + parent = parent || container || parentAnchor!.parentNode if (!oldLength) { // fast path for all new mountList(source) } else if (!newLength) { - // fast path for clearing - for (let i = 0; i < oldLength; i++) { - unmount(oldBlocks[i]) + // fast path for all removed + if (container) { + container.textContent = '' + for (let i = 0; i < oldLength; i++) { + oldBlocks[i].scope.stop() + } + } else { + // fast path for clearing + for (let i = 0; i < oldLength; i++) { + unmount(oldBlocks[i]) + } } } else if (!getKey) { // unkeyed fast path @@ -239,13 +252,16 @@ export const createFor = ( } } - ref.nodes = [(oldBlocks = newBlocks), parentAnchor] + ref.nodes = [(oldBlocks = newBlocks)] + if (parentAnchor) { + ref.nodes.push(parentAnchor) + } } function mount( source: any, idx: number, - anchor: Node = parentAnchor, + anchor: Node | undefined = parentAnchor, ): ForBlock { const scope = effectScope() From 3fa4069a1c7707459d2f8f8285eb2918d3fe56fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sun, 6 Oct 2024 01:42:32 +0800 Subject: [PATCH 039/101] perf(runtime): clear container on unmount --- .../runtime-vapor/src/apiCreateVaporApp.ts | 23 ++++++++++++++----- packages/runtime-vapor/src/apiRender.ts | 6 ++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/runtime-vapor/src/apiCreateVaporApp.ts b/packages/runtime-vapor/src/apiCreateVaporApp.ts index c4d547de2..dd9fef347 100644 --- a/packages/runtime-vapor/src/apiCreateVaporApp.ts +++ b/packages/runtime-vapor/src/apiCreateVaporApp.ts @@ -109,17 +109,23 @@ export function createVaporApp( return app }, - mount(rootContainer): any { + mount(container): any { if (!instance) { - rootContainer = normalizeContainer(rootContainer) + container = normalizeContainer(container) // #5571 - if (__DEV__ && (rootContainer as any).__vue_app__) { + if (__DEV__ && (container as any).__vue_app__) { warn( `There is already an app instance mounted on the host container.\n` + ` If you want to mount another app on the same host container,` + ` you need to unmount the previous app by calling \`app.unmount()\` first.`, ) } + + // clear content before mounting + if (container.nodeType === 1 /* Node.ELEMENT_NODE */) { + container.textContent = '' + } + instance = createComponentInstance( rootComponent, rootProps, @@ -128,17 +134,22 @@ export function createVaporApp( context, ) setupComponent(instance) - render(instance, rootContainer) + render(instance, container) - app._container = rootContainer + app._container = container // for devtools and telemetry - ;(rootContainer as any).__vue_app__ = app + ;(container as any).__vue_app__ = app if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { app._instance = instance devtoolsInitApp(app, version) } + if (container instanceof Element) { + container.removeAttribute('v-cloak') + container.setAttribute('data-v-app', '') + } + return instance } else if (__DEV__) { warn( diff --git a/packages/runtime-vapor/src/apiRender.ts b/packages/runtime-vapor/src/apiRender.ts index d828c3702..db4eed533 100644 --- a/packages/runtime-vapor/src/apiRender.ts +++ b/packages/runtime-vapor/src/apiRender.ts @@ -5,7 +5,7 @@ import { setCurrentInstance, validateComponentName, } from './component' -import { insert, querySelector, remove } from './dom/element' +import { insert, querySelector } from './dom/element' import { flushPostFlushCbs, queuePostFlushCb } from './scheduler' import { invokeLifecycle } from './componentLifecycle' import { VaporLifecycleHooks } from './enums' @@ -153,13 +153,13 @@ function mountComponent( } export function unmountComponent(instance: ComponentInternalInstance): void { - const { container, block, scope } = instance + const { container, scope } = instance // hook: beforeUnmount invokeLifecycle(instance, VaporLifecycleHooks.BEFORE_UNMOUNT, 'beforeUnmount') scope.stop() - block && remove(block, container) + container.textContent = '' // hook: unmounted invokeLifecycle( From c84986433741169b800fac22d42704d8efbce518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sun, 6 Oct 2024 11:22:54 +0800 Subject: [PATCH 040/101] fix(runtime-shared): dedupe deps --- packages/runtime-shared/package.json | 5 ++++- pnpm-lock.yaml | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/runtime-shared/package.json b/packages/runtime-shared/package.json index a23e6140e..af152cf3b 100644 --- a/packages/runtime-shared/package.json +++ b/packages/runtime-shared/package.json @@ -43,5 +43,8 @@ "bugs": { "url": "https://github.com/vuejs/vue-vapor/issues" }, - "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-shared#readme" + "homepage": "https://github.com/vuejs/vue-vapor/tree/main/packages/runtime-shared#readme", + "dependencies": { + "@vue/shared": "workspace:*" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 631c4139b..60a066b33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -425,7 +425,11 @@ importers: specifier: ^2.0.7 version: 2.0.7 - packages/runtime-shared: {} + packages/runtime-shared: + dependencies: + '@vue/shared': + specifier: workspace:* + version: link:../shared packages/runtime-test: dependencies: From f7cbea2111c7770a180b640f36f6a5d4d6abc698 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:33:18 +0800 Subject: [PATCH 041/101] fix(deps): update dependency monaco-editor to ^0.52.0 (#12119) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages-private/template-explorer/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages-private/template-explorer/package.json b/packages-private/template-explorer/package.json index a5ad38c1a..e8bdf0bcc 100644 --- a/packages-private/template-explorer/package.json +++ b/packages-private/template-explorer/package.json @@ -11,7 +11,7 @@ "enableNonBrowserBranches": true }, "dependencies": { - "monaco-editor": "^0.51.0", + "monaco-editor": "^0.52.0", "source-map-js": "^1.2.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e28c12cd5..dbb6b20e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -226,8 +226,8 @@ importers: packages-private/template-explorer: dependencies: monaco-editor: - specifier: ^0.51.0 - version: 0.51.0 + specifier: ^0.52.0 + version: 0.52.0 source-map-js: specifier: ^1.2.1 version: 1.2.1 @@ -2527,8 +2527,8 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} - monaco-editor@0.51.0: - resolution: {integrity: sha512-xaGwVV1fq343cM7aOYB6lVE4Ugf0UyimdD/x5PWcWBMKENwectaEu77FAN7c5sFiyumqeJdX1RPTh1ocioyDjw==} + monaco-editor@0.52.0: + resolution: {integrity: sha512-OeWhNpABLCeTqubfqLMXGsqf6OmPU6pHM85kF3dhy6kq5hnhuVS1p3VrEW/XhWHc71P2tHyS5JFySD8mgs1crw==} ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -5450,7 +5450,7 @@ snapshots: mitt@3.0.1: {} - monaco-editor@0.51.0: {} + monaco-editor@0.52.0: {} ms@2.0.0: {} From 73a3666deee6c2f969f94f3064ffef358a172a27 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:42:31 +0800 Subject: [PATCH 042/101] chore(deps): update dependency @rollup/plugin-commonjs to v28 (#12120) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index fcbf7c4f4..a5f5466b7 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@babel/parser": "catalog:", "@babel/types": "catalog:", "@rollup/plugin-alias": "^5.1.1", - "@rollup/plugin-commonjs": "^26.0.3", + "@rollup/plugin-commonjs": "^28.0.0", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.3.0", "@rollup/plugin-replace": "5.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dbb6b20e5..82b4919e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,8 +42,8 @@ importers: specifier: ^5.1.1 version: 5.1.1(rollup@4.24.0) '@rollup/plugin-commonjs': - specifier: ^26.0.3 - version: 26.0.3(rollup@4.24.0) + specifier: ^28.0.0 + version: 28.0.0(rollup@4.24.0) '@rollup/plugin-json': specifier: ^6.1.0 version: 6.1.0(rollup@4.24.0) @@ -867,8 +867,8 @@ packages: rollup: optional: true - '@rollup/plugin-commonjs@26.0.3': - resolution: {integrity: sha512-2BJcolt43MY+y5Tz47djHkodCC3c1VKVrBDKpVqHKpQ9z9S158kCCqB8NF6/gzxLdNlYW9abB3Ibh+kOWLp8KQ==} + '@rollup/plugin-commonjs@28.0.0': + resolution: {integrity: sha512-BJcu+a+Mpq476DMXG+hevgPSl56bkUoi88dKT8t3RyUp8kGuOh+2bU8Gs7zXDlu+fyZggnJ+iOBGrb/O1SorYg==} engines: {node: '>=16.0.0 || 14 >= 14.17'} peerDependencies: rollup: ^2.68.0||^3.0.0||^4.0.0 @@ -1974,6 +1974,14 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + fdir@6.4.0: + resolution: {integrity: sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -3758,14 +3766,15 @@ snapshots: optionalDependencies: rollup: 4.24.0 - '@rollup/plugin-commonjs@26.0.3(rollup@4.24.0)': + '@rollup/plugin-commonjs@28.0.0(rollup@4.24.0)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.24.0) commondir: 1.0.1 estree-walker: 2.0.2 - glob: 10.4.5 + fdir: 6.4.0(picomatch@2.3.1) is-reference: 1.2.1 magic-string: 0.30.11 + picomatch: 2.3.1 optionalDependencies: rollup: 4.24.0 @@ -3802,7 +3811,7 @@ snapshots: '@rollup/pluginutils@5.1.0(rollup@4.24.0)': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: @@ -4832,7 +4841,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 esutils@2.0.3: {} @@ -4900,6 +4909,10 @@ snapshots: dependencies: pend: 1.2.0 + fdir@6.4.0(picomatch@2.3.1): + optionalDependencies: + picomatch: 2.3.1 + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -5184,7 +5197,7 @@ snapshots: is-reference@1.2.1: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 is-regex@1.1.4: dependencies: From 723f5887167e3c508deb1b1d4a8b6de4856a94d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:45:08 +0800 Subject: [PATCH 043/101] chore(deps-dev): bump vite from 5.4.0 to 5.4.8 (#12121) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.0 to 5.4.8. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.8/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.8/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pnpm-lock.yaml | 51 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82b4919e4..11746669d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3342,6 +3342,37 @@ packages: terser: optional: true + vite@5.4.8: + resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + vitest@2.1.1: resolution: {integrity: sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -4143,13 +4174,13 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))': + '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4))': dependencies: '@vitest/spy': 2.1.1 estree-walker: 3.0.3 magic-string: 0.30.11 optionalDependencies: - vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) + vite: 5.4.8(@types/node@20.16.10)(sass@1.79.4) '@vitest/pretty-format@2.1.1': dependencies: @@ -6305,7 +6336,7 @@ snapshots: cac: 6.7.14 debug: 4.3.6 pathe: 1.1.2 - vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) + vite: 5.4.8(@types/node@20.16.10)(sass@1.79.4) transitivePeerDependencies: - '@types/node' - less @@ -6327,10 +6358,20 @@ snapshots: fsevents: 2.3.3 sass: 1.79.4 + vite@5.4.8(@types/node@20.16.10)(sass@1.79.4): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.47 + rollup: 4.24.0 + optionalDependencies: + '@types/node': 20.16.10 + fsevents: 2.3.3 + sass: 1.79.4 + vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4): dependencies: '@vitest/expect': 2.1.1 - '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4)) + '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)) '@vitest/pretty-format': 2.1.1 '@vitest/runner': 2.1.1 '@vitest/snapshot': 2.1.1 @@ -6345,7 +6386,7 @@ snapshots: tinyexec: 0.3.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.16.10)(sass@1.79.4) + vite: 5.4.8(@types/node@20.16.10)(sass@1.79.4) vite-node: 2.1.1(@types/node@20.16.10)(sass@1.79.4) why-is-node-running: 2.3.0 optionalDependencies: From 35785f3cd7bd86cbec3f8324022491da2d088b61 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:45:41 +0800 Subject: [PATCH 044/101] chore(deps): update lint (#12118) * chore(deps): update lint * chore: update package name --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: daiwei --- eslint.config.js | 2 +- package.json | 8 +- pnpm-lock.yaml | 372 ++++++++++++++++++++++------------------------- 3 files changed, 180 insertions(+), 202 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 2e752e191..b752b2e19 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,6 @@ import importX from 'eslint-plugin-import-x' import tseslint from 'typescript-eslint' -import vitest from 'eslint-plugin-vitest' +import vitest from '@vitest/eslint-plugin' import { builtinModules } from 'node:module' const DOMGlobals = ['window', 'document'] diff --git a/package.json b/package.json index a5f5466b7..b58d1f73c 100644 --- a/package.json +++ b/package.json @@ -77,9 +77,9 @@ "enquirer": "^2.4.1", "esbuild": "^0.24.0", "esbuild-plugin-polyfill-node": "^0.3.0", - "eslint": "^9.10.0", - "eslint-plugin-import-x": "^4.2.1", - "eslint-plugin-vitest": "^0.5.4", + "eslint": "^9.12.0", + "eslint-plugin-import-x": "^4.3.1", + "@vitest/eslint-plugin": "^1.0.1", "estree-walker": "catalog:", "jsdom": "^25.0.0", "lint-staged": "^15.2.10", @@ -105,7 +105,7 @@ "todomvc-app-css": "^2.4.3", "tslib": "^2.7.0", "typescript": "~5.6.2", - "typescript-eslint": "^8.5.0", + "typescript-eslint": "^8.8.0", "vite": "catalog:", "vitest": "^2.1.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11746669d..5ba6522bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,6 +71,9 @@ importers: '@vitest/coverage-v8': specifier: ^2.1.1 version: 2.1.1(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)) + '@vitest/eslint-plugin': + specifier: ^1.0.1 + version: 1.1.6(@typescript-eslint/utils@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -87,14 +90,11 @@ importers: specifier: ^0.3.0 version: 0.3.0(esbuild@0.24.0) eslint: - specifier: ^9.10.0 - version: 9.10.0 + specifier: ^9.12.0 + version: 9.12.0 eslint-plugin-import-x: - specifier: ^4.2.1 - version: 4.2.1(eslint@9.10.0)(typescript@5.6.2) - eslint-plugin-vitest: - specifier: ^0.5.4 - version: 0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)) + specifier: ^4.3.1 + version: 4.3.1(eslint@9.12.0)(typescript@5.6.2) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -171,8 +171,8 @@ importers: specifier: ~5.6.2 version: 5.6.2 typescript-eslint: - specifier: ^8.5.0 - version: 8.5.0(eslint@9.10.0)(typescript@5.6.2) + specifier: ^8.8.0 + version: 8.8.0(eslint@9.12.0)(typescript@5.6.2) vite: specifier: 'catalog:' version: 5.4.0(@types/node@20.16.10)(sass@1.79.4) @@ -780,28 +780,40 @@ packages: resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.6.0': + resolution: {integrity: sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/eslintrc@3.1.0': resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.10.0': - resolution: {integrity: sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==} + '@eslint/js@9.12.0': + resolution: {integrity: sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.1.0': - resolution: {integrity: sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==} + '@eslint/plugin-kit@0.2.0': + resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@humanfs/core@0.19.0': + resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.5': + resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} + engines: {node: '>=18.18.0'} + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/retry@0.3.0': - resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} + '@humanwhocodes/retry@0.3.1': + resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} '@hutson/parse-repository-url@5.0.0': @@ -1168,6 +1180,9 @@ packages: '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/node@20.16.10': resolution: {integrity: sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==} @@ -1189,8 +1204,8 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@8.5.0': - resolution: {integrity: sha512-lHS5hvz33iUFQKuPFGheAB84LwcJ60G8vKnEhnfcK1l8kGVLro2SFYW6K0/tj8FUhRJ0VHyg1oAfg50QGbPPHw==} + '@typescript-eslint/eslint-plugin@8.8.0': + resolution: {integrity: sha512-wORFWjU30B2WJ/aXBfOm1LX9v9nyt9D3jsSOxC3cCaTQGCW5k4jNpmjFv3U7p/7s4yvdjHzwtv2Sd2dOyhjS0A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -1200,8 +1215,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.5.0': - resolution: {integrity: sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==} + '@typescript-eslint/parser@8.8.0': + resolution: {integrity: sha512-uEFUsgR+tl8GmzmLjRqz+VrDv4eoaMqMXW7ruXfgThaAShO9JTciKpEsB+TvnfFfbg5IpujgMXVV36gOJRLtZg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1210,16 +1225,16 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.18.0': - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@8.5.0': resolution: {integrity: sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.5.0': - resolution: {integrity: sha512-N1K8Ix+lUM+cIDhL2uekVn/ZD7TZW+9/rwz8DclQpcQ9rk4sIL5CAlBC0CugWKREmDjBzI/kQqU4wkg46jWLYA==} + '@typescript-eslint/scope-manager@8.8.0': + resolution: {integrity: sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/type-utils@8.8.0': + resolution: {integrity: sha512-IKwJSS7bCqyCeG4NVGxnOP6lLT9Okc3Zj8hLO96bpMkJab+10HIfJbMouLrlpyOr3yrQ1cA413YPFiGd1mW9/Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1227,25 +1242,25 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.18.0': - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@8.5.0': resolution: {integrity: sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@7.18.0': - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.8.0': + resolution: {integrity: sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.5.0': + resolution: {integrity: sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/typescript-estree@8.5.0': - resolution: {integrity: sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==} + '@typescript-eslint/typescript-estree@8.8.0': + resolution: {integrity: sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1253,26 +1268,26 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.18.0': - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/utils@8.5.0': resolution: {integrity: sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@7.18.0': - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/utils@8.8.0': + resolution: {integrity: sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 '@typescript-eslint/visitor-keys@8.5.0': resolution: {integrity: sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/visitor-keys@8.8.0': + resolution: {integrity: sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitejs/plugin-vue@5.1.2': resolution: {integrity: sha512-nY9IwH12qeiJqumTCLJLE7IiNx7HZ39cbHaysEUd+Myvbz9KAqd2yq+U01Kab1R/H1BmiyM2ShTYlNH32Fzo3A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1289,6 +1304,17 @@ packages: '@vitest/browser': optional: true + '@vitest/eslint-plugin@1.1.6': + resolution: {integrity: sha512-sFuAnD9iycnOzLHHhNCULXeb6ejOSo5Lcq/ODhdlUOoUrXkQPcVeYqXurZMA3neOqf+wNCQ6YuU1zyoYH/WEcg==} + peerDependencies: + '@typescript-eslint/utils': '>= 8.0' + eslint: '>= 8.57.0' + typescript: '>= 5.0.0' + vitest: '*' + peerDependenciesMeta: + typescript: + optional: true + '@vitest/expect@2.1.1': resolution: {integrity: sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==} @@ -1404,10 +1430,6 @@ packages: array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} @@ -1766,10 +1788,6 @@ packages: devtools-protocol@0.0.1330662: resolution: {integrity: sha512-pzh6YQ8zZfz3iKlCvgzVCu22NdpZ8hNmwU6WnQjNVquh0A9iVosPtNLWDwaWVGyrntQlltPFztTMK5Cg6lfCuw==} - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} @@ -1861,39 +1879,26 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-plugin-import-x@4.2.1: - resolution: {integrity: sha512-WWi2GedccIJa0zXxx3WDnTgouGQTtdYK1nhXMwywbqqAgB0Ov+p1pYBsWh3VaB0bvBOwLse6OfVII7jZD9xo5Q==} + eslint-plugin-import-x@4.3.1: + resolution: {integrity: sha512-5TriWkXulDl486XnYYRgsL+VQoS/7mhN/2ci02iLCuL7gdhbiWxnsuL/NTcaKY9fpMgsMFjWZBtIGW7pb+RX0g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - eslint-plugin-vitest@0.5.4: - resolution: {integrity: sha512-um+odCkccAHU53WdKAw39MY61+1x990uXjSPguUCq3VcEHdqJrOb8OTMrbYlY6f9jAKx7x98kLVlIe3RJeJqoQ==} - engines: {node: ^18.0.0 || >= 20.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': '*' - eslint: ^8.57.0 || ^9.0.0 - vitest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - vitest: - optional: true - - eslint-scope@8.0.2: - resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} + eslint-scope@8.1.0: + resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.0.0: - resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} + eslint-visitor-keys@4.1.0: + resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.10.0: - resolution: {integrity: sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==} + eslint@9.12.0: + resolution: {integrity: sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1902,8 +1907,8 @@ packages: jiti: optional: true - espree@10.1.0: - resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} + espree@10.2.0: + resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -2096,10 +2101,6 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} @@ -2265,10 +2266,6 @@ packages: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} - is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - is-port-reachable@4.0.0: resolution: {integrity: sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -2683,10 +2680,6 @@ packages: path-to-regexp@2.2.1: resolution: {integrity: sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -3026,10 +3019,6 @@ packages: resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} hasBin: true - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} @@ -3242,8 +3231,8 @@ packages: typed-query-selector@2.12.0: resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==} - typescript-eslint@8.5.0: - resolution: {integrity: sha512-uD+XxEoSIvqtm4KE97etm32Tn5MfaZWgWfMMREStLxR6JzvHkc2Tkj7zhTEK5XmtpTmKHNnG8Sot6qDfhHtR1Q==} + typescript-eslint@8.8.0: + resolution: {integrity: sha512-BjIT/VwJ8+0rVO01ZQ2ZVnjE1svFBiRczcpr1t1Yxt7sT25VSbPfrJtDsQ8uQTy2pilX5nI9gwxhUyLULNentw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -3692,9 +3681,9 @@ snapshots: '@esbuild/win32-x64@0.24.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.10.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.12.0)': dependencies: - eslint: 9.10.0 + eslint: 9.12.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} @@ -3707,11 +3696,13 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/core@0.6.0': {} + '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 debug: 4.3.6 - espree: 10.1.0 + espree: 10.2.0 globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 @@ -3721,17 +3712,24 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.10.0': {} + '@eslint/js@9.12.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.1.0': + '@eslint/plugin-kit@0.2.0': dependencies: levn: 0.4.1 + '@humanfs/core@0.19.0': {} + + '@humanfs/node@0.16.5': + dependencies: + '@humanfs/core': 0.19.0 + '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.0': {} + '@humanwhocodes/retry@0.3.1': {} '@hutson/parse-repository-url@5.0.0': {} @@ -4004,6 +4002,8 @@ snapshots: '@types/hash-sum@1.0.2': {} + '@types/json-schema@7.0.15': {} + '@types/node@20.16.10': dependencies: undici-types: 6.19.6 @@ -4025,15 +4025,15 @@ snapshots: '@types/node': 20.16.10 optional: true - '@typescript-eslint/eslint-plugin@8.5.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0)(typescript@5.6.2))(eslint@9.10.0)(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.5.0(eslint@9.10.0)(typescript@5.6.2) - '@typescript-eslint/scope-manager': 8.5.0 - '@typescript-eslint/type-utils': 8.5.0(eslint@9.10.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.5.0(eslint@9.10.0)(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.5.0 - eslint: 9.10.0 + '@typescript-eslint/parser': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/scope-manager': 8.8.0 + '@typescript-eslint/type-utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/visitor-keys': 8.8.0 + eslint: 9.12.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -4043,33 +4043,33 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.5.0(eslint@9.10.0)(typescript@5.6.2)': + '@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2)': dependencies: - '@typescript-eslint/scope-manager': 8.5.0 - '@typescript-eslint/types': 8.5.0 - '@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2) - '@typescript-eslint/visitor-keys': 8.5.0 + '@typescript-eslint/scope-manager': 8.8.0 + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) + '@typescript-eslint/visitor-keys': 8.8.0 debug: 4.3.6 - eslint: 9.10.0 + eslint: 9.12.0 optionalDependencies: typescript: 5.6.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.18.0': - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/scope-manager@8.5.0': dependencies: '@typescript-eslint/types': 8.5.0 '@typescript-eslint/visitor-keys': 8.5.0 - '@typescript-eslint/type-utils@8.5.0(eslint@9.10.0)(typescript@5.6.2)': + '@typescript-eslint/scope-manager@8.8.0': dependencies: - '@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.5.0(eslint@9.10.0)(typescript@5.6.2) + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/visitor-keys': 8.8.0 + + '@typescript-eslint/type-utils@8.8.0(eslint@9.12.0)(typescript@5.6.2)': + dependencies: + '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) + '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.6.2) optionalDependencies: @@ -4078,16 +4078,16 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@7.18.0': {} - '@typescript-eslint/types@8.5.0': {} - '@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.2)': + '@typescript-eslint/types@8.8.0': {} + + '@typescript-eslint/typescript-estree@8.5.0(typescript@5.6.2)': dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/types': 8.5.0 + '@typescript-eslint/visitor-keys': 8.5.0 debug: 4.3.6 - globby: 11.1.0 + fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 @@ -4097,10 +4097,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.5.0(typescript@5.6.2)': + '@typescript-eslint/typescript-estree@8.8.0(typescript@5.6.2)': dependencies: - '@typescript-eslint/types': 8.5.0 - '@typescript-eslint/visitor-keys': 8.5.0 + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/visitor-keys': 8.8.0 debug: 4.3.6 fast-glob: 3.3.2 is-glob: 4.0.3 @@ -4112,36 +4112,36 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@9.10.0)(typescript@5.6.2)': + '@typescript-eslint/utils@8.5.0(eslint@9.12.0)(typescript@5.6.2)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2) - eslint: 9.10.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) + '@typescript-eslint/scope-manager': 8.5.0 + '@typescript-eslint/types': 8.5.0 + '@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2) + eslint: 9.12.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.5.0(eslint@9.10.0)(typescript@5.6.2)': + '@typescript-eslint/utils@8.8.0(eslint@9.12.0)(typescript@5.6.2)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0) - '@typescript-eslint/scope-manager': 8.5.0 - '@typescript-eslint/types': 8.5.0 - '@typescript-eslint/typescript-estree': 8.5.0(typescript@5.6.2) - eslint: 9.10.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) + '@typescript-eslint/scope-manager': 8.8.0 + '@typescript-eslint/types': 8.8.0 + '@typescript-eslint/typescript-estree': 8.8.0(typescript@5.6.2) + eslint: 9.12.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.18.0': + '@typescript-eslint/visitor-keys@8.5.0': dependencies: - '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/types': 8.5.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.5.0': + '@typescript-eslint/visitor-keys@8.8.0': dependencies: - '@typescript-eslint/types': 8.5.0 + '@typescript-eslint/types': 8.8.0 eslint-visitor-keys: 3.4.3 '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@20.16.10)(sass@1.79.4))(vue@packages+vue)': @@ -4167,6 +4167,14 @@ snapshots: transitivePeerDependencies: - supports-color + '@vitest/eslint-plugin@1.1.6(@typescript-eslint/utils@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4))': + dependencies: + '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + eslint: 9.12.0 + vitest: 2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4) + optionalDependencies: + typescript: 5.6.2 + '@vitest/expect@2.1.1': dependencies: '@vitest/spy': 2.1.1 @@ -4280,8 +4288,6 @@ snapshots: array-ify@1.0.0: {} - array-union@2.1.0: {} - asap@2.0.6: {} assert-never@1.3.0: {} @@ -4645,10 +4651,6 @@ snapshots: devtools-protocol@0.0.1330662: {} - dir-glob@3.0.1: - dependencies: - path-type: 4.0.0 - doctrine@3.0.0: dependencies: esutils: 2.0.3 @@ -4775,12 +4777,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import-x@4.2.1(eslint@9.10.0)(typescript@5.6.2): + eslint-plugin-import-x@4.3.1(eslint@9.12.0)(typescript@5.6.2): dependencies: - '@typescript-eslint/utils': 8.5.0(eslint@9.10.0)(typescript@5.6.2) + '@typescript-eslint/utils': 8.5.0(eslint@9.12.0)(typescript@5.6.2) debug: 4.3.6 doctrine: 3.0.0 - eslint: 9.10.0 + eslint: 9.12.0 eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.6 is-glob: 4.0.3 @@ -4792,44 +4794,37 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.10.0)(typescript@5.6.2)(vitest@2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4)): - dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.10.0)(typescript@5.6.2) - eslint: 9.10.0 - optionalDependencies: - vitest: 2.1.1(@types/node@20.16.10)(jsdom@25.0.0)(sass@1.79.4) - transitivePeerDependencies: - - supports-color - - typescript - - eslint-scope@8.0.2: + eslint-scope@8.1.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.0.0: {} + eslint-visitor-keys@4.1.0: {} - eslint@9.10.0: + eslint@9.12.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.10.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.18.0 + '@eslint/core': 0.6.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.10.0 - '@eslint/plugin-kit': 0.1.0 + '@eslint/js': 9.12.0 + '@eslint/plugin-kit': 0.2.0 + '@humanfs/node': 0.16.5 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.0 - '@nodelib/fs.walk': 1.2.8 + '@humanwhocodes/retry': 0.3.1 + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.6 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.2 - eslint-visitor-keys: 4.0.0 - espree: 10.1.0 + eslint-scope: 8.1.0 + eslint-visitor-keys: 4.1.0 + espree: 10.2.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -4839,22 +4834,20 @@ snapshots: ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 json-stable-stringify-without-jsonify: 1.0.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - strip-ansi: 6.0.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color - espree@10.1.0: + espree@10.2.0: dependencies: acorn: 8.12.1 acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.0.0 + eslint-visitor-keys: 4.1.0 esprima@4.0.1: {} @@ -5073,15 +5066,6 @@ snapshots: globals@14.0.0: {} - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 3.0.0 - gopd@1.0.1: dependencies: get-intrinsic: 1.2.4 @@ -5218,8 +5202,6 @@ snapshots: is-obj@2.0.0: {} - is-path-inside@3.0.3: {} - is-port-reachable@4.0.0: {} is-potential-custom-element-name@1.0.1: {} @@ -5642,8 +5624,6 @@ snapshots: path-to-regexp@2.2.1: {} - path-type@4.0.0: {} - pathe@1.1.2: {} pathval@2.0.0: {} @@ -6077,8 +6057,6 @@ snapshots: simple-git-hooks@2.11.1: {} - slash@3.0.0: {} - slice-ansi@5.0.0: dependencies: ansi-styles: 6.2.1 @@ -6275,11 +6253,11 @@ snapshots: typed-query-selector@2.12.0: {} - typescript-eslint@8.5.0(eslint@9.10.0)(typescript@5.6.2): + typescript-eslint@8.8.0(eslint@9.12.0)(typescript@5.6.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.5.0(@typescript-eslint/parser@8.5.0(eslint@9.10.0)(typescript@5.6.2))(eslint@9.10.0)(typescript@5.6.2) - '@typescript-eslint/parser': 8.5.0(eslint@9.10.0)(typescript@5.6.2) - '@typescript-eslint/utils': 8.5.0(eslint@9.10.0)(typescript@5.6.2) + '@typescript-eslint/eslint-plugin': 8.8.0(@typescript-eslint/parser@8.8.0(eslint@9.12.0)(typescript@5.6.2))(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/parser': 8.8.0(eslint@9.12.0)(typescript@5.6.2) + '@typescript-eslint/utils': 8.8.0(eslint@9.12.0)(typescript@5.6.2) optionalDependencies: typescript: 5.6.2 transitivePeerDependencies: From 2ed0be80209d6b3148b257aac91358a8d8c057a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Mon, 7 Oct 2024 13:14:18 +0800 Subject: [PATCH 045/101] fix(compiler-vapor): quote slot name --- .../__snapshots__/compile.spec.ts.snap | 2 +- .../__snapshots__/vSlot.spec.ts.snap | 30 ++++++++++++++----- .../__tests__/transforms/vSlot.spec.ts | 8 +++++ .../src/generators/component.ts | 2 +- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap b/packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap index 533252b6b..95bd002d2 100644 --- a/packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap +++ b/packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap @@ -35,7 +35,7 @@ export function render(_ctx) { const _directive_test = _resolveDirective("test") const n4 = _createComponent(_component_Comp, null, [ { - default: () => { + "default": () => { const n0 = _createIf(() => (true), () => { const n3 = t0() const n2 = _createComponent(_component_Bar) diff --git a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap index 518b4408b..454104a43 100644 --- a/packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap +++ b/packages/compiler-vapor/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap @@ -102,7 +102,7 @@ export function render(_ctx) { const _component_Comp = _resolveComponent("Comp") const n1 = _createComponent(_component_Comp, null, [ { - default: () => { + "default": () => { const n0 = t0() return n0 } @@ -122,11 +122,11 @@ export function render(_ctx) { const _component_Comp = _resolveComponent("Comp") const n4 = _createComponent(_component_Comp, null, [ { - one: () => { + "one": () => { const n0 = t0() return n0 }, - default: () => { + "default": () => { const n2 = t1() const n3 = t2() return [n2, n3] @@ -146,11 +146,11 @@ export function render(_ctx) { const _component_Comp = _resolveComponent("Comp") const n5 = _createComponent(_component_Comp, null, [ { - default: _withDestructure(({ foo }) => [foo], (_ctx0) => { + "default": _withDestructure(({ foo }) => [foo], (_ctx0) => { const n2 = t0() const n1 = _createComponent(_component_Inner, null, [ { - default: _withDestructure(({ bar }) => [bar], (_ctx1) => { + "default": _withDestructure(({ bar }) => [bar], (_ctx1) => { const n0 = _createTextNode(() => [_ctx0[0] + _ctx1[0] + _ctx.baz]) return n0 }) @@ -190,7 +190,7 @@ export function render(_ctx) { const _component_Comp = _resolveComponent("Comp") const n1 = _createComponent(_component_Comp, null, [ { - named: _withDestructure(({ foo }) => [foo], (_ctx0) => { + "named": _withDestructure(({ foo }) => [foo], (_ctx0) => { const n0 = _createTextNode(() => [_ctx0[0] + _ctx.bar]) return n0 }) @@ -207,7 +207,7 @@ export function render(_ctx) { const _component_Comp = _resolveComponent("Comp") const n1 = _createComponent(_component_Comp, null, [ { - default: _withDestructure(({ foo }) => [foo], (_ctx0) => { + "default": _withDestructure(({ foo }) => [foo], (_ctx0) => { const n0 = _createTextNode(() => [_ctx0[0] + _ctx.bar]) return n0 }) @@ -216,3 +216,19 @@ export function render(_ctx) { return n1 }" `; + +exports[`compiler: transform slot > quote slot name 1`] = ` +"import { resolveComponent as _resolveComponent, createComponent as _createComponent } from 'vue/vapor'; + +export function render(_ctx) { + const _component_Comp = _resolveComponent("Comp") + const n1 = _createComponent(_component_Comp, null, [ + { + "nav-bar-title-before": () => { + return null + } + } + ], true) + return n1 +}" +`; diff --git a/packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts b/packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts index b5445d60e..a018c7b5e 100644 --- a/packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts +++ b/packages/compiler-vapor/__tests__/transforms/vSlot.spec.ts @@ -398,6 +398,14 @@ describe('compiler: transform slot', () => { ]) }) + test('quote slot name', () => { + const { code } = compileWithSlots( + ``, + ) + expect(code).toMatchSnapshot() + expect(code).contains(`"nav-bar-title-before"`) + }) + describe('errors', () => { test('error on extraneous children w/ named default slot', () => { const onError = vi.fn() diff --git a/packages/compiler-vapor/src/generators/component.ts b/packages/compiler-vapor/src/generators/component.ts index 5971d50c5..8b2534b9f 100644 --- a/packages/compiler-vapor/src/generators/component.ts +++ b/packages/compiler-vapor/src/generators/component.ts @@ -175,7 +175,7 @@ function genStaticSlots({ slots }: IRSlotsStatic, context: CodegenContext) { return genMulti( DELIMITERS_OBJECT_NEWLINE, ...names.map(name => [ - `${name}: `, + `${JSON.stringify(name)}: `, ...genSlotBlockWithProps(slots[name], context), ]), ) From e16e9a7341e7cfb3c443da4e5e5b06e8158712c3 Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 11 Oct 2024 09:52:06 +0800 Subject: [PATCH 046/101] fix(custom-element): properly remove hyphenated attribute (#12143) close #12139 --- .../__tests__/customElement.spec.ts | 35 +++++++++++++++++++ packages/runtime-dom/src/modules/props.ts | 3 +- packages/runtime-dom/src/patchProp.ts | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/runtime-dom/__tests__/customElement.spec.ts b/packages/runtime-dom/__tests__/customElement.spec.ts index ef5051f42..6b9f7d139 100644 --- a/packages/runtime-dom/__tests__/customElement.spec.ts +++ b/packages/runtime-dom/__tests__/customElement.spec.ts @@ -1386,4 +1386,39 @@ describe('defineCustomElement', () => { await nextTick() expect(e.shadowRoot!.innerHTML).toBe(`false,boolean`) }) + + test('hyphenated attr removal', async () => { + const E = defineCustomElement({ + props: { + fooBar: { + type: Boolean, + }, + }, + render() { + return this.fooBar + }, + }) + customElements.define('el-hyphenated-attr-removal', E) + const toggle = ref(true) + const Comp = { + render() { + return h('el-hyphenated-attr-removal', { + 'foo-bar': toggle.value ? '' : null, + }) + }, + } + render(h(Comp), container) + const el = container.children[0] + expect(el.hasAttribute('foo-bar')).toBe(true) + expect((el as any).outerHTML).toBe( + ``, + ) + + toggle.value = false + await nextTick() + expect(el.hasAttribute('foo-bar')).toBe(false) + expect((el as any).outerHTML).toBe( + ``, + ) + }) }) diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index 93d45c9e1..98608831a 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -8,6 +8,7 @@ export function patchDOMProp( key: string, value: any, parentComponent: any, + attrName?: string, ): void { // __UNSAFE__ // Reason: potentially setting innerHTML. @@ -106,5 +107,5 @@ export function patchDOMProp( ) } } - needRemove && el.removeAttribute(key) + needRemove && el.removeAttribute(attrName || key) } diff --git a/packages/runtime-dom/src/patchProp.ts b/packages/runtime-dom/src/patchProp.ts index 5814e77c4..b6af89971 100644 --- a/packages/runtime-dom/src/patchProp.ts +++ b/packages/runtime-dom/src/patchProp.ts @@ -62,7 +62,7 @@ export const patchProp: DOMRendererOptions['patchProp'] = ( (el as VueElement)._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue)) ) { - patchDOMProp(el, camelize(key), nextValue, parentComponent) + patchDOMProp(el, camelize(key), nextValue, parentComponent, key) } else { // special case for with // :true-value & :false-value From d9d4d4e158cd51a9ddda249f29de8467f60b2792 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 11 Oct 2024 10:28:54 +0800 Subject: [PATCH 047/101] fix(runtime-core): allow symbol values for slot prop key (#12069) close #12068 --- .../__tests__/helpers/renderSlot.spec.ts | 6 ++++++ packages/runtime-core/src/helpers/renderSlot.ts | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts index c4ae077ba..bc0678b51 100644 --- a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts +++ b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts @@ -32,6 +32,12 @@ describe('renderSlot', () => { expect(vnode.key).toBe('foo') }) + it('should allow symbol values for slot prop key', () => { + const key = Symbol() + const vnode = renderSlot({ default: () => [h('div')] }, 'default', { key }) + expect(vnode.key).toBe('_default') + }) + it('should render slot fallback', () => { const vnode = renderSlot({}, 'default', { key: 'foo' }, () => ['fallback']) expect(vnode.children).toEqual(['fallback']) diff --git a/packages/runtime-core/src/helpers/renderSlot.ts b/packages/runtime-core/src/helpers/renderSlot.ts index 2cb266ef1..92f7dab36 100644 --- a/packages/runtime-core/src/helpers/renderSlot.ts +++ b/packages/runtime-core/src/helpers/renderSlot.ts @@ -14,7 +14,7 @@ import { isVNode, openBlock, } from '../vnode' -import { PatchFlags, SlotFlags } from '@vue/shared' +import { PatchFlags, SlotFlags, isSymbol } from '@vue/shared' import { warn } from '../warning' import { isAsyncWrapper } from '../apiAsyncComponent' @@ -72,15 +72,16 @@ export function renderSlot( } openBlock() const validSlotContent = slot && ensureValidVNode(slot(props)) + const slotKey = + props.key || + // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + (validSlotContent && (validSlotContent as any).key) const rendered = createBlock( Fragment, { key: - (props.key || - // slot content array of a dynamic conditional slot may have a branch - // key attached in the `createSlots` helper, respect that - (validSlotContent && (validSlotContent as any).key) || - `_${name}`) + + (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content (!validSlotContent && fallback ? '_fb' : ''), }, From 704173e24276706de672cca6c9507e4dd9651197 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 11 Oct 2024 10:30:09 +0800 Subject: [PATCH 048/101] fix(types): ensure `this.$props` type does not include `string` (#12123) close #12122 --- packages-private/dts-test/defineComponent.test-d.tsx | 10 ++++++++++ packages/runtime-core/src/apiDefineComponent.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages-private/dts-test/defineComponent.test-d.tsx b/packages-private/dts-test/defineComponent.test-d.tsx index 9b4c18471..fda3ca485 100644 --- a/packages-private/dts-test/defineComponent.test-d.tsx +++ b/packages-private/dts-test/defineComponent.test-d.tsx @@ -2068,3 +2068,13 @@ expectString(instance.actionText) // public prop on $props should be optional // @ts-expect-error expectString(instance.$props.actionText) + +// #12122 +defineComponent({ + props: { foo: String }, + render() { + expectType<{ readonly foo?: string }>(this.$props) + // @ts-expect-error + expectType(this.$props) + }, +}) diff --git a/packages/runtime-core/src/apiDefineComponent.ts b/packages/runtime-core/src/apiDefineComponent.ts index 9ae6b41a4..2ce870f01 100644 --- a/packages/runtime-core/src/apiDefineComponent.ts +++ b/packages/runtime-core/src/apiDefineComponent.ts @@ -265,7 +265,7 @@ export function defineComponent< Mixin, Extends, ResolvedEmits, - RuntimeEmitsKeys, + {}, {}, false, InjectOptions, From e0a591e1cdf842631104f16ce5753e487c08e439 Mon Sep 17 00:00:00 2001 From: w2xi <57785259+w2xi@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:31:01 +0800 Subject: [PATCH 049/101] chore(sfc-playground): adjust the tooltip text for toggling the theme (#12116) * chore(sfc-playground): adjust the tooltip text for toggling the theme * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- packages-private/sfc-playground/src/App.vue | 1 + packages-private/sfc-playground/src/Header.vue | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages-private/sfc-playground/src/App.vue b/packages-private/sfc-playground/src/App.vue index c9295d41b..d163b1a3e 100644 --- a/packages-private/sfc-playground/src/App.vue +++ b/packages-private/sfc-playground/src/App.vue @@ -123,6 +123,7 @@ onMounted(() => { :prod="productionMode" :ssr="useSSRMode" :autoSave="autoSave" + :theme="theme" @toggle-theme="toggleTheme" @toggle-prod="toggleProdMode" @toggle-ssr="toggleSSR" diff --git a/packages-private/sfc-playground/src/Header.vue b/packages-private/sfc-playground/src/Header.vue index 2778724b0..aea6c022a 100644 --- a/packages-private/sfc-playground/src/Header.vue +++ b/packages-private/sfc-playground/src/Header.vue @@ -15,6 +15,7 @@ const props = defineProps<{ prod: boolean ssr: boolean autoSave: boolean + theme: 'dark' | 'light' }>() const emit = defineEmits([ 'toggle-theme', @@ -117,7 +118,11 @@ function toggleDark() { > {{ autoSave ? 'AutoSave ON' : 'AutoSave OFF' }} - From f1a4f67aedfe83e440c54222213f070774faa421 Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 11 Oct 2024 10:34:28 +0800 Subject: [PATCH 050/101] fix(transition/ssr): make transition appear work with Suspense in SSR (#12047) close #12046 --- .../runtime-core/__tests__/hydration.spec.ts | 30 +++++++++++++++++++ packages/runtime-core/src/hydration.ts | 5 +++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index c98f1f473..a1fb8cde3 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -1613,6 +1613,36 @@ describe('SSR hydration', () => { `) }) + test('Suspense + transition appear', async () => { + const { vnode, container } = mountWithHydration( + ``, + () => + h(Suspense, {}, () => + h( + Transition, + { appear: true }, + { + default: () => h('div', 'foo'), + }, + ), + ), + ) + + expect(vnode.el).toBe(container.firstChild) + // wait for hydration to finish + await new Promise(r => setTimeout(r)) + + expect(container.firstChild).toMatchInlineSnapshot(` +
+ foo +
+ `) + await nextTick() + expect(vnode.el).toBe(container.firstChild) + }) + // #10607 test('update component stable slot (prod + optimized mode)', async () => { __DEV__ = false diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 82972e171..c49db529c 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -385,7 +385,10 @@ export function createHydrationFunctions( let needCallTransitionHooks = false if (isTemplateNode(el)) { needCallTransitionHooks = - needTransition(parentSuspense, transition) && + needTransition( + null, // no need check parentSuspense in hydration + transition, + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear From c0418a3b8fa96a0b108ab71b7aab5d3388f90557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:35:57 +0800 Subject: [PATCH 051/101] fix(defineModel): handle kebab-case model correctly (#12063) close #12060 --- .../runtime-core/__tests__/helpers/useModel.spec.ts | 12 ++++++------ packages/runtime-core/src/helpers/useModel.ts | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/useModel.spec.ts b/packages/runtime-core/__tests__/helpers/useModel.spec.ts index 3c724b0ba..8d31848e1 100644 --- a/packages/runtime-core/__tests__/helpers/useModel.spec.ts +++ b/packages/runtime-core/__tests__/helpers/useModel.spec.ts @@ -153,10 +153,10 @@ describe('useModel', () => { const compRender = vi.fn() const Comp = defineComponent({ - props: ['fooBar'], - emits: ['update:fooBar'], + props: ['foo-bar'], + emits: ['update:foo-bar'], setup(props) { - foo = useModel(props, 'fooBar') + foo = useModel(props, 'foo-bar') return () => { compRender() return foo.value @@ -192,10 +192,10 @@ describe('useModel', () => { const compRender = vi.fn() const Comp = defineComponent({ - props: ['fooBar'], - emits: ['update:fooBar'], + props: ['foo-bar'], + emits: ['update:foo-bar'], setup(props) { - foo = useModel(props, 'fooBar') + foo = useModel(props, 'foo-bar') return () => { compRender() return foo.value diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index 37fd1d719..c40938ead 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -28,14 +28,14 @@ export function useModel( return ref() as any } - if (__DEV__ && !(i.propsOptions[0] as NormalizedProps)[name]) { + const camelizedName = camelize(name) + if (__DEV__ && !(i.propsOptions[0] as NormalizedProps)[camelizedName]) { warn(`useModel() called with prop "${name}" which is not declared.`) return ref() as any } - const camelizedName = camelize(name) const hyphenatedName = hyphenate(name) - const modifiers = getModelModifiers(props, name) + const modifiers = getModelModifiers(props, camelizedName) const res = customRef((track, trigger) => { let localValue: any @@ -43,7 +43,7 @@ export function useModel( let prevEmittedValue: any watchSyncEffect(() => { - const propValue = props[name] + const propValue = props[camelizedName] if (hasChanged(localValue, propValue)) { localValue = propValue trigger() From 7ad289e1e7fea654524008ff91e43a8b8a55ef22 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 11 Oct 2024 10:39:08 +0800 Subject: [PATCH 052/101] fix(reactivity): trigger reactivity for Map key `undefined` (#12055) close #12054 --- packages/reactivity/__tests__/reactive.spec.ts | 10 ++++++++++ packages/reactivity/src/dep.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/reactivity/__tests__/reactive.spec.ts b/packages/reactivity/__tests__/reactive.spec.ts index 47f6aa297..aabd95456 100644 --- a/packages/reactivity/__tests__/reactive.spec.ts +++ b/packages/reactivity/__tests__/reactive.spec.ts @@ -409,4 +409,14 @@ describe('reactivity/reactive', () => { e.effect.stop() expect(targetMap.get(obj)?.get('x')).toBeFalsy() }) + + test('should trigger reactivity when Map key is undefined', () => { + const map = reactive(new Map()) + const c = computed(() => map.get(void 0)) + + expect(c.value).toBe(void 0) + + map.set(void 0, 1) + expect(c.value).toBe(1) + }) }) diff --git a/packages/reactivity/src/dep.ts b/packages/reactivity/src/dep.ts index 7e4048743..196c2aaf9 100644 --- a/packages/reactivity/src/dep.ts +++ b/packages/reactivity/src/dep.ts @@ -340,7 +340,7 @@ export function trigger( }) } else { // schedule runs for SET | ADD | DELETE - if (key !== void 0) { + if (key !== void 0 || depsMap.has(void 0)) { run(depsMap.get(key)) } From f6d99262364b7444ebab8742158599e8cdd79eaa Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 11 Oct 2024 10:41:55 +0800 Subject: [PATCH 053/101] fix(compiler-dom): avoid stringify option with null value (#12096) close #12093 --- .../__snapshots__/stringifyStatic.spec.ts.snap | 17 +++++++++++++++++ .../transforms/stringifyStatic.spec.ts | 11 +++++++++++ .../src/transforms/stringifyStatic.ts | 3 +-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap index 78b576af5..a863eb32e 100644 --- a/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap +++ b/packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap @@ -32,6 +32,23 @@ return function render(_ctx, _cache) { }" `; +exports[`stringify static html > should bail for