From de174e1aa756508c7542605a448e55a373afb1ed Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 11 Jul 2024 16:59:55 +0800 Subject: [PATCH 01/61] fix(defineModel): force local update when setter results in same emitted value fix #10279 fix #10301 --- .../__tests__/helpers/useModel.spec.ts | 86 +++++++++++++++++++ packages/runtime-core/src/componentEmits.ts | 13 ++- packages/runtime-core/src/helpers/useModel.ts | 34 ++++++-- 3 files changed, 120 insertions(+), 13 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/useModel.spec.ts b/packages/runtime-core/__tests__/helpers/useModel.spec.ts index c02af337b87..f5b2a0108b0 100644 --- a/packages/runtime-core/__tests__/helpers/useModel.spec.ts +++ b/packages/runtime-core/__tests__/helpers/useModel.spec.ts @@ -1,6 +1,7 @@ import { Fragment, type Ref, + type TestElement, createApp, createBlock, createElementBlock, @@ -526,4 +527,89 @@ describe('useModel', () => { await nextTick() expect(msg.value).toBe('UGHH') }) + + // #10279 + test('force local update when setter formats value to the same value', async () => { + let childMsg: Ref + let childModifiers: Record + + const compRender = vi.fn() + const parentRender = vi.fn() + + const Comp = defineComponent({ + props: ['msg', 'msgModifiers'], + emits: ['update:msg'], + setup(props) { + ;[childMsg, childModifiers] = useModel(props, 'msg', { + set(val) { + if (childModifiers.number) { + return val.replace(/\D+/g, '') + } + }, + }) + return () => { + compRender() + return h('input', { + // simulate how v-model works + onVnodeBeforeMount(vnode) { + ;(vnode.el as TestElement).props.value = childMsg.value + }, + onVnodeBeforeUpdate(vnode) { + ;(vnode.el as TestElement).props.value = childMsg.value + }, + onInput(value: any) { + childMsg.value = value + }, + }) + } + }, + }) + + const msg = ref(1) + const Parent = defineComponent({ + setup() { + return () => { + parentRender() + return h(Comp, { + msg: msg.value, + msgModifiers: { number: true }, + 'onUpdate:msg': val => { + msg.value = val + }, + }) + } + }, + }) + + const root = nodeOps.createElement('div') + render(h(Parent), root) + + expect(parentRender).toHaveBeenCalledTimes(1) + expect(compRender).toHaveBeenCalledTimes(1) + expect(serializeInner(root)).toBe('') + + const input = root.children[0] as TestElement + + // simulate v-model update + input.props.onInput((input.props.value = '2')) + await nextTick() + expect(msg.value).toBe(2) + expect(parentRender).toHaveBeenCalledTimes(2) + expect(compRender).toHaveBeenCalledTimes(2) + expect(serializeInner(root)).toBe('') + + input.props.onInput((input.props.value = '2a')) + await nextTick() + expect(msg.value).toBe(2) + expect(parentRender).toHaveBeenCalledTimes(2) + // should force local update + expect(compRender).toHaveBeenCalledTimes(3) + expect(serializeInner(root)).toBe('') + + input.props.onInput((input.props.value = '2a')) + await nextTick() + expect(parentRender).toHaveBeenCalledTimes(2) + // should not force local update if set to the same value + expect(compRender).toHaveBeenCalledTimes(3) + }) }) diff --git a/packages/runtime-core/src/componentEmits.ts b/packages/runtime-core/src/componentEmits.ts index 4551235bc5a..b6589b92227 100644 --- a/packages/runtime-core/src/componentEmits.ts +++ b/packages/runtime-core/src/componentEmits.ts @@ -28,6 +28,7 @@ import { compatModelEmit, compatModelEventPrefix, } from './compat/componentVModel' +import { getModelModifiers } from './helpers/useModel' export type ObjectEmitsOptions = Record< string, @@ -125,16 +126,12 @@ export function emit( const isModelListener = event.startsWith('update:') // for v-model update:xxx events, apply modifiers on args - const modelArg = isModelListener && event.slice(7) - if (modelArg && modelArg in props) { - const modifiersKey = `${ - modelArg === 'modelValue' ? 'model' : modelArg - }Modifiers` - const { number, trim } = props[modifiersKey] || EMPTY_OBJ - if (trim) { + const modifiers = isModelListener && getModelModifiers(props, event.slice(7)) + if (modifiers) { + if (modifiers.trim) { args = rawArgs.map(a => (isString(a) ? a.trim() : a)) } - if (number) { + if (modifiers.number) { args = rawArgs.map(looseToNumber) } } diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index f6fbca554a7..38f004bb535 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -29,9 +29,13 @@ export function useModel( const camelizedName = camelize(name) const hyphenatedName = hyphenate(name) + const modifiers = getModelModifiers(props, name) const res = customRef((track, trigger) => { let localValue: any + let prevSetValue: any + let prevEmittedValue: any + watchSyncEffect(() => { const propValue = props[name] if (hasChanged(localValue, propValue)) { @@ -39,11 +43,13 @@ export function useModel( trigger() } }) + return { get() { track() return options.get ? options.get(localValue) : localValue }, + set(value) { const rawProps = i.vnode!.props if ( @@ -59,24 +65,36 @@ export function useModel( ) && hasChanged(value, localValue) ) { + // no v-model, local update localValue = value trigger() } - i.emit(`update:${name}`, options.set ? options.set(value) : value) + const emittedValue = options.set ? options.set(value) : value + i.emit(`update:${name}`, emittedValue) + // #10279: if the local value is converted via a setter but the value + // emitted to parent was the same, the parent will not trigger any + // updates and there will be no prop sync. However the local input state + // may be out of sync, so we need to force an update here. + if ( + value !== emittedValue && + value !== prevSetValue && + emittedValue === prevEmittedValue + ) { + trigger() + } + prevSetValue = value + prevEmittedValue = emittedValue }, } }) - const modifierKey = - name === 'modelValue' ? 'modelModifiers' : `${name}Modifiers` - // @ts-expect-error res[Symbol.iterator] = () => { let i = 0 return { next() { if (i < 2) { - return { value: i++ ? props[modifierKey] || {} : res, done: false } + return { value: i++ ? modifiers || EMPTY_OBJ : res, done: false } } else { return { done: true } } @@ -86,3 +104,9 @@ export function useModel( return res } + +export const getModelModifiers = ( + props: Record, + modelName: string, +): Record | undefined => + props[`${modelName === 'modelValue' ? 'model' : modelName}Modifiers`] From 23cd61423c1201eb948a21d6be0a8b9049080ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E9=9B=BE=E4=B8=89=E8=AF=AD?= <32354856+baiwusanyu-c@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:30:41 +0800 Subject: [PATCH 02/61] chore(repl): avoid duplicate formatter mounts (#10472) close #10466 --- packages/runtime-core/src/customFormatter.ts | 1 + packages/sfc-playground/src/App.vue | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/customFormatter.ts b/packages/runtime-core/src/customFormatter.ts index abd3a329922..9cda478345c 100644 --- a/packages/runtime-core/src/customFormatter.ts +++ b/packages/runtime-core/src/customFormatter.ts @@ -24,6 +24,7 @@ export function initCustomFormatter() { // custom formatter for Chrome // https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html const formatter = { + __vue_custom_formatter: true, header(obj: unknown) { // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup if (!isObject(obj)) { diff --git a/packages/sfc-playground/src/App.vue b/packages/sfc-playground/src/App.vue index 4b62519ce6e..7501b200ce8 100644 --- a/packages/sfc-playground/src/App.vue +++ b/packages/sfc-playground/src/App.vue @@ -129,7 +129,13 @@ onMounted(() => { :preview-options="{ customCode: { importCode: `import { initCustomFormatter } from 'vue'`, - useCode: `initCustomFormatter()`, + useCode: `if (window.devtoolsFormatters) { + const index = window.devtoolsFormatters.findIndex((v) => v.__vue_custom_formatter) + window.devtoolsFormatters.splice(index, 1) + initCustomFormatter() + } else { + initCustomFormatter() + }`, }, }" /> From 3d34f406ac7497dafd2f4e62ab23579b78a0e08a Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jul 2024 00:34:05 +0800 Subject: [PATCH 03/61] fix(runtime-core): bail manually rendered compiler slot fragments in all cases Previously this bail was only applied on updates but not on initial mount, and leads to different patch code paths between mount and update in edge cases. close #10870 --- .../__tests__/componentSlots.spec.ts | 17 +++++++++++++++-- .../__tests__/rendererOptimizedMode.spec.ts | 5 ++++- packages/runtime-core/src/component.ts | 3 ++- packages/runtime-core/src/componentSlots.ts | 18 ++++++++++-------- packages/runtime-core/src/renderer.ts | 2 +- 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/packages/runtime-core/__tests__/componentSlots.spec.ts b/packages/runtime-core/__tests__/componentSlots.spec.ts index 09b37932147..6042ccbd734 100644 --- a/packages/runtime-core/__tests__/componentSlots.spec.ts +++ b/packages/runtime-core/__tests__/componentSlots.spec.ts @@ -7,7 +7,7 @@ import { ref, render, } from '@vue/runtime-test' -import { normalizeVNode } from '../src/vnode' +import { createBlock, normalizeVNode } from '../src/vnode' import { createSlots } from '../src/helpers/createSlots' describe('component: slots', () => { @@ -25,8 +25,21 @@ describe('component: slots', () => { } test('initSlots: instance.slots should be set correctly', () => { + let instance: any + const Comp = { + render() { + instance = getCurrentInstance() + return h('div') + }, + } + const slots = { foo: () => {}, _: 1 } + render(createBlock(Comp, null, slots), nodeOps.createElement('div')) + expect(instance.slots).toMatchObject(slots) + }) + + test('initSlots: instance.slots should remove compiler marker if parent is using manual render function', () => { const { slots } = renderWithSlots({ _: 1 }) - expect(slots).toMatchObject({ _: 1 }) + expect(slots).toMatchObject({}) }) test('initSlots: should normalize object slots (when value is null, string, array)', () => { diff --git a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts index 556ab75209b..4176f0fd411 100644 --- a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts +++ b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts @@ -434,7 +434,7 @@ describe('renderer: optimized mode', () => { const App = { setup() { return () => { - return createVNode(Comp, null, { + return createBlock(Comp, null, { default: withCtx(() => [ createVNode('p', null, foo.value, PatchFlags.TEXT), ]), @@ -560,6 +560,7 @@ describe('renderer: optimized mode', () => { const state = ref(0) const CompA = { + name: 'A', setup(props: any, { slots }: SetupContext) { return () => { return ( @@ -571,6 +572,7 @@ describe('renderer: optimized mode', () => { } const Wrapper = { + name: 'Wrapper', setup(props: any, { slots }: SetupContext) { // use the manually written render function to rendering the optimized slots, // which should make subsequent updates exit the optimized mode correctly @@ -581,6 +583,7 @@ describe('renderer: optimized mode', () => { } const app = createApp({ + name: 'App', setup() { return () => { return ( diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index b5faa856eca..df3a6376989 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -736,13 +736,14 @@ export let isInSSRComponentSetup = false export function setupComponent( instance: ComponentInternalInstance, isSSR = false, + optimized = false, ) { isSSR && setInSSRSetupState(isSSR) const { props, children } = instance.vnode const isStateful = isStatefulComponent(instance) initProps(instance, props, isStateful, isSSR) - initSlots(instance, children) + initSlots(instance, children, optimized) const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) diff --git a/packages/runtime-core/src/componentSlots.ts b/packages/runtime-core/src/componentSlots.ts index 2bc3466c459..0145d557b06 100644 --- a/packages/runtime-core/src/componentSlots.ts +++ b/packages/runtime-core/src/componentSlots.ts @@ -164,6 +164,7 @@ const normalizeVNodeSlots = ( export const initSlots = ( instance: ComponentInternalInstance, children: VNodeNormalizedChildren, + optimized: boolean, ) => { const slots = (instance.slots = createInternalObject()) if (instance.vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) { @@ -171,7 +172,15 @@ export const initSlots = ( if (type) { extend(slots, children as InternalSlots) // make compiler marker non-enumerable - def(slots, '_', type, true) + if (optimized) { + def(slots, '_', type, true) + } else { + // #2893 + // when rendering the optimized slots by manually written render function, + // we need to delete the `slots._` flag if necessary to make subsequent + // updates reliable, i.e. let the `renderSlot` create the bailed Fragment + delete slots._ + } } else { normalizeObjectSlots(children as RawSlots, slots, instance) } @@ -205,13 +214,6 @@ export const updateSlots = ( // compiled but dynamic (v-if/v-for on slots) - update slots, but skip // normalization. extend(slots, children as Slots) - // #2893 - // when rendering the optimized slots by manually written render function, - // we need to delete the `slots._` flag if necessary to make subsequent updates reliable, - // i.e. let the `renderSlot` create the bailed Fragment - if (!optimized && type === SlotFlags.STABLE) { - delete slots._ - } } } else { needDeletionCheck = !(children as RawSlots).$stable diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index d5c5b6d8dfb..1f36502c713 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1229,7 +1229,7 @@ function baseCreateRenderer( if (__DEV__) { startMeasure(instance, `init`) } - setupComponent(instance) + setupComponent(instance, false, optimized) if (__DEV__) { endMeasure(instance, `init`) } From ee0248accff589a94688e177e5e3af10c18288cb Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jul 2024 01:24:17 +0800 Subject: [PATCH 04/61] fix(runtime-core): errors during component patch should be caught by error handlers --- .../__tests__/errorHandling.spec.ts | 30 +++++++++++++++++++ packages/runtime-core/src/errorHandling.ts | 10 +++---- packages/runtime-core/src/renderer.ts | 2 +- packages/runtime-core/src/scheduler.ts | 11 ++++--- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/packages/runtime-core/__tests__/errorHandling.spec.ts b/packages/runtime-core/__tests__/errorHandling.spec.ts index 085127677ba..cf148bd2fe6 100644 --- a/packages/runtime-core/__tests__/errorHandling.spec.ts +++ b/packages/runtime-core/__tests__/errorHandling.spec.ts @@ -1,4 +1,5 @@ import { + type VNode, createApp, defineComponent, h, @@ -11,6 +12,7 @@ import { watch, watchEffect, } from '@vue/runtime-test' +import { ErrorCodes, ErrorTypeStrings } from '../src/errorHandling' describe('error handling', () => { test('propagation', () => { @@ -609,5 +611,33 @@ describe('error handling', () => { expect(handler).toHaveBeenCalledTimes(1) }) + test('errors in scheduler job with owner instance should be caught', async () => { + let vnode: VNode + const x = ref(0) + const app = createApp({ + render() { + return (vnode = vnode || h('div', x.value)) + }, + }) + + app.config.errorHandler = vi.fn() + app.mount(nodeOps.createElement('div')) + + const error = new Error('error') + Object.defineProperty(vnode!, 'el', { + get() { + throw error + }, + }) + + x.value++ + await nextTick() + expect(app.config.errorHandler).toHaveBeenCalledWith( + error, + {}, + ErrorTypeStrings[ErrorCodes.COMPONENT_UPDATE], + ) + }) + // native event handler handling should be tested in respective renderers }) diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index 41c92cbd34a..d243db5bffd 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -23,6 +23,7 @@ export enum ErrorCodes { FUNCTION_REF, ASYNC_COMPONENT_LOADER, SCHEDULER, + COMPONENT_UPDATE, } export const ErrorTypeStrings: Record = { @@ -54,16 +55,15 @@ export const ErrorTypeStrings: Record = { [ErrorCodes.APP_WARN_HANDLER]: 'app warnHandler', [ErrorCodes.FUNCTION_REF]: 'ref function', [ErrorCodes.ASYNC_COMPONENT_LOADER]: 'async component loader', - [ErrorCodes.SCHEDULER]: - 'scheduler flush. This is likely a Vue internals bug. ' + - 'Please open an issue at https://github.com/vuejs/core .', + [ErrorCodes.SCHEDULER]: 'scheduler flush', + [ErrorCodes.COMPONENT_UPDATE]: 'component update', } export type ErrorTypes = LifecycleHooks | ErrorCodes export function callWithErrorHandling( fn: Function, - instance: ComponentInternalInstance | null, + instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[], ) { @@ -105,7 +105,7 @@ export function callWithAsyncErrorHandling( export function handleError( err: unknown, - instance: ComponentInternalInstance | null, + instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, throwInDev = true, ) { diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 1f36502c713..3f4a6f4a265 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -1587,6 +1587,7 @@ function baseCreateRenderer( effect.run() } }) + update.i = instance update.id = instance.uid // allowRecurse // #1801, #2043 component render effects should allow recursive updates @@ -1599,7 +1600,6 @@ function baseCreateRenderer( effect.onTrigger = instance.rtg ? e => invokeArrayFns(instance.rtg!, e) : void 0 - update.ownerInstance = instance } update() diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 4ae1c6d46e7..c1f9d4c9141 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -26,9 +26,8 @@ export interface SchedulerJob extends Function { /** * Attached by renderer.ts when setting up a component's render effect * Used to obtain component information when reporting max recursive updates. - * dev only. */ - ownerInstance?: ComponentInternalInstance + i?: ComponentInternalInstance } export type SchedulerJobs = SchedulerJob | SchedulerJob[] @@ -240,7 +239,11 @@ function flushJobs(seen?: CountMap) { if (__DEV__ && check(job)) { continue } - callWithErrorHandling(job, null, ErrorCodes.SCHEDULER) + callWithErrorHandling( + job, + job.i, + job.i ? ErrorCodes.COMPONENT_UPDATE : ErrorCodes.SCHEDULER, + ) } } } finally { @@ -265,7 +268,7 @@ function checkRecursiveUpdates(seen: CountMap, fn: SchedulerJob) { } else { const count = seen.get(fn)! if (count > RECURSION_LIMIT) { - const instance = fn.ownerInstance + const instance = fn.i const componentName = instance && getComponentName(instance.type) handleError( `Maximum recursive updates exceeded${ From 314ce82e479dbb33a9281ba8c2ebe288536b32df Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jul 2024 01:25:08 +0800 Subject: [PATCH 05/61] test: test case for 3d34f406a / #10870 --- .../__tests__/rendererOptimizedMode.spec.ts | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts index 4176f0fd411..16ea42ed342 100644 --- a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts +++ b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts @@ -8,6 +8,8 @@ import { createApp, createBlock, createCommentVNode, + createElementBlock, + createElementVNode, createTextVNode, createVNode, defineComponent, @@ -962,4 +964,80 @@ describe('renderer: optimized mode', () => { // should successfully unmount without error expect(inner(root)).toBe(``) }) + + // #10870 + test('should bail manually rendered compiler slots for both mount and update', async () => { + // only reproducible in prod + __DEV__ = false + function Outer(_: any, { slots }: any) { + return slots.default() + } + const Mid = { + render(ctx: any) { + return ( + openBlock(), + createElementBlock('div', null, [renderSlot(ctx.$slots, 'default')]) + ) + }, + } + const state1 = ref(true) + const state2 = ref(true) + const App = { + render() { + return ( + openBlock(), + createBlock(Outer, null, { + default: withCtx(() => [ + createVNode( + Mid, + { foo: state2.value }, + { + default: withCtx(() => [ + createElementVNode('div', null, [ + createElementVNode('div', null, [ + state2.value + ? (openBlock(), + createElementBlock( + 'div', + { + key: 0, + id: 'if', + foo: state1.value, + }, + null, + 8 /* PROPS */, + ['foo'], + )) + : createCommentVNode('v-if', true), + ]), + ]), + ]), + _: 1 /* STABLE */, + }, + 8 /* PROPS */, + ['foo'], + ), + ]), + _: 1 /* STABLE */, + }) + ) + }, + } + + const app = createApp(App) + app.config.errorHandler = vi.fn() + + try { + app.mount(root) + + state1.value = false + await nextTick() + + state2.value = false + await nextTick() + } finally { + __DEV__ = true + expect(app.config.errorHandler).not.toHaveBeenCalled() + } + }) }) From 685e3f381c024b9f4023e60fe0545dc60d90d984 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jul 2024 17:29:42 +0800 Subject: [PATCH 06/61] fix(runtime-core): more edge case fix for manually rendered compiled slot close #11336 --- .../__tests__/rendererOptimizedMode.spec.ts | 65 +++++++++++++++++++ packages/runtime-core/src/componentSlots.ts | 29 ++++++--- 2 files changed, 84 insertions(+), 10 deletions(-) diff --git a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts index 16ea42ed342..dceda28fcae 100644 --- a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts +++ b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts @@ -1040,4 +1040,69 @@ describe('renderer: optimized mode', () => { expect(app.config.errorHandler).not.toHaveBeenCalled() } }) + + // #11336 + test('should bail manually rendered compiler slots for both mount and update (2)', async () => { + // only reproducible in prod + __DEV__ = false + const n = ref(0) + function Outer(_: any, { slots }: any) { + n.value // track + return slots.default() + } + const Mid = { + render(ctx: any) { + return ( + openBlock(), + createElementBlock('div', null, [renderSlot(ctx.$slots, 'default')]) + ) + }, + } + const show = ref(false) + const App = { + render() { + return ( + openBlock(), + createBlock(Outer, null, { + default: withCtx(() => [ + createVNode(Mid, null, { + default: withCtx(() => [ + createElementVNode('div', null, [ + show.value + ? (openBlock(), + createElementBlock('div', { key: 0 }, '1')) + : createCommentVNode('v-if', true), + createElementVNode('div', null, '2'), + createElementVNode('div', null, '3'), + ]), + createElementVNode('div', null, '4'), + ]), + _: 1 /* STABLE */, + }), + ]), + _: 1 /* STABLE */, + }) + ) + }, + } + + const app = createApp(App) + app.config.errorHandler = vi.fn() + + try { + app.mount(root) + + // force Outer update, which will assign new slots to Mid + // we want to make sure the compiled slot flag doesn't accidentally + // get assigned again + n.value++ + await nextTick() + + show.value = true + await nextTick() + } finally { + __DEV__ = true + expect(app.config.errorHandler).not.toHaveBeenCalled() + } + }) }) diff --git a/packages/runtime-core/src/componentSlots.ts b/packages/runtime-core/src/componentSlots.ts index 0145d557b06..438c56efb47 100644 --- a/packages/runtime-core/src/componentSlots.ts +++ b/packages/runtime-core/src/componentSlots.ts @@ -12,7 +12,6 @@ import { ShapeFlags, SlotFlags, def, - extend, isArray, isFunction, } from '@vue/shared' @@ -161,6 +160,22 @@ const normalizeVNodeSlots = ( instance.slots.default = () => normalized } +const assignSlots = ( + slots: InternalSlots, + children: Slots, + optimized: boolean, +) => { + for (const key in children) { + // #2893 + // when rendering the optimized slots by manually written render function, + // do not copy the `slots._` compiler flag so that `renderSlot` creates + // slot Fragment with BAIL patchFlag to force full updates + if (optimized || key !== '_') { + slots[key] = children[key] + } + } +} + export const initSlots = ( instance: ComponentInternalInstance, children: VNodeNormalizedChildren, @@ -170,16 +185,10 @@ export const initSlots = ( if (instance.vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) { const type = (children as RawSlots)._ if (type) { - extend(slots, children as InternalSlots) + assignSlots(slots, children as Slots, optimized) // make compiler marker non-enumerable if (optimized) { def(slots, '_', type, true) - } else { - // #2893 - // when rendering the optimized slots by manually written render function, - // we need to delete the `slots._` flag if necessary to make subsequent - // updates reliable, i.e. let the `renderSlot` create the bailed Fragment - delete slots._ } } else { normalizeObjectSlots(children as RawSlots, slots, instance) @@ -204,7 +213,7 @@ export const updateSlots = ( if (__DEV__ && isHmrUpdating) { // Parent was HMR updated so slot content may have changed. // force update slots and mark instance for hmr as well - extend(slots, children as Slots) + assignSlots(slots, children as Slots, optimized) trigger(instance, TriggerOpTypes.SET, '$slots') } else if (optimized && type === SlotFlags.STABLE) { // compiled AND stable. @@ -213,7 +222,7 @@ export const updateSlots = ( } else { // compiled but dynamic (v-if/v-for on slots) - update slots, but skip // normalization. - extend(slots, children as Slots) + assignSlots(slots, children as Slots, optimized) } } else { needDeletionCheck = !(children as RawSlots).$stable From d76dd9c58de24b273bc55af3a8ed81ba693e9683 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 12 Jul 2024 18:22:31 +0800 Subject: [PATCH 07/61] fix(runtime-core): force diff slot fallback content and provided content fix #7256 fix #9200 fix #9308 close #7266 close #9213 --- .../__tests__/helpers/renderSlot.spec.ts | 6 +- .../__tests__/rendererOptimizedMode.spec.ts | 73 +++++++++++++++++++ .../runtime-core/src/helpers/renderSlot.ts | 12 +-- 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts index b6183ac3c36..c4ae077ba34 100644 --- a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts +++ b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts @@ -26,13 +26,17 @@ describe('renderSlot', () => { const vnode = renderSlot( { default: () => [(child = h('child'))] }, 'default', + { key: 'foo' }, ) expect(vnode.children).toEqual([child]) + expect(vnode.key).toBe('foo') }) it('should render slot fallback', () => { - const vnode = renderSlot({}, 'default', {}, () => ['fallback']) + const vnode = renderSlot({}, 'default', { key: 'foo' }, () => ['fallback']) expect(vnode.children).toEqual(['fallback']) + // should attach fallback key postfix + expect(vnode.key).toBe('foo_fb') }) it('should warn render ssr slot', () => { diff --git a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts index dceda28fcae..7abd94e1960 100644 --- a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts +++ b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts @@ -1105,4 +1105,77 @@ describe('renderer: optimized mode', () => { expect(app.config.errorHandler).not.toHaveBeenCalled() } }) + + test('diff slot and slot fallback node', async () => { + const Comp = { + props: ['show'], + setup(props: any, { slots }: SetupContext) { + return () => { + return ( + openBlock(), + createElementBlock('div', null, [ + renderSlot(slots, 'default', { hide: !props.show }, () => [ + (openBlock(), + (block = createElementBlock( + Fragment, + { key: 0 }, + [createTextVNode('foo')], + PatchFlags.STABLE_FRAGMENT, + ))), + ]), + ]) + ) + } + }, + } + + const show = ref(true) + const app = createApp({ + render() { + return ( + openBlock(), + createBlock( + Comp, + { show: show.value }, + { + default: withCtx(({ hide }: { hide: boolean }) => [ + !hide + ? (openBlock(), + createElementBlock( + Fragment, + { key: 0 }, + [ + createCommentVNode('comment'), + createElementVNode( + 'div', + null, + 'bar', + PatchFlags.HOISTED, + ), + ], + PatchFlags.STABLE_FRAGMENT, + )) + : createCommentVNode('v-if', true), + ]), + _: SlotFlags.STABLE, + }, + PatchFlags.PROPS, + ['show'], + ) + ) + }, + }) + + app.mount(root) + expect(inner(root)).toBe('
bar
') + expect(block).toBe(null) + + show.value = false + await nextTick() + expect(inner(root)).toBe('
foo
') + + show.value = true + await nextTick() + expect(inner(root)).toBe('
bar
') + }) }) diff --git a/packages/runtime-core/src/helpers/renderSlot.ts b/packages/runtime-core/src/helpers/renderSlot.ts index 8a7608219d9..f0b13904f08 100644 --- a/packages/runtime-core/src/helpers/renderSlot.ts +++ b/packages/runtime-core/src/helpers/renderSlot.ts @@ -65,11 +65,13 @@ export function renderSlot( 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}`, + (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}`) + + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? '_fb' : ''), }, validSlotContent || (fallback ? fallback() : []), validSlotContent && (slots as RawSlots)._ === SlotFlags.STABLE From 05779a70bd0b567ae458a07636d229bd07c44c4e Mon Sep 17 00:00:00 2001 From: Vlad Date: Sat, 13 Jul 2024 01:39:21 +1100 Subject: [PATCH 08/61] perf(server-renderer): optimize `unrollBuffer` by avoiding promises (#11340) --- .../__tests__/unrollBuffer.bench.ts | 74 +++++++++++++++++++ .../server-renderer/src/renderToString.ts | 56 +++++++++----- 2 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 packages/server-renderer/__tests__/unrollBuffer.bench.ts diff --git a/packages/server-renderer/__tests__/unrollBuffer.bench.ts b/packages/server-renderer/__tests__/unrollBuffer.bench.ts new file mode 100644 index 00000000000..b5e03cea602 --- /dev/null +++ b/packages/server-renderer/__tests__/unrollBuffer.bench.ts @@ -0,0 +1,74 @@ +import { bench, describe } from 'vitest' + +import { type SSRBuffer, createBuffer } from '../src/render' +import { unrollBuffer } from '../src/renderToString' + +function createSyncBuffer(levels: number, itemsPerLevel: number): SSRBuffer { + const buffer = createBuffer() + + function addItems(buf: ReturnType, level: number) { + for (let i = 1; i <= levels * itemsPerLevel; i++) { + buf.push(`sync${level}.${i}`) + } + if (level < levels) { + const subBuffer = createBuffer() + addItems(subBuffer, level + 1) + buf.push(subBuffer.getBuffer()) + } + } + + addItems(buffer, 1) + return buffer.getBuffer() +} + +function createMixedBuffer(levels: number, itemsPerLevel: number): SSRBuffer { + const buffer = createBuffer() + + function addItems(buf: ReturnType, level: number) { + for (let i = 1; i <= levels * itemsPerLevel; i++) { + if (i % 3 === 0) { + // @ts-expect-error testing... + buf.push(Promise.resolve(`async${level}.${i}`)) + } else { + buf.push(`sync${level}.${i}`) + } + } + if (level < levels) { + const subBuffer = createBuffer() + addItems(subBuffer, level + 1) + buf.push(subBuffer.getBuffer()) + } + } + + addItems(buffer, 1) + return buffer.getBuffer() +} + +describe('unrollBuffer', () => { + let syncBuffer = createBuffer().getBuffer() + let mixedBuffer = createBuffer().getBuffer() + + bench( + 'sync', + () => { + return unrollBuffer(syncBuffer) as any + }, + { + setup() { + syncBuffer = createSyncBuffer(5, 3) + }, + }, + ) + + bench( + 'mixed', + () => { + return unrollBuffer(mixedBuffer) as any + }, + { + setup() { + mixedBuffer = createMixedBuffer(5, 3) + }, + }, + ) +}) diff --git a/packages/server-renderer/src/renderToString.ts b/packages/server-renderer/src/renderToString.ts index 0e9299ee834..b931a4d55b8 100644 --- a/packages/server-renderer/src/renderToString.ts +++ b/packages/server-renderer/src/renderToString.ts @@ -11,26 +11,46 @@ import { type SSRBuffer, type SSRContext, renderComponentVNode } from './render' const { isVNode } = ssrUtils -async function unrollBuffer(buffer: SSRBuffer): Promise { - if (buffer.hasAsync) { - let ret = '' - for (let i = 0; i < buffer.length; i++) { - let item = buffer[i] - if (isPromise(item)) { - item = await item - } - if (isString(item)) { - ret += item - } else { - ret += await unrollBuffer(item) - } +function nestedUnrollBuffer( + buffer: SSRBuffer, + parentRet: string, + startIndex: number, +): Promise | string { + if (!buffer.hasAsync) { + return parentRet + unrollBufferSync(buffer) + } + + let ret = parentRet + for (let i = startIndex; i < buffer.length; i += 1) { + const item = buffer[i] + if (isString(item)) { + ret += item + continue } - return ret - } else { - // sync buffer can be more efficiently unrolled without unnecessary await - // ticks - return unrollBufferSync(buffer) + + if (isPromise(item)) { + return item.then(nestedItem => { + buffer[i] = nestedItem + return nestedUnrollBuffer(buffer, ret, i) + }) + } + + const result = nestedUnrollBuffer(item, ret, 0) + if (isPromise(result)) { + return result.then(nestedItem => { + buffer[i] = nestedItem + return nestedUnrollBuffer(buffer, '', i) + }) + } + + ret = result } + + return ret +} + +export function unrollBuffer(buffer: SSRBuffer): Promise | string { + return nestedUnrollBuffer(buffer, '', 0) } function unrollBufferSync(buffer: SSRBuffer): string { From 7fb6eb882b64bf99a99d00606e54b0e050674206 Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Sat, 13 Jul 2024 07:57:37 +0100 Subject: [PATCH 09/61] fix(v-model): component v-model modifiers trim and number when cases don't match (#9609) close #4848 close #4850 (based on commits from #4850) Co-authored-by: zhaozhongyu Co-authored-by: Evan You --- .../__tests__/componentEmits.spec.ts | 77 +++++++++++++++++++ packages/runtime-core/src/helpers/useModel.ts | 9 ++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/__tests__/componentEmits.spec.ts b/packages/runtime-core/__tests__/componentEmits.spec.ts index 86307275bf8..e2e9044a1b4 100644 --- a/packages/runtime-core/__tests__/componentEmits.spec.ts +++ b/packages/runtime-core/__tests__/componentEmits.spec.ts @@ -356,6 +356,83 @@ describe('component: emit', () => { expect(fn2).toHaveBeenCalledWith('two') }) + test('.trim modifier should work with v-model on component for kebab-cased props and camelCased emit', () => { + const Foo = defineComponent({ + render() {}, + created() { + this.$emit('update:firstName', ' one ') + }, + }) + + const fn1 = vi.fn() + + const Comp = () => + h(Foo, { + 'first-name': null, + 'first-nameModifiers': { trim: true }, + 'onUpdate:first-name': fn1, + }) + + render(h(Comp), nodeOps.createElement('div')) + + expect(fn1).toHaveBeenCalledTimes(1) + expect(fn1).toHaveBeenCalledWith('one') + }) + + test('.trim modifier should work with v-model on component for camelCased props and kebab-cased emit', () => { + const Foo = defineComponent({ + render() {}, + created() { + this.$emit('update:model-value', ' one ') + this.$emit('update:first-name', ' two ') + }, + }) + + const fn1 = vi.fn() + const fn2 = vi.fn() + + const Comp = () => + h(Foo, { + modelValue: null, + modelModifiers: { trim: true }, + 'onUpdate:modelValue': fn1, + + firstName: null, + firstNameModifiers: { trim: true }, + 'onUpdate:firstName': fn2, + }) + + render(h(Comp), nodeOps.createElement('div')) + + expect(fn1).toHaveBeenCalledTimes(1) + expect(fn1).toHaveBeenCalledWith('one') + expect(fn2).toHaveBeenCalledTimes(1) + expect(fn2).toHaveBeenCalledWith('two') + }) + + test('.trim modifier should work with v-model on component for mixed cased props and emit', () => { + const Foo = defineComponent({ + render() {}, + created() { + this.$emit('update:base-URL', ' one ') + }, + }) + + const fn1 = vi.fn() + + const Comp = () => + h(Foo, { + 'base-URL': null, + 'base-URLModifiers': { trim: true }, + 'onUpdate:base-URL': fn1, + }) + + render(h(Comp), nodeOps.createElement('div')) + + expect(fn1).toHaveBeenCalledTimes(1) + expect(fn1).toHaveBeenCalledWith('one') + }) + test('.trim and .number modifiers should work with v-model on component', () => { const Foo = defineComponent({ render() {}, diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index 38f004bb535..8e775a4b90e 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -108,5 +108,10 @@ export function useModel( export const getModelModifiers = ( props: Record, modelName: string, -): Record | undefined => - props[`${modelName === 'modelValue' ? 'model' : modelName}Modifiers`] +): Record | undefined => { + return modelName === 'modelValue' || modelName === 'model-value' + ? props.modelModifiers + : props[`${modelName}Modifiers`] || + props[`${camelize(modelName)}Modifiers`] || + props[`${hyphenate(modelName)}Modifiers`] +} From f05b3ae0f8b811bd0eed43608bec669b3cbe58b0 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 13 Jul 2024 15:40:09 +0800 Subject: [PATCH 10/61] chore: improve comments --- packages/runtime-core/src/vnode.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 7abd45c7fa5..626b288937d 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -92,10 +92,22 @@ export type VNodeRef = ) => void) export type VNodeNormalizedRefAtom = { + /** + * component instance + */ i: ComponentInternalInstance + /** + * Actual ref + */ r: VNodeRef - k?: string // setup ref key - f?: boolean // refInFor marker + /** + * setup ref key + */ + k?: string + /** + * refInFor marker + */ + f?: boolean } export type VNodeNormalizedRef = From aef807746a178b3ce187bb30b60ff965f01569df Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 13 Jul 2024 18:21:02 +0800 Subject: [PATCH 11/61] refactor(compiler): move patchFlag text generation to codegen phase --- .../__snapshots__/codegen.spec.ts.snap | 4 +- .../compiler-core/__tests__/codegen.spec.ts | 21 +-- .../compiler-core/__tests__/transform.spec.ts | 8 +- .../__tests__/transforms/hoistStatic.spec.ts | 14 +- .../transforms/transformElement.spec.ts | 56 ++++---- .../__tests__/transforms/vFor.spec.ts | 24 ++-- .../__tests__/transforms/vSlot.spec.ts | 26 ++-- packages/compiler-core/src/ast.ts | 6 +- packages/compiler-core/src/codegen.ts | 32 ++++- packages/compiler-core/src/transform.ts | 2 +- .../src/transforms/hoistStatic.ts | 15 +- .../src/transforms/transformElement.ts | 29 +--- packages/compiler-core/src/transforms/vFor.ts | 10 +- packages/compiler-core/src/transforms/vIf.ts | 2 +- .../__tests__/transforms/vHtml.spec.ts | 9 +- .../__tests__/transforms/vOn.spec.ts | 5 +- .../__tests__/transforms/vText.spec.ts | 9 +- .../runtime-core/__tests__/hydration.spec.ts | 129 +++++++++--------- 18 files changed, 192 insertions(+), 209 deletions(-) diff --git a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap index 2bdb4afa4c0..a9591f922b4 100644 --- a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap @@ -54,7 +54,7 @@ return function render(_ctx, _cache) { [foo + bar]: bar }, [ _createElementVNode("p", { "some-key": "foo" }) - ], 16) + ], 16 /* FULL_PROPS */) } }" `; @@ -98,7 +98,7 @@ exports[`compiler: codegen > forNode 1`] = ` " return function render(_ctx, _cache) { with (_ctx) { - return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(), 1)) + return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(), 1 /* TEXT */)) } }" `; diff --git a/packages/compiler-core/__tests__/codegen.spec.ts b/packages/compiler-core/__tests__/codegen.spec.ts index 9c923075634..4a5ba7d5c61 100644 --- a/packages/compiler-core/__tests__/codegen.spec.ts +++ b/packages/compiler-core/__tests__/codegen.spec.ts @@ -267,7 +267,7 @@ describe('compiler: codegen', () => { disableTracking: true, props: undefined, children: createCallExpression(RENDER_LIST), - patchFlag: '1', + patchFlag: PatchFlags.TEXT, dynamicProps: undefined, directives: undefined, loc: locStub, @@ -303,7 +303,7 @@ describe('compiler: codegen', () => { disableTracking: false, props: undefined, children: createCallExpression(RENDER_LIST), - patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT), + patchFlag: PatchFlags.STABLE_FRAGMENT, dynamicProps: undefined, directives: undefined, loc: locStub, @@ -364,7 +364,7 @@ describe('compiler: codegen', () => { ), ], // flag - PatchFlags.FULL_PROPS + '', + PatchFlags.FULL_PROPS, ), }), ) @@ -375,7 +375,7 @@ describe('compiler: codegen', () => { [foo + bar]: bar }, [ _${helperNameMap[CREATE_ELEMENT_VNODE]}("p", { "some-key": "foo" }) - ], ${PatchFlags.FULL_PROPS})`) + ], ${genFlagText(PatchFlags.FULL_PROPS)})`) expect(code).toMatchSnapshot() }) @@ -666,11 +666,14 @@ describe('compiler: codegen', () => { }) test('with patchFlag and no children/props', () => { - expect(genCode(createVNodeCall(null, `"div"`, undefined, undefined, '1'))) - .toMatchInlineSnapshot(` - "return _createElementVNode("div", null, null, 1) - " - `) + expect( + genCode( + createVNodeCall(null, `"div"`, undefined, undefined, PatchFlags.TEXT), + ), + ).toMatchInlineSnapshot(` + "return _createElementVNode("div", null, null, 1 /* TEXT */) + " + `) }) test('as block', () => { diff --git a/packages/compiler-core/__tests__/transform.spec.ts b/packages/compiler-core/__tests__/transform.spec.ts index a56be51bc5c..0946d364838 100644 --- a/packages/compiler-core/__tests__/transform.spec.ts +++ b/packages/compiler-core/__tests__/transform.spec.ts @@ -19,7 +19,6 @@ import { transformFor } from '../src/transforms/vFor' import { transformElement } from '../src/transforms/transformElement' import { transformSlotOutlet } from '../src/transforms/transformSlotOutlet' import { transformText } from '../src/transforms/transformText' -import { genFlagText } from './testUtils' import { PatchFlags } from '@vue/shared' describe('compiler: transform', () => { @@ -358,7 +357,7 @@ describe('compiler: transform', () => { { type: NodeTypes.ELEMENT, tag: `div` }, { type: NodeTypes.ELEMENT, tag: `div` }, ] as any, - genFlagText(PatchFlags.STABLE_FRAGMENT), + PatchFlags.STABLE_FRAGMENT, ), ) }) @@ -374,10 +373,7 @@ describe('compiler: transform', () => { { type: NodeTypes.ELEMENT, tag: `div` }, { type: NodeTypes.COMMENT }, ] as any, - genFlagText([ - PatchFlags.STABLE_FRAGMENT, - PatchFlags.DEV_ROOT_FRAGMENT, - ]), + PatchFlags.STABLE_FRAGMENT | PatchFlags.DEV_ROOT_FRAGMENT, ), ) }) diff --git a/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts b/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts index d6c46b52eb3..d5a34243bca 100644 --- a/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts +++ b/packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts @@ -21,7 +21,7 @@ import { transformIf } from '../../src/transforms/vIf' import { transformFor } from '../../src/transforms/vFor' import { transformBind } from '../../src/transforms/vBind' import { transformOn } from '../../src/transforms/vOn' -import { createObjectMatcher, genFlagText } from '../testUtils' +import { createObjectMatcher } from '../testUtils' import { transformText } from '../../src/transforms/transformText' import { PatchFlags } from '@vue/shared' @@ -180,7 +180,7 @@ describe('compiler: hoistStatic transform', () => { id: `[foo]`, }), children: undefined, - patchFlag: genFlagText(PatchFlags.PROPS), + patchFlag: PatchFlags.PROPS, dynamicProps: { type: NodeTypes.SIMPLE_EXPRESSION, content: `_hoisted_1`, @@ -242,7 +242,7 @@ describe('compiler: hoistStatic transform', () => { ref: `[foo]`, }), children: undefined, - patchFlag: genFlagText(PatchFlags.NEED_PATCH), + patchFlag: PatchFlags.NEED_PATCH, }, }, ]) @@ -263,7 +263,7 @@ describe('compiler: hoistStatic transform', () => { content: `_hoisted_1`, }, children: undefined, - patchFlag: genFlagText(PatchFlags.NEED_PATCH), + patchFlag: PatchFlags.NEED_PATCH, directives: { type: NodeTypes.JS_ARRAY_EXPRESSION, }, @@ -286,7 +286,7 @@ describe('compiler: hoistStatic transform', () => { tag: `"div"`, props: { content: `_hoisted_1` }, children: { type: NodeTypes.INTERPOLATION }, - patchFlag: genFlagText(PatchFlags.TEXT), + patchFlag: PatchFlags.TEXT, }, }, ]) @@ -365,7 +365,7 @@ describe('compiler: hoistStatic transform', () => { type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_LIST, }, - patchFlag: genFlagText(PatchFlags.UNKEYED_FRAGMENT), + patchFlag: PatchFlags.UNKEYED_FRAGMENT, }) const innerBlockCodegen = forBlockCodegen!.children.arguments[1] expect(innerBlockCodegen.returns).toMatchObject({ @@ -496,7 +496,7 @@ describe('compiler: hoistStatic transform', () => { constType: ConstantTypes.NOT_CONSTANT, }, }, - patchFlag: `1 /* TEXT */`, + patchFlag: PatchFlags.TEXT, }, }, ], diff --git a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts index 10b9747d1ee..bf3510a052d 100644 --- a/packages/compiler-core/__tests__/transforms/transformElement.spec.ts +++ b/packages/compiler-core/__tests__/transforms/transformElement.spec.ts @@ -37,7 +37,7 @@ import { transformStyle } from '../../../compiler-dom/src/transforms/transformSt import { transformOn } from '../../src/transforms/vOn' import { transformBind } from '../../src/transforms/vBind' import { PatchFlags } from '@vue/shared' -import { createObjectMatcher, genFlagText } from '../testUtils' +import { createObjectMatcher } from '../testUtils' import { transformText } from '../../src/transforms/transformText' import { parseWithForTransform } from './vFor.spec' @@ -521,7 +521,7 @@ describe('compiler: element transform', () => { // keep-alive should not compile content to slots children: [{ type: NodeTypes.ELEMENT, tag: 'span' }], // should get a dynamic slots flag to force updates - patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS), + patchFlag: PatchFlags.DYNAMIC_SLOTS, }) } @@ -588,7 +588,7 @@ describe('compiler: element transform', () => { }) // should factor in props returned by custom directive transforms // in patchFlag analysis - expect(node.patchFlag).toMatch(PatchFlags.PROPS + '') + expect(node.patchFlag).toBe(PatchFlags.PROPS) expect(node.dynamicProps).toMatch(`"bar"`) }) @@ -612,7 +612,7 @@ describe('compiler: element transform', () => { tag: `"div"`, props: undefined, children: undefined, - patchFlag: genFlagText(PatchFlags.NEED_PATCH), // should generate appropriate flag + patchFlag: PatchFlags.NEED_PATCH, // should generate appropriate flag directives: { type: NodeTypes.JS_ARRAY_EXPRESSION, elements: [ @@ -945,26 +945,26 @@ describe('compiler: element transform', () => { expect(node.patchFlag).toBeUndefined() const { node: node2 } = parseWithBind(`
{{ foo }}
`) - expect(node2.patchFlag).toBe(genFlagText(PatchFlags.TEXT)) + expect(node2.patchFlag).toBe(PatchFlags.TEXT) // multiple nodes, merged with optimize text const { node: node3 } = parseWithBind(`
foo {{ bar }} baz
`) - expect(node3.patchFlag).toBe(genFlagText(PatchFlags.TEXT)) + expect(node3.patchFlag).toBe(PatchFlags.TEXT) }) test('CLASS', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.CLASS)) + expect(node.patchFlag).toBe(PatchFlags.CLASS) }) test('STYLE', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.STYLE)) + expect(node.patchFlag).toBe(PatchFlags.STYLE) }) test('PROPS', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.PROPS)) + expect(node.patchFlag).toBe(PatchFlags.PROPS) expect(node.dynamicProps).toBe(`["foo", "baz"]`) }) @@ -973,7 +973,7 @@ describe('compiler: element transform', () => { `
`, ) expect(node.patchFlag).toBe( - genFlagText([PatchFlags.CLASS, PatchFlags.STYLE, PatchFlags.PROPS]), + PatchFlags.CLASS | PatchFlags.STYLE | PatchFlags.PROPS, ) expect(node.dynamicProps).toBe(`["foo", "baz"]`) }) @@ -983,40 +983,40 @@ describe('compiler: element transform', () => { const { node } = parseWithBind( ``, ) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.PROPS)) + expect(node.patchFlag).toBe(PatchFlags.PROPS) expect(node.dynamicProps).toBe(`["id", "class", "style"]`) }) test('FULL_PROPS (v-bind)', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.FULL_PROPS)) + expect(node.patchFlag).toBe(PatchFlags.FULL_PROPS) }) test('FULL_PROPS (dynamic key)', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.FULL_PROPS)) + expect(node.patchFlag).toBe(PatchFlags.FULL_PROPS) }) test('FULL_PROPS (w/ others)', () => { const { node } = parseWithBind( `
`, ) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.FULL_PROPS)) + expect(node.patchFlag).toBe(PatchFlags.FULL_PROPS) }) test('NEED_PATCH (static ref)', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH)) + expect(node.patchFlag).toBe(PatchFlags.NEED_PATCH) }) test('NEED_PATCH (dynamic ref)', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH)) + expect(node.patchFlag).toBe(PatchFlags.NEED_PATCH) }) test('NEED_PATCH (custom directives)', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH)) + expect(node.patchFlag).toBe(PatchFlags.NEED_PATCH) }) test('NEED_PATCH (vnode hooks)', () => { @@ -1025,7 +1025,7 @@ describe('compiler: element transform', () => { cacheHandlers: true, }).ast const node = (root as any).children[0].codegenNode - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_PATCH)) + expect(node.patchFlag).toBe(PatchFlags.NEED_PATCH) }) test('script setup inline mode template ref (binding exists)', () => { @@ -1120,7 +1120,7 @@ describe('compiler: element transform', () => { }, }) // should only have props flag - expect(node.patchFlag).toBe(genFlagText(PatchFlags.PROPS)) + expect(node.patchFlag).toBe(PatchFlags.PROPS) const { node: node2 } = parseWithElementTransform( `
`, @@ -1130,21 +1130,15 @@ describe('compiler: element transform', () => { }, }, ) - expect(node2.patchFlag).toBe( - genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]), - ) + expect(node2.patchFlag).toBe(PatchFlags.PROPS | PatchFlags.NEED_HYDRATION) }) test('NEED_HYDRATION for v-bind.prop', () => { const { node } = parseWithBind(`
`) - expect(node.patchFlag).toBe( - genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]), - ) + expect(node.patchFlag).toBe(PatchFlags.PROPS | PatchFlags.NEED_HYDRATION) const { node: node2 } = parseWithBind(`
`) - expect(node2.patchFlag).toBe( - genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]), - ) + expect(node2.patchFlag).toBe(PatchFlags.PROPS | PatchFlags.NEED_HYDRATION) }) // #5870 @@ -1157,9 +1151,7 @@ describe('compiler: element transform', () => { }, }, ) - expect(node.patchFlag).toBe( - genFlagText([PatchFlags.PROPS, PatchFlags.NEED_HYDRATION]), - ) + expect(node.patchFlag).toBe(PatchFlags.PROPS | PatchFlags.NEED_HYDRATION) }) test('should not have PROPS patchflag for constant v-on handlers', () => { @@ -1173,7 +1165,7 @@ describe('compiler: element transform', () => { }, }) // should only have hydration flag - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_HYDRATION)) + expect(node.patchFlag).toBe(PatchFlags.NEED_HYDRATION) }) }) diff --git a/packages/compiler-core/__tests__/transforms/vFor.spec.ts b/packages/compiler-core/__tests__/transforms/vFor.spec.ts index 94f75f2a63b..d0e95fcbcb3 100644 --- a/packages/compiler-core/__tests__/transforms/vFor.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vFor.spec.ts @@ -18,8 +18,8 @@ import { import { ErrorCodes } from '../../src/errors' import { type CompilerOptions, generate } from '../../src' import { FRAGMENT, RENDER_LIST, RENDER_SLOT } from '../../src/runtimeHelpers' -import { PatchFlagNames, PatchFlags } from '@vue/shared' -import { createObjectMatcher, genFlagText } from '../testUtils' +import { PatchFlags } from '@vue/shared' +import { createObjectMatcher } from '../testUtils' export function parseWithForTransform( template: string, @@ -696,10 +696,10 @@ describe('compiler: v-for', () => { tag: FRAGMENT, disableTracking, patchFlag: !disableTracking - ? genFlagText(PatchFlags.STABLE_FRAGMENT) + ? PatchFlags.STABLE_FRAGMENT : keyed - ? genFlagText(PatchFlags.KEYED_FRAGMENT) - : genFlagText(PatchFlags.UNKEYED_FRAGMENT), + ? PatchFlags.KEYED_FRAGMENT + : PatchFlags.UNKEYED_FRAGMENT, children: { type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_LIST, @@ -822,7 +822,7 @@ describe('compiler: v-for', () => { constType: ConstantTypes.NOT_CONSTANT, }, }, - patchFlag: genFlagText(PatchFlags.TEXT), + patchFlag: PatchFlags.TEXT, }, }) expect(generate(root).code).toMatchSnapshot() @@ -846,7 +846,7 @@ describe('compiler: v-for', () => { { type: NodeTypes.TEXT, content: `hello` }, { type: NodeTypes.ELEMENT, tag: `span` }, ], - patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT), + patchFlag: PatchFlags.STABLE_FRAGMENT, }, }) expect(generate(root).code).toMatchSnapshot() @@ -950,7 +950,7 @@ describe('compiler: v-for', () => { { type: NodeTypes.TEXT, content: `hello` }, { type: NodeTypes.ELEMENT, tag: `span` }, ], - patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT), + patchFlag: PatchFlags.STABLE_FRAGMENT, }, }) expect(generate(root).code).toMatchSnapshot() @@ -971,7 +971,7 @@ describe('compiler: v-for', () => { }), isBlock: true, disableTracking: true, - patchFlag: genFlagText(PatchFlags.UNKEYED_FRAGMENT), + patchFlag: PatchFlags.UNKEYED_FRAGMENT, children: { type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_LIST, @@ -1009,7 +1009,7 @@ describe('compiler: v-for', () => { }), isBlock: true, disableTracking: true, - patchFlag: genFlagText(PatchFlags.UNKEYED_FRAGMENT), + patchFlag: PatchFlags.UNKEYED_FRAGMENT, children: { type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_LIST, @@ -1048,9 +1048,7 @@ describe('compiler: v-for', () => { const { node: { codegenNode }, } = parseWithForTransform('
test
') - expect(codegenNode.patchFlag).toBe( - `${PatchFlags.KEYED_FRAGMENT} /* ${PatchFlagNames[PatchFlags.KEYED_FRAGMENT]} */`, - ) + expect(codegenNode.patchFlag).toBe(PatchFlags.KEYED_FRAGMENT) }) test('template v-for key w/ :key shorthand on template injected to the child', () => { diff --git a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts index 3afcf0fc053..4766c2ca9d8 100644 --- a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts @@ -24,7 +24,7 @@ import { trackVForSlotScopes, } from '../../src/transforms/vSlot' import { CREATE_SLOTS, RENDER_LIST } from '../../src/runtimeHelpers' -import { createObjectMatcher, genFlagText } from '../testUtils' +import { createObjectMatcher } from '../testUtils' import { PatchFlags } from '@vue/shared' import { transformFor } from '../../src/transforms/vFor' import { transformIf } from '../../src/transforms/vIf' @@ -432,7 +432,7 @@ describe('compiler: transform component slots', () => { ), // nested slot should be forced dynamic, since scope variables // are not tracked as dependencies of the slot. - patchFlag: genFlagText(PatchFlags.DYNAMIC_SLOTS), + patchFlag: PatchFlags.DYNAMIC_SLOTS, }, }, // test scope @@ -474,9 +474,7 @@ describe('compiler: transform component slots', () => { const div = ((root.children[0] as ForNode).children[0] as ElementNode) .codegenNode as any const comp = div.children[0] - expect(comp.codegenNode.patchFlag).toBe( - genFlagText(PatchFlags.DYNAMIC_SLOTS), - ) + expect(comp.codegenNode.patchFlag).toBe(PatchFlags.DYNAMIC_SLOTS) }) test('should only force dynamic slots when actually using scope vars w/ prefixIdentifiers: true', () => { @@ -494,7 +492,7 @@ describe('compiler: transform component slots', () => { flag = (innerComp.codegenNode as VNodeCall).patchFlag } if (shouldForce) { - expect(flag).toBe(genFlagText(PatchFlags.DYNAMIC_SLOTS)) + expect(flag).toBe(PatchFlags.DYNAMIC_SLOTS) } else { expect(flag).toBeUndefined() } @@ -581,8 +579,8 @@ describe('compiler: transform component slots', () => { }, ], }) - expect((root as any).children[0].codegenNode.patchFlag).toMatch( - PatchFlags.DYNAMIC_SLOTS + '', + expect((root as any).children[0].codegenNode.patchFlag).toBe( + PatchFlags.DYNAMIC_SLOTS, ) expect(generate(root).code).toMatchSnapshot() }) @@ -630,8 +628,8 @@ describe('compiler: transform component slots', () => { }, ], }) - expect((root as any).children[0].codegenNode.patchFlag).toMatch( - PatchFlags.DYNAMIC_SLOTS + '', + expect((root as any).children[0].codegenNode.patchFlag).toBe( + PatchFlags.DYNAMIC_SLOTS, ) expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot() }) @@ -693,8 +691,8 @@ describe('compiler: transform component slots', () => { }, ], }) - expect((root as any).children[0].codegenNode.patchFlag).toMatch( - PatchFlags.DYNAMIC_SLOTS + '', + expect((root as any).children[0].codegenNode.patchFlag).toBe( + PatchFlags.DYNAMIC_SLOTS, ) expect((root as any).children[0].children.length).toBe(3) expect(generate(root).code).toMatchSnapshot() @@ -744,8 +742,8 @@ describe('compiler: transform component slots', () => { }, ], }) - expect((root as any).children[0].codegenNode.patchFlag).toMatch( - PatchFlags.DYNAMIC_SLOTS + '', + expect((root as any).children[0].codegenNode.patchFlag).toBe( + PatchFlags.DYNAMIC_SLOTS, ) expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot() }) diff --git a/packages/compiler-core/src/ast.ts b/packages/compiler-core/src/ast.ts index 91354b1b40b..562e24e72e3 100644 --- a/packages/compiler-core/src/ast.ts +++ b/packages/compiler-core/src/ast.ts @@ -1,4 +1,4 @@ -import { isString } from '@vue/shared' +import { type PatchFlags, isString } from '@vue/shared' import { CREATE_BLOCK, CREATE_ELEMENT_BLOCK, @@ -331,7 +331,7 @@ export interface VNodeCall extends Node { | ForRenderListExpression // v-for fragment call | SimpleExpressionNode // hoisted | undefined - patchFlag: string | undefined + patchFlag: PatchFlags | undefined dynamicProps: string | SimpleExpressionNode | undefined directives: DirectiveArguments | undefined isBlock: boolean @@ -561,7 +561,7 @@ export interface ForCodegenNode extends VNodeCall { tag: typeof FRAGMENT props: undefined children: ForRenderListExpression - patchFlag: string + patchFlag: PatchFlags disableTracking: boolean } diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index 39170bac5a0..4dd51133ce7 100644 --- a/packages/compiler-core/src/codegen.ts +++ b/packages/compiler-core/src/codegen.ts @@ -35,7 +35,13 @@ import { isSimpleIdentifier, toValidAssetId, } from './utils' -import { isArray, isString, isSymbol } from '@vue/shared' +import { + PatchFlagNames, + type PatchFlags, + isArray, + isString, + isSymbol, +} from '@vue/shared' import { CREATE_COMMENT, CREATE_ELEMENT_VNODE, @@ -843,6 +849,28 @@ function genVNodeCall(node: VNodeCall, context: CodegenContext) { disableTracking, isComponent, } = node + + // add dev annotations to patch flags + let patchFlagString + if (patchFlag) { + if (__DEV__) { + if (patchFlag < 0) { + // special flags (negative and mutually exclusive) + patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */` + } else { + // bitwise flags + const flagNames = Object.keys(PatchFlagNames) + .map(Number) + .filter(n => n > 0 && patchFlag & n) + .map(n => PatchFlagNames[n as PatchFlags]) + .join(`, `) + patchFlagString = patchFlag + ` /* ${flagNames} */` + } + } else { + patchFlagString = String(patchFlag) + } + } + if (directives) { push(helper(WITH_DIRECTIVES) + `(`) } @@ -857,7 +885,7 @@ function genVNodeCall(node: VNodeCall, context: CodegenContext) { : getVNodeHelper(context.inSSR, isComponent) push(helper(callHelper) + `(`, NewlineType.None, node) genNodeList( - genNullableArgs([tag, props, children, patchFlag, dynamicProps]), + genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), context, ) push(`)`) diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index 69821f7f879..83ed8a92064 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -382,7 +382,7 @@ function createRootCodegen(root: RootNode, context: TransformContext) { helper(FRAGMENT), undefined, root.children, - patchFlag + (__DEV__ ? ` /* ${patchFlagText} */` : ``), + patchFlag, undefined, undefined, true, diff --git a/packages/compiler-core/src/transforms/hoistStatic.ts b/packages/compiler-core/src/transforms/hoistStatic.ts index 67bdaa887bf..5942b73097b 100644 --- a/packages/compiler-core/src/transforms/hoistStatic.ts +++ b/packages/compiler-core/src/transforms/hoistStatic.ts @@ -70,8 +70,7 @@ function walk( : getConstantType(child, context) if (constantType > ConstantTypes.NOT_CONSTANT) { if (constantType >= ConstantTypes.CAN_HOIST) { - ;(child.codegenNode as VNodeCall).patchFlag = - PatchFlags.HOISTED + (__DEV__ ? ` /* HOISTED */` : ``) + ;(child.codegenNode as VNodeCall).patchFlag = PatchFlags.HOISTED child.codegenNode = context.hoist(child.codegenNode!) hoistedCount++ continue @@ -81,9 +80,9 @@ function walk( // hoisting. const codegenNode = child.codegenNode! if (codegenNode.type === NodeTypes.VNODE_CALL) { - const flag = getPatchFlag(codegenNode) + const flag = codegenNode.patchFlag if ( - (!flag || + (flag === undefined || flag === PatchFlags.NEED_PATCH || flag === PatchFlags.TEXT) && getGeneratedPropsConstantType(child, context) >= @@ -179,8 +178,7 @@ export function getConstantType( ) { return ConstantTypes.NOT_CONSTANT } - const flag = getPatchFlag(codegenNode) - if (!flag) { + if (codegenNode.patchFlag === undefined) { let returnType = ConstantTypes.CAN_STRINGIFY // Element itself has no patch flag. However we still need to check: @@ -365,8 +363,3 @@ function getNodeProps(node: PlainElementNode) { return codegenNode.props } } - -function getPatchFlag(node: VNodeCall): number | undefined { - const flag = node.patchFlag - return flag ? parseInt(flag, 10) : undefined -} diff --git a/packages/compiler-core/src/transforms/transformElement.ts b/packages/compiler-core/src/transforms/transformElement.ts index b1be06db703..ebaf08375b9 100644 --- a/packages/compiler-core/src/transforms/transformElement.ts +++ b/packages/compiler-core/src/transforms/transformElement.ts @@ -23,7 +23,6 @@ import { createVNodeCall, } from '../ast' import { - PatchFlagNames, PatchFlags, camelize, capitalize, @@ -101,8 +100,7 @@ export const transformElement: NodeTransform = (node, context) => { let vnodeProps: VNodeCall['props'] let vnodeChildren: VNodeCall['children'] - let vnodePatchFlag: VNodeCall['patchFlag'] - let patchFlag: number = 0 + let patchFlag: VNodeCall['patchFlag'] | 0 = 0 let vnodeDynamicProps: VNodeCall['dynamicProps'] let dynamicPropNames: string[] | undefined let vnodeDirectives: VNodeCall['directives'] @@ -206,27 +204,8 @@ export const transformElement: NodeTransform = (node, context) => { } // patchFlag & dynamicPropNames - if (patchFlag !== 0) { - if (__DEV__) { - if (patchFlag < 0) { - // special flags (negative and mutually exclusive) - vnodePatchFlag = - patchFlag + ` /* ${PatchFlagNames[patchFlag as PatchFlags]} */` - } else { - // bitwise flags - const flagNames = Object.keys(PatchFlagNames) - .map(Number) - .filter(n => n > 0 && patchFlag & n) - .map(n => PatchFlagNames[n as PatchFlags]) - .join(`, `) - vnodePatchFlag = patchFlag + ` /* ${flagNames} */` - } - } else { - vnodePatchFlag = String(patchFlag) - } - if (dynamicPropNames && dynamicPropNames.length) { - vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames) - } + if (dynamicPropNames && dynamicPropNames.length) { + vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames) } node.codegenNode = createVNodeCall( @@ -234,7 +213,7 @@ export const transformElement: NodeTransform = (node, context) => { vnodeTag, vnodeProps, vnodeChildren, - vnodePatchFlag, + patchFlag === 0 ? undefined : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, diff --git a/packages/compiler-core/src/transforms/vFor.ts b/packages/compiler-core/src/transforms/vFor.ts index 16c48ede067..0db961528e6 100644 --- a/packages/compiler-core/src/transforms/vFor.ts +++ b/packages/compiler-core/src/transforms/vFor.ts @@ -46,7 +46,7 @@ import { } from '../runtimeHelpers' import { processExpression } from './transformExpression' import { validateBrowserExpression } from '../validateExpression' -import { PatchFlagNames, PatchFlags } from '@vue/shared' +import { PatchFlags } from '@vue/shared' import { transformBindShorthand } from './vBind' export const transformFor = createStructuralDirectiveTransform( @@ -109,8 +109,7 @@ export const transformFor = createStructuralDirectiveTransform( helper(FRAGMENT), undefined, renderExp, - fragmentFlag + - (__DEV__ ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), + fragmentFlag, undefined, undefined, true /* isBlock */, @@ -169,10 +168,7 @@ export const transformFor = createStructuralDirectiveTransform( helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, - PatchFlags.STABLE_FRAGMENT + - (__DEV__ - ? ` /* ${PatchFlagNames[PatchFlags.STABLE_FRAGMENT]} */` - : ``), + PatchFlags.STABLE_FRAGMENT, undefined, undefined, true, diff --git a/packages/compiler-core/src/transforms/vIf.ts b/packages/compiler-core/src/transforms/vIf.ts index a6437f89c63..06255b25fdc 100644 --- a/packages/compiler-core/src/transforms/vIf.ts +++ b/packages/compiler-core/src/transforms/vIf.ts @@ -280,7 +280,7 @@ function createChildrenCodegenNode( helper(FRAGMENT), createObjectExpression([keyProperty]), children, - patchFlag + (__DEV__ ? ` /* ${patchFlagText} */` : ``), + patchFlag, undefined, undefined, true, diff --git a/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts b/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts index a59a7a40aaf..bca2fdf9558 100644 --- a/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/vHtml.spec.ts @@ -6,10 +6,7 @@ import { } from '@vue/compiler-core' import { transformVHtml } from '../../src/transforms/vHtml' import { transformElement } from '../../../compiler-core/src/transforms/transformElement' -import { - createObjectMatcher, - genFlagText, -} from '../../../compiler-core/__tests__/testUtils' +import { createObjectMatcher } from '../../../compiler-core/__tests__/testUtils' import { PatchFlags } from '@vue/shared' import { DOMErrorCodes } from '../../src/errors' @@ -34,7 +31,7 @@ describe('compiler: v-html transform', () => { innerHTML: `[test]`, }), children: undefined, - patchFlag: genFlagText(PatchFlags.PROPS), + patchFlag: PatchFlags.PROPS, dynamicProps: `["innerHTML"]`, }) }) @@ -53,7 +50,7 @@ describe('compiler: v-html transform', () => { innerHTML: `[test]`, }), children: undefined, // <-- children should have been removed - patchFlag: genFlagText(PatchFlags.PROPS), + patchFlag: PatchFlags.PROPS, dynamicProps: `["innerHTML"]`, }) }) diff --git a/packages/compiler-dom/__tests__/transforms/vOn.spec.ts b/packages/compiler-dom/__tests__/transforms/vOn.spec.ts index 2e80729119d..f53fbb69b07 100644 --- a/packages/compiler-dom/__tests__/transforms/vOn.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/vOn.spec.ts @@ -14,7 +14,6 @@ import { transformOn } from '../../src/transforms/vOn' import { V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS } from '../../src/runtimeHelpers' import { transformElement } from '../../../compiler-core/src/transforms/transformElement' import { transformExpression } from '../../../compiler-core/src/transforms/transformExpression' -import { genFlagText } from '../../../compiler-core/__tests__/testUtils' import { PatchFlags } from '@vue/shared' function parseWithVOn(template: string, options: CompilerOptions = {}) { @@ -272,7 +271,7 @@ describe('compiler-dom: transform v-on', () => { // should not treat cached handler as dynamicProp, so it should have no // dynamicProps flags and only the hydration flag expect((root as any).children[0].codegenNode.patchFlag).toBe( - genFlagText(PatchFlags.NEED_HYDRATION), + PatchFlags.NEED_HYDRATION, ) expect(prop).toMatchObject({ key: { @@ -300,6 +299,6 @@ describe('compiler-dom: transform v-on', () => { }, }) // should only have hydration flag - expect(node.patchFlag).toBe(genFlagText(PatchFlags.NEED_HYDRATION)) + expect(node.patchFlag).toBe(PatchFlags.NEED_HYDRATION) }) }) diff --git a/packages/compiler-dom/__tests__/transforms/vText.spec.ts b/packages/compiler-dom/__tests__/transforms/vText.spec.ts index 1b717e83398..e96ab297298 100644 --- a/packages/compiler-dom/__tests__/transforms/vText.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/vText.spec.ts @@ -6,10 +6,7 @@ import { } from '@vue/compiler-core' import { transformVText } from '../../src/transforms/vText' import { transformElement } from '../../../compiler-core/src/transforms/transformElement' -import { - createObjectMatcher, - genFlagText, -} from '../../../compiler-core/__tests__/testUtils' +import { createObjectMatcher } from '../../../compiler-core/__tests__/testUtils' import { PatchFlags } from '@vue/shared' import { DOMErrorCodes } from '../../src/errors' @@ -36,7 +33,7 @@ describe('compiler: v-text transform', () => { }, }), children: undefined, - patchFlag: genFlagText(PatchFlags.PROPS), + patchFlag: PatchFlags.PROPS, dynamicProps: `["textContent"]`, }) }) @@ -57,7 +54,7 @@ describe('compiler: v-text transform', () => { }, }), children: undefined, // <-- children should have been removed - patchFlag: genFlagText(PatchFlags.PROPS), + patchFlag: PatchFlags.PROPS, dynamicProps: `["textContent"]`, }) }) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index 53974bc9384..60941d0369c 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -1317,76 +1317,83 @@ describe('SSR hydration', () => { // #10607 test('update component stable slot (prod + optimized mode)', async () => { __DEV__ = false - const container = document.createElement('div') - container.innerHTML = `` - const Comp = { - render(this: any) { - return ( - openBlock(), - createElementBlock('div', null, [renderSlot(this.$slots, 'default')]) - ) - }, - } - const show = ref(false) - const clicked = ref(false) - - const Wrapper = { - setup() { - const items = ref([]) - onMounted(() => { - items.value = [1] - }) - return () => { + try { + const container = document.createElement('div') + container.innerHTML = `` + const Comp = { + render(this: any) { return ( openBlock(), - createBlock(Comp, null, { - default: withCtx(() => [ - createElementVNode('div', null, [ + createElementBlock('div', null, [ + renderSlot(this.$slots, 'default'), + ]) + ) + }, + } + const show = ref(false) + const clicked = ref(false) + + const Wrapper = { + setup() { + const items = ref([]) + onMounted(() => { + items.value = [1] + }) + return () => { + return ( + openBlock(), + createBlock(Comp, null, { + default: withCtx(() => [ createElementVNode('div', null, [ - clicked.value - ? (openBlock(), - createElementBlock('div', { key: 0 }, 'foo')) - : createCommentVNode('v-if', true), + createElementVNode('div', null, [ + clicked.value + ? (openBlock(), + createElementBlock('div', { key: 0 }, 'foo')) + : createCommentVNode('v-if', true), + ]), ]), + createElementVNode( + 'div', + null, + items.value.length, + 1 /* TEXT */, + ), ]), - createElementVNode( - 'div', - null, - items.value.length, - 1 /* TEXT */, - ), - ]), - _: 1 /* STABLE */, - }) - ) - } - }, - } - createSSRApp({ - components: { Wrapper }, - data() { - return { show } - }, - template: ``, - }).mount(container) + _: 1 /* STABLE */, + }) + ) + } + }, + } + createSSRApp({ + components: { Wrapper }, + data() { + return { show } + }, + template: ``, + }).mount(container) - await nextTick() - expect(container.innerHTML).toBe( - `
1
`, - ) + await nextTick() + expect(container.innerHTML).toBe( + `
1
`, + ) - show.value = true - await nextTick() - expect(async () => { - clicked.value = true + show.value = true await nextTick() - }).not.toThrow("Cannot read properties of null (reading 'insertBefore')") + expect(async () => { + clicked.value = true + await nextTick() + }).not.toThrow("Cannot read properties of null (reading 'insertBefore')") - await nextTick() - expect(container.innerHTML).toBe( - `
foo
1
`, - ) - __DEV__ = true + await nextTick() + expect(container.innerHTML).toBe( + `
foo
1
`, + ) + } catch (e) { + throw e + } finally { + __DEV__ = true + } }) describe('mismatch handling', () => { From 2815531fd5fd437f12b62213933a9598e65528ce Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 13 Jul 2024 21:05:06 +0800 Subject: [PATCH 12/61] refactor: memoIndex -> cacheIndex --- packages/runtime-core/src/helpers/withMemo.ts | 2 +- packages/runtime-core/src/renderer.ts | 6 +++--- packages/runtime-core/src/vnode.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/runtime-core/src/helpers/withMemo.ts b/packages/runtime-core/src/helpers/withMemo.ts index 72ef814eefa..708726e89c9 100644 --- a/packages/runtime-core/src/helpers/withMemo.ts +++ b/packages/runtime-core/src/helpers/withMemo.ts @@ -15,7 +15,7 @@ export function withMemo( // shallow clone ret.memo = memo.slice() - ret.memoIndex = index + ret.cacheIndex = index return (cache[index] = ret) } diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 3f4a6f4a265..3f496cd8dd6 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -2109,7 +2109,7 @@ function baseCreateRenderer( shapeFlag, patchFlag, dirs, - memoIndex, + cacheIndex, } = vnode if (patchFlag === PatchFlags.BAIL) { @@ -2122,8 +2122,8 @@ function baseCreateRenderer( } // #6593 should clean memo cache when unmount - if (memoIndex != null) { - parentComponent!.renderCache[memoIndex] = undefined + if (cacheIndex != null) { + parentComponent!.renderCache[cacheIndex] = undefined } if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) { diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 626b288937d..d05d7744fad 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -243,7 +243,7 @@ export interface VNode< /** * @internal index for cleaning v-memo cache */ - memoIndex?: number + cacheIndex?: number /** * @internal __COMPAT__ only */ From 3107b57e2e9726985adef8fe56281988c89d5cdb Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 13 Jul 2024 21:07:45 +0800 Subject: [PATCH 13/61] refactor: isVNode -> isVOnce --- packages/compiler-core/src/ast.ts | 6 +++--- packages/compiler-core/src/codegen.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/compiler-core/src/ast.ts b/packages/compiler-core/src/ast.ts index 562e24e72e3..bbbb7f8a19d 100644 --- a/packages/compiler-core/src/ast.ts +++ b/packages/compiler-core/src/ast.ts @@ -416,7 +416,7 @@ export interface CacheExpression extends Node { type: NodeTypes.JS_CACHE_EXPRESSION index: number value: JSChildNode - isVNode: boolean + isVOnce: boolean } export interface MemoExpression extends CallExpression { @@ -771,13 +771,13 @@ export function createConditionalExpression( export function createCacheExpression( index: number, value: JSChildNode, - isVNode: boolean = false, + isVOnce: boolean = false, ): CacheExpression { return { type: NodeTypes.JS_CACHE_EXPRESSION, index, value, - isVNode, + isVOnce, loc: locStub, } } diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index 4dd51133ce7..392896d6082 100644 --- a/packages/compiler-core/src/codegen.ts +++ b/packages/compiler-core/src/codegen.ts @@ -1037,14 +1037,14 @@ function genConditionalExpression( function genCacheExpression(node: CacheExpression, context: CodegenContext) { const { push, helper, indent, deindent, newline } = context push(`_cache[${node.index}] || (`) - if (node.isVNode) { + if (node.isVOnce) { indent() push(`${helper(SET_BLOCK_TRACKING)}(-1),`) newline() } push(`_cache[${node.index}] = `) genNode(node.value, context) - if (node.isVNode) { + if (node.isVOnce) { push(`,`) newline() push(`${helper(SET_BLOCK_TRACKING)}(1),`) From d343a0dc01663f91db42b4ddb693e6fffcb45873 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 13 Jul 2024 21:38:32 +0800 Subject: [PATCH 14/61] fix(v-once): properly unmount v-once cached trees close #5154 close #8809 --- .../__snapshots__/codegen.spec.ts.snap | 4 +- .../compiler-core/__tests__/codegen.spec.ts | 4 +- .../__snapshots__/vOnce.spec.ts.snap | 10 ++-- packages/compiler-core/src/codegen.ts | 3 +- .../__tests__/rendererOptimizedMode.spec.ts | 54 +++++++++++++++++++ packages/runtime-core/__tests__/vnode.spec.ts | 5 +- packages/runtime-core/src/renderer.ts | 6 +++ packages/runtime-core/src/vnode.ts | 11 ++-- 8 files changed, 83 insertions(+), 14 deletions(-) diff --git a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap index a9591f922b4..db268af4f9b 100644 --- a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap @@ -19,12 +19,12 @@ export function render(_ctx, _cache) { }" `; -exports[`compiler: codegen > CacheExpression w/ isVNode: true 1`] = ` +exports[`compiler: codegen > CacheExpression w/ isVOnce: true 1`] = ` " export function render(_ctx, _cache) { return _cache[1] || ( _setBlockTracking(-1), - _cache[1] = foo, + (_cache[1] = foo).cacheIndex = 1, _setBlockTracking(1), _cache[1] ) diff --git a/packages/compiler-core/__tests__/codegen.spec.ts b/packages/compiler-core/__tests__/codegen.spec.ts index 4a5ba7d5c61..7724d507cb2 100644 --- a/packages/compiler-core/__tests__/codegen.spec.ts +++ b/packages/compiler-core/__tests__/codegen.spec.ts @@ -437,7 +437,7 @@ describe('compiler: codegen', () => { expect(code).toMatchSnapshot() }) - test('CacheExpression w/ isVNode: true', () => { + test('CacheExpression w/ isVOnce: true', () => { const { code } = generate( createRoot({ cached: 1, @@ -456,7 +456,7 @@ describe('compiler: codegen', () => { ` _cache[1] || ( _setBlockTracking(-1), - _cache[1] = foo, + (_cache[1] = foo).cacheIndex = 1, _setBlockTracking(1), _cache[1] ) diff --git a/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap b/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap index 1c1203552db..3d13c4066d9 100644 --- a/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap +++ b/packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap @@ -9,7 +9,7 @@ return function render(_ctx, _cache) { return _cache[0] || ( _setBlockTracking(-1), - _cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"]), + (_cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"])).cacheIndex = 0, _setBlockTracking(1), _cache[0] ) @@ -29,7 +29,7 @@ return function render(_ctx, _cache) { return (_openBlock(), _createElementBlock("div", null, [ _cache[0] || ( _setBlockTracking(-1), - _cache[0] = _createVNode(_component_Comp, { id: foo }, null, 8 /* PROPS */, ["id"]), + (_cache[0] = _createVNode(_component_Comp, { id: foo }, null, 8 /* PROPS */, ["id"])).cacheIndex = 0, _setBlockTracking(1), _cache[0] ) @@ -48,7 +48,7 @@ return function render(_ctx, _cache) { return (_openBlock(), _createElementBlock("div", null, [ _cache[0] || ( _setBlockTracking(-1), - _cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"]), + (_cache[0] = _createElementVNode("div", { id: foo }, null, 8 /* PROPS */, ["id"])).cacheIndex = 0, _setBlockTracking(1), _cache[0] ) @@ -67,7 +67,7 @@ return function render(_ctx, _cache) { return (_openBlock(), _createElementBlock("div", null, [ _cache[0] || ( _setBlockTracking(-1), - _cache[0] = _renderSlot($slots, "default"), + (_cache[0] = _renderSlot($slots, "default")).cacheIndex = 0, _setBlockTracking(1), _cache[0] ) @@ -86,7 +86,7 @@ return function render(_ctx, _cache) { return (_openBlock(), _createElementBlock("div", null, [ _cache[0] || ( _setBlockTracking(-1), - _cache[0] = _createElementVNode("div"), + (_cache[0] = _createElementVNode("div")).cacheIndex = 0, _setBlockTracking(1), _cache[0] ) diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index 392896d6082..b6535c5cef9 100644 --- a/packages/compiler-core/src/codegen.ts +++ b/packages/compiler-core/src/codegen.ts @@ -1041,11 +1041,12 @@ function genCacheExpression(node: CacheExpression, context: CodegenContext) { indent() push(`${helper(SET_BLOCK_TRACKING)}(-1),`) newline() + push(`(`) } push(`_cache[${node.index}] = `) genNode(node.value, context) if (node.isVOnce) { - push(`,`) + push(`).cacheIndex = ${node.index},`) newline() push(`${helper(SET_BLOCK_TRACKING)}(1),`) newline() diff --git a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts index 7abd94e1960..e0b49a5e7eb 100644 --- a/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts +++ b/packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts @@ -25,6 +25,7 @@ import { renderList, renderSlot, serialize, + setBlockTracking, withCtx, } from '@vue/runtime-test' import { PatchFlags, SlotFlags } from '@vue/shared' @@ -1178,4 +1179,57 @@ describe('renderer: optimized mode', () => { await nextTick() expect(inner(root)).toBe('
bar
') }) + + test('should not take unmount children fast path if children contain cached nodes', async () => { + const show = ref(true) + const spyUnmounted = vi.fn() + + const Child = { + setup() { + onUnmounted(spyUnmounted) + return () => createVNode('div', null, 'Child') + }, + } + + const app = createApp({ + render(_: any, cache: any) { + return show.value + ? (openBlock(), + createBlock('div', null, [ + createVNode('div', null, [ + cache[0] || + (setBlockTracking(-1), + ((cache[0] = createVNode('div', null, [ + createVNode(Child), + ])).cacheIndex = 0), + setBlockTracking(1), + cache[0]), + ]), + ])) + : createCommentVNode('v-if', true) + }, + }) + + app.mount(root) + expect(inner(root)).toBe( + '
Child
', + ) + + show.value = false + await nextTick() + expect(inner(root)).toBe('') + expect(spyUnmounted).toHaveBeenCalledTimes(1) + + show.value = true + await nextTick() + expect(inner(root)).toBe( + '
Child
', + ) + + // should unmount again, this verifies previous cache was properly cleared + show.value = false + await nextTick() + expect(inner(root)).toBe('') + expect(spyUnmounted).toHaveBeenCalledTimes(2) + }) }) diff --git a/packages/runtime-core/__tests__/vnode.spec.ts b/packages/runtime-core/__tests__/vnode.spec.ts index 39a7abd5f89..2e0eee1f280 100644 --- a/packages/runtime-core/__tests__/vnode.spec.ts +++ b/packages/runtime-core/__tests__/vnode.spec.ts @@ -2,6 +2,7 @@ import { Comment, Fragment, Text, + type VNode, cloneVNode, createBlock, createVNode, @@ -633,7 +634,9 @@ describe('vnode', () => { setBlockTracking(1), vnode1, ])) - expect(vnode.dynamicChildren).toStrictEqual([]) + const expected: VNode['dynamicChildren'] = [] + expected.hasOnce = true + expect(vnode.dynamicChildren).toStrictEqual(expected) }) // #5657 test('error of slot function execution should not affect block tracking', () => { diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 3f496cd8dd6..8a64baad1c0 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -2164,6 +2164,12 @@ function baseCreateRenderer( ) } else if ( dynamicChildren && + // #5154 + // when v-once is used inside a block, setBlockTracking(-1) marks the + // parent block with hasOnce: true + // so that it doesn't take the fast path during unmount - otherwise + // components nested in v-once are never unmounted. + !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments (type !== Fragment || (patchFlag > 0 && patchFlag & PatchFlags.STABLE_FRAGMENT)) diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index d05d7744fad..2210440e717 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -226,7 +226,7 @@ export interface VNode< /** * @internal */ - dynamicChildren: VNode[] | null + dynamicChildren: (VNode[] & { hasOnce?: boolean }) | null // application root node only appContext: AppContext | null @@ -259,8 +259,8 @@ export interface VNode< // can divide a template into nested blocks, and within each block the node // structure would be stable. This allows us to skip most children diffing // and only worry about the dynamic nodes (indicated by patch flags). -export const blockStack: (VNode[] | null)[] = [] -export let currentBlock: VNode[] | null = null +export const blockStack: VNode['dynamicChildren'][] = [] +export let currentBlock: VNode['dynamicChildren'] = null /** * Open a block. @@ -311,6 +311,11 @@ export let isBlockTreeEnabled = 1 */ export function setBlockTracking(value: number) { isBlockTreeEnabled += value + if (value < 0 && currentBlock) { + // mark current block so it doesn't take fast path and skip possible + // nested components duriung unmount + currentBlock.hasOnce = true + } } function setupBlock(vnode: VNode) { From f1aae57dfeb2aa9cf76e28309e19713d568807d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:22:03 +0800 Subject: [PATCH 15/61] chore(deps): update all non-major dependencies (#11357) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- packages/compiler-sfc/package.json | 2 +- pnpm-lock.yaml | 68 +++++++++++++++--------------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index fc3cdae7e8a..77f6d27efc4 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "pretty-bytes": "^6.1.1", "pug": "^3.0.3", "puppeteer": "~22.12.1", - "rimraf": "^5.0.8", + "rimraf": "^5.0.9", "rollup": "^4.18.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 1ac76dc1722..e1d81c7cdde 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.0", "pug": "^3.0.3", - "sass": "^1.77.6" + "sass": "^1.77.8" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c610281b044..8e5d65754d1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,7 +37,7 @@ importers: version: 7.24.7 '@codspeed/vitest-plugin': specifier: ^3.1.0 - version: 3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1)) + version: 3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) '@rollup/plugin-alias': specifier: ^5.1.0 version: 5.1.0(rollup@4.18.0) @@ -67,7 +67,7 @@ importers: version: 7.5.8 '@vitest/coverage-istanbul': specifier: ^1.6.0 - version: 1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1)) + version: 1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -91,7 +91,7 @@ importers: version: 0.5.3(eslint@9.6.0)(typescript@5.4.5) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1)) + version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) estree-walker: specifier: ^2.0.2 version: 2.0.2 @@ -132,8 +132,8 @@ importers: specifier: ~22.12.1 version: 22.12.1(typescript@5.4.5) rimraf: - specifier: ^5.0.8 - version: 5.0.8 + specifier: ^5.0.9 + version: 5.0.9 rollup: specifier: ^4.18.0 version: 4.18.0 @@ -175,10 +175,10 @@ importers: version: 7.15.0(eslint@9.6.0)(typescript@5.4.5) vite: specifier: 'catalog:' - version: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + version: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1) + version: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) packages/compiler-core: dependencies: @@ -269,8 +269,8 @@ importers: specifier: ^3.0.3 version: 3.0.3 sass: - specifier: ^1.77.6 - version: 1.77.6 + specifier: ^1.77.8 + version: 1.77.8 packages/compiler-ssr: dependencies: @@ -370,10 +370,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^5.0.5 - version: 5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1))(vue@packages+vue) + version: 5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + version: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) packages/shared: {} @@ -2965,9 +2965,9 @@ packages: rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rimraf@5.0.8: - resolution: {integrity: sha512-XSh0V2/yNhDEi8HwdIefD8MLgs4LQXPag/nEJWs3YUc3Upn+UHa1GyIkEg9xSSNt7HnkO5FjTvmcRzgf+8UZuw==} - engines: {node: '>=18'} + rimraf@5.0.9: + resolution: {integrity: sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==} + engines: {node: 14 >=14.20 || 16 >=16.20 || >=18} hasBin: true rollup-plugin-dts@6.1.1: @@ -3012,8 +3012,8 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass@1.77.6: - resolution: {integrity: sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==} + sass@1.77.8: + resolution: {integrity: sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==} engines: {node: '>=14.0.0'} hasBin: true @@ -3705,11 +3705,11 @@ snapshots: transitivePeerDependencies: - debug - '@codspeed/vitest-plugin@3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1))': + '@codspeed/vitest-plugin@3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': dependencies: '@codspeed/core': 3.1.0 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - debug @@ -4221,12 +4221,12 @@ snapshots: '@typescript-eslint/types': 7.15.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1))(vue@packages+vue)': + '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': dependencies: - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) vue: link:packages/vue - '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1))': + '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': dependencies: debug: 4.3.5 istanbul-lib-coverage: 3.2.2 @@ -4237,7 +4237,7 @@ snapshots: magicast: 0.3.4 picocolors: 1.0.1 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color @@ -4918,12 +4918,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1)): + eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)): dependencies: '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) eslint: 9.6.0 optionalDependencies: - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color - typescript @@ -6116,7 +6116,7 @@ snapshots: rfdc@1.4.1: {} - rimraf@5.0.8: + rimraf@5.0.9: dependencies: glob: 10.4.3 @@ -6180,7 +6180,7 @@ snapshots: safer-buffer@2.1.2: {} - sass@1.77.6: + sass@1.77.8: dependencies: chokidar: 3.6.0 immutable: 4.3.6 @@ -6535,13 +6535,13 @@ snapshots: vary@1.1.2: {} - vite-node@1.6.0(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1): + vite-node@1.6.0(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1): dependencies: cac: 6.7.14 debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - less @@ -6552,7 +6552,7 @@ snapshots: - supports-color - terser - vite@5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1): + vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1): dependencies: esbuild: 0.21.5 postcss: 8.4.39 @@ -6560,10 +6560,10 @@ snapshots: optionalDependencies: '@types/node': 20.14.10 fsevents: 2.3.3 - sass: 1.77.6 + sass: 1.77.8 terser: 5.31.1 - vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.6)(terser@5.31.1): + vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -6582,8 +6582,8 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) - vite-node: 1.6.0(@types/node@20.14.10)(sass@1.77.6)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + vite-node: 1.6.0(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) why-is-node-running: 2.2.2 optionalDependencies: '@types/node': 20.14.10 From 789675f65d2b72cf979ba6a29bd323f716154a4b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 15 Jul 2024 16:25:58 +0800 Subject: [PATCH 16/61] fix(build): use consistent minify options from previous terser config --- rollup.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 1253a42e0db..ff0da348826 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -374,7 +374,11 @@ function createMinifiedConfig(/** @type {PackageFormat} */ format) { ) { const { code, map } = await minifySwc(contents, { module: format === 'es', - compress: true, + compress: { + ecma: 2016, + pure_getters: true, + }, + safari10: true, mangle: true, sourceMap: !!sourcemap, inlineSourcesContent: !sourcemapExcludeSources, From 36b1fefeacde6991e3d191c4a12423f2b2f660e2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 15 Jul 2024 16:28:47 +0800 Subject: [PATCH 17/61] chore: remove terser dep --- .github/renovate.json5 | 2 +- package.json | 1 - pnpm-lock.yaml | 12 +++++++----- scripts/usage-size.ts | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e87294b5b1d..9c04587027d 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -28,7 +28,7 @@ }, { groupName: 'build', - matchPackageNames: ['vite', 'terser'], + matchPackageNames: ['vite', '@swc/core'], matchPackagePrefixes: ['rollup', 'esbuild', '@rollup', '@vitejs'], }, { diff --git a/package.json b/package.json index 77f6d27efc4..97539dcffb7 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,6 @@ "semver": "^7.6.2", "serve": "^14.2.3", "simple-git-hooks": "^2.11.1", - "terser": "^5.31.1", "todomvc-app-css": "^2.4.3", "tslib": "^2.6.3", "tsx": "^4.16.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e5d65754d1..cbff18c6b98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -155,9 +155,6 @@ importers: simple-git-hooks: specifier: ^2.11.1 version: 2.11.1 - terser: - specifier: ^5.31.1 - version: 5.31.1 todomvc-app-css: specifier: ^2.4.3 version: 2.4.3 @@ -3922,6 +3919,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + optional: true '@jridgewell/sourcemap-codec@1.4.15': {} @@ -4449,7 +4447,8 @@ snapshots: buffer-crc32@0.2.13: {} - buffer-from@1.1.2: {} + buffer-from@1.1.2: + optional: true buffer@5.7.1: dependencies: @@ -4575,7 +4574,8 @@ snapshots: commander@12.1.0: {} - commander@2.20.3: {} + commander@2.20.3: + optional: true commondir@1.0.1: {} @@ -6287,6 +6287,7 @@ snapshots: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 + optional: true source-map@0.6.1: {} @@ -6406,6 +6407,7 @@ snapshots: acorn: 8.12.1 commander: 2.20.3 source-map-support: 0.5.21 + optional: true test-exclude@6.0.0: dependencies: diff --git a/scripts/usage-size.ts b/scripts/usage-size.ts index 7eddbeb6696..d05273de076 100644 --- a/scripts/usage-size.ts +++ b/scripts/usage-size.ts @@ -2,7 +2,7 @@ import { mkdir, writeFile } from 'node:fs/promises' import path from 'node:path' import { rollup } from 'rollup' import nodeResolve from '@rollup/plugin-node-resolve' -import { minify } from 'terser' +import { minify } from '@swc/core' import replace from '@rollup/plugin-replace' import { brotliCompressSync, gzipSync } from 'node:zlib' From c4025015dbae6867c5ec73d7bdfd313f1544e477 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 15 Jul 2024 16:29:25 +0800 Subject: [PATCH 18/61] chore: remove codspeed plugin --- package.json | 1 - pnpm-lock.yaml | 57 ------------------------------------------------ vitest.config.ts | 2 -- 3 files changed, 60 deletions(-) diff --git a/package.json b/package.json index 97539dcffb7..cbaaf65d428 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "devDependencies": { "@babel/parser": "catalog:", "@babel/types": "catalog:", - "@codspeed/vitest-plugin": "^3.1.0", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-commonjs": "^26.0.1", "@rollup/plugin-json": "^6.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbff18c6b98..2939380f3d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,9 +35,6 @@ importers: '@babel/types': specifier: 'catalog:' version: 7.24.7 - '@codspeed/vitest-plugin': - specifier: ^3.1.0 - version: 3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) '@rollup/plugin-alias': specifier: ^5.1.0 version: 5.1.0(rollup@4.18.0) @@ -512,15 +509,6 @@ packages: resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} engines: {node: '>=6.9.0'} - '@codspeed/core@3.1.0': - resolution: {integrity: sha512-oYd7X46QhnRkgRbZkqAoX9i3Fwm17FpunK4Ee5RdrvRYR0Xr93ewH8/O5g6uyTPDOOqDEv1v2KRYtWhVgN+2VQ==} - - '@codspeed/vitest-plugin@3.1.0': - resolution: {integrity: sha512-ms11tUytiQTgB+idxZRUuCUQfgz4LaKTDJCLYm5VTSpOCUU7D5+QWvJnA8X8B9glPfR5siIK8RxrnZP4yuysKQ==} - peerDependencies: - vite: ^4.2.0 || ^5.0.0 - vitest: '>=1.2.2' - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -1349,9 +1337,6 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - axios@1.7.2: - resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} - b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} @@ -1965,15 +1950,6 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - foreground-child@3.2.1: resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} engines: {node: '>=14'} @@ -2583,10 +2559,6 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - node-gyp-build@4.8.1: - resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==} - hasBin: true - node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -3693,23 +3665,6 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 - '@codspeed/core@3.1.0': - dependencies: - axios: 1.7.2 - find-up: 6.3.0 - form-data: 4.0.0 - node-gyp-build: 4.8.1 - transitivePeerDependencies: - - debug - - '@codspeed/vitest-plugin@3.1.0(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': - dependencies: - '@codspeed/core': 3.1.0 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) - transitivePeerDependencies: - - debug - '@esbuild/aix-ppc64@0.21.5': optional: true @@ -4369,14 +4324,6 @@ snapshots: asynckit@0.4.0: {} - axios@1.7.2: - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - b4a@1.6.6: {} babel-walk@3.0.0-canary-5: @@ -5093,8 +5040,6 @@ snapshots: flatted@3.3.1: {} - follow-redirects@1.15.6: {} - foreground-child@3.2.1: dependencies: cross-spawn: 7.0.3 @@ -5685,8 +5630,6 @@ snapshots: netmask@2.0.2: {} - node-gyp-build@4.8.1: {} - node-releases@2.0.14: {} normalize-package-data@6.0.2: diff --git a/vitest.config.ts b/vitest.config.ts index ae14f3fb76e..f63328ab480 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,6 +1,5 @@ import { configDefaults, defineConfig } from 'vitest/config' import { entries } from './scripts/aliases.js' -import codspeedPlugin from '@codspeed/vitest-plugin' export default defineConfig({ define: { @@ -22,7 +21,6 @@ export default defineConfig({ resolve: { alias: entries, }, - plugins: [codspeedPlugin()], test: { globals: true, setupFiles: 'scripts/setup-vitest.ts', From 1676f079b639c5b35271316aa2da6241630a0883 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Mon, 15 Jul 2024 16:31:27 +0800 Subject: [PATCH 19/61] chore: fix @babel/types version in pnpm catalog (#11349) --- package.json | 2 +- pnpm-lock.yaml | 4 ++-- pnpm-workspace.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cbaaf65d428..87b987e67c5 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "eslint": "^9.6.0", "eslint-plugin-import-x": "^0.5.3", "eslint-plugin-vitest": "^0.5.4", - "estree-walker": "^2.0.2", + "estree-walker": "catalog:", "jsdom": "^24.1.0", "lint-staged": "^15.2.7", "lodash": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2939380f3d9..2318d4aadd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ catalogs: specifier: ^7.24.7 version: 7.24.7 '@babel/types': - specifier: ^7.2.47 + specifier: ^7.24.7 version: 7.24.7 estree-walker: specifier: ^2.0.2 @@ -90,7 +90,7 @@ importers: specifier: ^0.5.4 version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) estree-walker: - specifier: ^2.0.2 + specifier: 'catalog:' version: 2.0.2 jsdom: specifier: ^24.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ed983f03a11..fc5da1b9d7b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,7 @@ packages: catalog: '@babel/parser': ^7.24.7 - '@babel/types': ^7.2.47 + '@babel/types': ^7.24.7 'estree-walker': ^2.0.2 'magic-string': ^0.30.10 'source-map-js': ^1.2.0 From c8b97945759e869c997d60c3350d2451c5ff7887 Mon Sep 17 00:00:00 2001 From: _Kerman Date: Mon, 15 Jul 2024 21:54:53 +0800 Subject: [PATCH 20/61] fix(hmr): hmr reload should work with async component (#11248) --- packages/runtime-core/__tests__/hmr.spec.ts | 64 ++++++++++++++++++--- packages/runtime-core/src/hmr.ts | 28 ++++----- packages/runtime-core/src/vnode.ts | 21 ++++--- 3 files changed, 80 insertions(+), 33 deletions(-) diff --git a/packages/runtime-core/__tests__/hmr.spec.ts b/packages/runtime-core/__tests__/hmr.spec.ts index 39aece16a5a..ba9c7c0780b 100644 --- a/packages/runtime-core/__tests__/hmr.spec.ts +++ b/packages/runtime-core/__tests__/hmr.spec.ts @@ -29,6 +29,8 @@ function compileToFunction(template: string) { return render } +const timeout = (n: number = 0) => new Promise(r => setTimeout(r, n)) + describe('hot module replacement', () => { test('inject global runtime', () => { expect(createRecord).toBeDefined() @@ -436,18 +438,23 @@ describe('hot module replacement', () => { const Parent: ComponentOptions = { setup() { - const com = ref() - const changeRef = (value: any) => { - com.value = value - } + const com1 = ref() + const changeRef1 = (value: any) => (com1.value = value) + + const com2 = ref() + const changeRef2 = (value: any) => (com2.value = value) - return () => [h(Child, { ref: changeRef }), com.value?.count] + return () => [ + h(Child, { ref: changeRef1 }), + h(Child, { ref: changeRef2 }), + com1.value?.count, + ] }, } render(h(Parent), root) await nextTick() - expect(serializeInner(root)).toBe(`
0
0`) + expect(serializeInner(root)).toBe(`
0
0
0`) reload(childId, { __hmrId: childId, @@ -458,9 +465,9 @@ describe('hot module replacement', () => { render: compileToFunction(`
{{ count }}
`), }) await nextTick() - expect(serializeInner(root)).toBe(`
1
1`) - expect(unmountSpy).toHaveBeenCalledTimes(1) - expect(mountSpy).toHaveBeenCalledTimes(1) + expect(serializeInner(root)).toBe(`
1
1
1`) + expect(unmountSpy).toHaveBeenCalledTimes(2) + expect(mountSpy).toHaveBeenCalledTimes(2) }) // #1156 - static nodes should retain DOM element reference across updates @@ -805,4 +812,43 @@ describe('hot module replacement', () => { `
1

3

1

3

2

`, ) }) + + // #11248 + test('reload async component with multiple instances', async () => { + const root = nodeOps.createElement('div') + const childId = 'test-child-id' + const Child: ComponentOptions = { + __hmrId: childId, + data() { + return { count: 0 } + }, + render: compileToFunction(`
{{ count }}
`), + } + const Comp = runtimeTest.defineAsyncComponent(() => Promise.resolve(Child)) + const appId = 'test-app-id' + const App: ComponentOptions = { + __hmrId: appId, + render: () => [h(Comp), h(Comp)], + } + createRecord(appId, App) + + render(h(App), root) + + await timeout() + + expect(serializeInner(root)).toBe(`
0
0
`) + + // change count to 1 + reload(childId, { + __hmrId: childId, + data() { + return { count: 1 } + }, + render: compileToFunction(`
{{ count }}
`), + }) + + await timeout() + + expect(serializeInner(root)).toBe(`
1
1
`) + }) }) diff --git a/packages/runtime-core/src/hmr.ts b/packages/runtime-core/src/hmr.ts index 8196eb89195..5a4a95705b0 100644 --- a/packages/runtime-core/src/hmr.ts +++ b/packages/runtime-core/src/hmr.ts @@ -14,7 +14,10 @@ type HMRComponent = ComponentOptions | ClassComponent export let isHmrUpdating = false -export const hmrDirtyComponents = new Set() +export const hmrDirtyComponents = new Map< + ConcreteComponent, + Set +>() export interface HMRRuntime { createRecord: typeof createRecord @@ -110,18 +113,21 @@ function reload(id: string, newComp: HMRComponent) { // create a snapshot which avoids the set being mutated during updates const instances = [...record.instances] - for (const instance of instances) { + for (let i = 0; i < instances.length; i++) { + const instance = instances[i] const oldComp = normalizeClassComponent(instance.type as HMRComponent) - if (!hmrDirtyComponents.has(oldComp)) { + let dirtyInstances = hmrDirtyComponents.get(oldComp) + if (!dirtyInstances) { // 1. Update existing comp definition to match new one if (oldComp !== record.initialDef) { updateComponentDef(oldComp, newComp) } // 2. mark definition dirty. This forces the renderer to replace the // component on patch. - hmrDirtyComponents.add(oldComp) + hmrDirtyComponents.set(oldComp, (dirtyInstances = new Set())) } + dirtyInstances.add(instance) // 3. invalidate options resolution cache instance.appContext.propsCache.delete(instance.type as any) @@ -131,9 +137,9 @@ function reload(id: string, newComp: HMRComponent) { // 4. actually update if (instance.ceReload) { // custom element - hmrDirtyComponents.add(oldComp) + dirtyInstances.add(instance) instance.ceReload((newComp as any).styles) - hmrDirtyComponents.delete(oldComp) + dirtyInstances.delete(instance) } else if (instance.parent) { // 4. Force the parent instance to re-render. This will cause all updated // components to be unmounted and re-mounted. Queue the update so that we @@ -141,8 +147,8 @@ function reload(id: string, newComp: HMRComponent) { instance.parent.effect.dirty = true queueJob(() => { instance.parent!.update() - // #6930 avoid infinite recursion - hmrDirtyComponents.delete(oldComp) + // #6930, #11248 avoid infinite recursion + dirtyInstances.delete(instance) }) } else if (instance.appContext.reload) { // root instance mounted via createApp() has a reload method @@ -159,11 +165,7 @@ function reload(id: string, newComp: HMRComponent) { // 5. make sure to cleanup dirty hmr components after update queuePostFlushCb(() => { - for (const instance of instances) { - hmrDirtyComponents.delete( - normalizeClassComponent(instance.type as HMRComponent), - ) - } + hmrDirtyComponents.clear() }) } diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 2210440e717..a0d4074aaea 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -387,17 +387,16 @@ export function isVNode(value: any): value is VNode { } export function isSameVNodeType(n1: VNode, n2: VNode): boolean { - if ( - __DEV__ && - n2.shapeFlag & ShapeFlags.COMPONENT && - hmrDirtyComponents.has(n2.type as ConcreteComponent) - ) { - // #7042, ensure the vnode being unmounted during HMR - // bitwise operations to remove keep alive flags - n1.shapeFlag &= ~ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE - n2.shapeFlag &= ~ShapeFlags.COMPONENT_KEPT_ALIVE - // HMR only: if the component has been hot-updated, force a reload. - return false + if (__DEV__ && n2.shapeFlag & ShapeFlags.COMPONENT && n1.component) { + const dirtyInstances = hmrDirtyComponents.get(n2.type as ConcreteComponent) + if (dirtyInstances && dirtyInstances.has(n1.component)) { + // #7042, ensure the vnode being unmounted during HMR + // bitwise operations to remove keep alive flags + n1.shapeFlag &= ~ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE + n2.shapeFlag &= ~ShapeFlags.COMPONENT_KEPT_ALIVE + // HMR only: if the component has been hot-updated, force a reload. + return false + } } return n1.type === n2.type && n1.key === n2.key } From b0aa234e5e7a611c018de68bc31e0cf55518d5ce Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:56:37 +0100 Subject: [PATCH 21/61] fix(runtime-core): use separate prop caches for components and mixins (#11350) Co-authored-by: Red Huang close #7998 --- .../__tests__/componentProps.spec.ts | 90 +++++++++++++++++++ packages/runtime-core/src/componentProps.ts | 5 +- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/componentProps.spec.ts b/packages/runtime-core/__tests__/componentProps.spec.ts index 8244580005b..8c9c38b3c1f 100644 --- a/packages/runtime-core/__tests__/componentProps.spec.ts +++ b/packages/runtime-core/__tests__/componentProps.spec.ts @@ -538,6 +538,96 @@ describe('component props', () => { expect(renderProxy.$props).toMatchObject(props) }) + test('merging props from global mixins and extends', () => { + let renderProxy: any + let extendedRenderProxy: any + + const defaultProp = ' from global' + const props = { + globalProp: { + type: String, + default: defaultProp, + }, + } + const globalMixin = { + props, + } + const Comp = { + render(this: any) { + renderProxy = this + return h('div', ['Comp', this.globalProp]) + }, + } + const ExtendedComp = { + extends: Comp, + render(this: any) { + extendedRenderProxy = this + return h('div', ['ExtendedComp', this.globalProp]) + }, + } + + const app = createApp( + { + render: () => [h(ExtendedComp), h(Comp)], + }, + {}, + ) + app.mixin(globalMixin) + + const root = nodeOps.createElement('div') + app.mount(root) + + expect(serializeInner(root)).toMatch( + `
ExtendedComp from global
Comp from global
`, + ) + expect(renderProxy.$props).toMatchObject({ globalProp: defaultProp }) + expect(extendedRenderProxy.$props).toMatchObject({ + globalProp: defaultProp, + }) + }) + + test('merging props for a component that is also used as a mixin', () => { + const CompA = { + render(this: any) { + return this.foo + }, + } + + const mixin = { + props: { + foo: { + default: 'from mixin', + }, + }, + } + + const CompB = { + mixins: [mixin, CompA], + render(this: any) { + return this.foo + }, + } + + const app = createApp({ + render() { + return [h(CompA), ', ', h(CompB)] + }, + }) + + app.mixin({ + props: { + foo: { + default: 'from global mixin', + }, + }, + }) + + const root = nodeOps.createElement('div') + app.mount(root) + + expect(serializeInner(root)).toMatch(`from global mixin, from mixin`) + }) + test('props type support BigInt', () => { const Comp = { props: { diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 5a4292b6f36..9d7b7f0e4a5 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -496,12 +496,15 @@ function resolvePropValue( return value } +const mixinPropsCache = new WeakMap() + export function normalizePropsOptions( comp: ConcreteComponent, appContext: AppContext, asMixin = false, ): NormalizedPropsOptions { - const cache = appContext.propsCache + const cache = + __FEATURE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache const cached = cache.get(comp) if (cached) { return cached From 89e2d258dc3abaf82b1f855425c67ba751e0920b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:56:55 +0800 Subject: [PATCH 22/61] chore(deps): update dependency rollup to ^4.18.1 (#11358) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 229 +++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 193 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 87b987e67c5..d405d373f16 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "pug": "^3.0.3", "puppeteer": "~22.12.1", "rimraf": "^5.0.9", - "rollup": "^4.18.0", + "rollup": "^4.18.1", "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 2318d4aadd1..417554c9185 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,19 +37,19 @@ importers: version: 7.24.7 '@rollup/plugin-alias': specifier: ^5.1.0 - version: 5.1.0(rollup@4.18.0) + version: 5.1.0(rollup@4.18.1) '@rollup/plugin-commonjs': specifier: ^26.0.1 - version: 26.0.1(rollup@4.18.0) + version: 26.0.1(rollup@4.18.1) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.18.0) + version: 6.1.0(rollup@4.18.1) '@rollup/plugin-node-resolve': specifier: ^15.2.3 - version: 15.2.3(rollup@4.18.0) + version: 15.2.3(rollup@4.18.1) '@rollup/plugin-replace': specifier: 5.0.4 - version: 5.0.4(rollup@4.18.0) + version: 5.0.4(rollup@4.18.1) '@swc/core': specifier: ^1.6.13 version: 1.6.13 @@ -132,17 +132,17 @@ importers: specifier: ^5.0.9 version: 5.0.9 rollup: - specifier: ^4.18.0 - version: 4.18.0 + specifier: ^4.18.1 + version: 4.18.1 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.18.0)(typescript@5.4.5) + version: 6.1.1(rollup@4.18.1)(typescript@5.4.5) rollup-plugin-esbuild: specifier: ^6.1.1 - version: 6.1.1(esbuild@0.23.0)(rollup@4.18.0) + version: 6.1.1(esbuild@0.23.0)(rollup@4.18.1) rollup-plugin-polyfill-node: specifier: ^0.13.0 - version: 0.13.0(rollup@4.18.0) + version: 0.13.0(rollup@4.18.1) semver: specifier: ^7.6.2 version: 7.6.2 @@ -954,81 +954,161 @@ packages: cpu: [arm] os: [android] + '@rollup/rollup-android-arm-eabi@4.18.1': + resolution: {integrity: sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==} + cpu: [arm] + os: [android] + '@rollup/rollup-android-arm64@4.18.0': resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} cpu: [arm64] os: [android] + '@rollup/rollup-android-arm64@4.18.1': + resolution: {integrity: sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==} + cpu: [arm64] + os: [android] + '@rollup/rollup-darwin-arm64@4.18.0': resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} cpu: [arm64] os: [darwin] + '@rollup/rollup-darwin-arm64@4.18.1': + resolution: {integrity: sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==} + cpu: [arm64] + os: [darwin] + '@rollup/rollup-darwin-x64@4.18.0': resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} cpu: [x64] os: [darwin] + '@rollup/rollup-darwin-x64@4.18.1': + resolution: {integrity: sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==} + cpu: [x64] + os: [darwin] + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + resolution: {integrity: sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.18.0': resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} cpu: [arm] os: [linux] + '@rollup/rollup-linux-arm-musleabihf@4.18.1': + resolution: {integrity: sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==} + cpu: [arm] + os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.18.0': resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-gnu@4.18.1': + resolution: {integrity: sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-arm64-musl@4.18.0': resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} cpu: [arm64] os: [linux] + '@rollup/rollup-linux-arm64-musl@4.18.1': + resolution: {integrity: sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==} + cpu: [arm64] + os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} cpu: [ppc64] os: [linux] + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + resolution: {integrity: sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==} + cpu: [ppc64] + os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.18.0': resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} cpu: [riscv64] os: [linux] + '@rollup/rollup-linux-riscv64-gnu@4.18.1': + resolution: {integrity: sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==} + cpu: [riscv64] + os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.18.0': resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} cpu: [s390x] os: [linux] + '@rollup/rollup-linux-s390x-gnu@4.18.1': + resolution: {integrity: sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==} + cpu: [s390x] + os: [linux] + '@rollup/rollup-linux-x64-gnu@4.18.0': resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-gnu@4.18.1': + resolution: {integrity: sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==} + cpu: [x64] + os: [linux] + '@rollup/rollup-linux-x64-musl@4.18.0': resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} cpu: [x64] os: [linux] + '@rollup/rollup-linux-x64-musl@4.18.1': + resolution: {integrity: sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==} + cpu: [x64] + os: [linux] + '@rollup/rollup-win32-arm64-msvc@4.18.0': resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} cpu: [arm64] os: [win32] + '@rollup/rollup-win32-arm64-msvc@4.18.1': + resolution: {integrity: sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==} + cpu: [arm64] + os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.18.0': resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} cpu: [ia32] os: [win32] + '@rollup/rollup-win32-ia32-msvc@4.18.1': + resolution: {integrity: sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==} + cpu: [ia32] + os: [win32] + '@rollup/rollup-win32-x64-msvc@4.18.0': resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} cpu: [x64] os: [win32] + '@rollup/rollup-win32-x64-msvc@4.18.1': + resolution: {integrity: sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==} + cpu: [x64] + os: [win32] + '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -2963,6 +3043,11 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + rollup@4.18.1: + resolution: {integrity: sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + rrweb-cssom@0.6.0: resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} @@ -3913,111 +3998,159 @@ snapshots: transitivePeerDependencies: - supports-color - '@rollup/plugin-alias@5.1.0(rollup@4.18.0)': + '@rollup/plugin-alias@5.1.0(rollup@4.18.1)': dependencies: slash: 4.0.0 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/plugin-commonjs@26.0.1(rollup@4.18.0)': + '@rollup/plugin-commonjs@26.0.1(rollup@4.18.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) commondir: 1.0.1 estree-walker: 2.0.2 glob: 10.4.3 is-reference: 1.2.1 magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/plugin-inject@5.0.5(rollup@4.18.0)': + '@rollup/plugin-inject@5.0.5(rollup@4.18.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) estree-walker: 2.0.2 magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/plugin-json@6.1.0(rollup@4.18.0)': + '@rollup/plugin-json@6.1.0(rollup@4.18.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/plugin-node-resolve@15.2.3(rollup@4.18.0)': + '@rollup/plugin-node-resolve@15.2.3(rollup@4.18.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/plugin-replace@5.0.4(rollup@4.18.0)': + '@rollup/plugin-replace@5.0.4(rollup@4.18.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 - '@rollup/pluginutils@5.1.0(rollup@4.18.0)': + '@rollup/pluginutils@5.1.0(rollup@4.18.1)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.18.0 + rollup: 4.18.1 '@rollup/rollup-android-arm-eabi@4.18.0': optional: true + '@rollup/rollup-android-arm-eabi@4.18.1': + optional: true + '@rollup/rollup-android-arm64@4.18.0': optional: true + '@rollup/rollup-android-arm64@4.18.1': + optional: true + '@rollup/rollup-darwin-arm64@4.18.0': optional: true + '@rollup/rollup-darwin-arm64@4.18.1': + optional: true + '@rollup/rollup-darwin-x64@4.18.0': optional: true + '@rollup/rollup-darwin-x64@4.18.1': + optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': optional: true + '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + optional: true + '@rollup/rollup-linux-arm-musleabihf@4.18.0': optional: true + '@rollup/rollup-linux-arm-musleabihf@4.18.1': + optional: true + '@rollup/rollup-linux-arm64-gnu@4.18.0': optional: true + '@rollup/rollup-linux-arm64-gnu@4.18.1': + optional: true + '@rollup/rollup-linux-arm64-musl@4.18.0': optional: true + '@rollup/rollup-linux-arm64-musl@4.18.1': + optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': optional: true + '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + optional: true + '@rollup/rollup-linux-riscv64-gnu@4.18.0': optional: true + '@rollup/rollup-linux-riscv64-gnu@4.18.1': + optional: true + '@rollup/rollup-linux-s390x-gnu@4.18.0': optional: true + '@rollup/rollup-linux-s390x-gnu@4.18.1': + optional: true + '@rollup/rollup-linux-x64-gnu@4.18.0': optional: true + '@rollup/rollup-linux-x64-gnu@4.18.1': + optional: true + '@rollup/rollup-linux-x64-musl@4.18.0': optional: true + '@rollup/rollup-linux-x64-musl@4.18.1': + optional: true + '@rollup/rollup-win32-arm64-msvc@4.18.0': optional: true + '@rollup/rollup-win32-arm64-msvc@4.18.1': + optional: true + '@rollup/rollup-win32-ia32-msvc@4.18.0': optional: true + '@rollup/rollup-win32-ia32-msvc@4.18.1': + optional: true + '@rollup/rollup-win32-x64-msvc@4.18.0': optional: true + '@rollup/rollup-win32-x64-msvc@4.18.1': + optional: true + '@sinclair/typebox@0.27.8': {} '@swc/core-darwin-arm64@1.6.13': @@ -6063,29 +6196,29 @@ snapshots: dependencies: glob: 10.4.3 - rollup-plugin-dts@6.1.1(rollup@4.18.0)(typescript@5.4.5): + rollup-plugin-dts@6.1.1(rollup@4.18.1)(typescript@5.4.5): dependencies: magic-string: 0.30.10 - rollup: 4.18.0 + rollup: 4.18.1 typescript: 5.4.5 optionalDependencies: '@babel/code-frame': 7.24.7 - rollup-plugin-esbuild@6.1.1(esbuild@0.23.0)(rollup@4.18.0): + rollup-plugin-esbuild@6.1.1(esbuild@0.23.0)(rollup@4.18.1): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@rollup/pluginutils': 5.1.0(rollup@4.18.1) debug: 4.3.5 es-module-lexer: 1.5.4 esbuild: 0.23.0 get-tsconfig: 4.7.5 - rollup: 4.18.0 + rollup: 4.18.1 transitivePeerDependencies: - supports-color - rollup-plugin-polyfill-node@0.13.0(rollup@4.18.0): + rollup-plugin-polyfill-node@0.13.0(rollup@4.18.1): dependencies: - '@rollup/plugin-inject': 5.0.5(rollup@4.18.0) - rollup: 4.18.0 + '@rollup/plugin-inject': 5.0.5(rollup@4.18.1) + rollup: 4.18.1 rollup@4.18.0: dependencies: @@ -6109,6 +6242,28 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.18.0 fsevents: 2.3.3 + rollup@4.18.1: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.18.1 + '@rollup/rollup-android-arm64': 4.18.1 + '@rollup/rollup-darwin-arm64': 4.18.1 + '@rollup/rollup-darwin-x64': 4.18.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.1 + '@rollup/rollup-linux-arm-musleabihf': 4.18.1 + '@rollup/rollup-linux-arm64-gnu': 4.18.1 + '@rollup/rollup-linux-arm64-musl': 4.18.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.1 + '@rollup/rollup-linux-riscv64-gnu': 4.18.1 + '@rollup/rollup-linux-s390x-gnu': 4.18.1 + '@rollup/rollup-linux-x64-gnu': 4.18.1 + '@rollup/rollup-linux-x64-musl': 4.18.1 + '@rollup/rollup-win32-arm64-msvc': 4.18.1 + '@rollup/rollup-win32-ia32-msvc': 4.18.1 + '@rollup/rollup-win32-x64-msvc': 4.18.1 + fsevents: 2.3.3 + rrweb-cssom@0.6.0: {} rrweb-cssom@0.7.1: {} From fc205bf4decde5ce0f4a61394ffa3914b502c287 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 16 Jul 2024 01:31:27 +1100 Subject: [PATCH 23/61] perf(server-render): avoid unnecessary checks in `createBuffer` (#11364) --- .../__tests__/createBuffer.bench.ts | 65 +++++++++++++++++++ packages/server-renderer/src/render.ts | 4 +- 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 packages/server-renderer/__tests__/createBuffer.bench.ts diff --git a/packages/server-renderer/__tests__/createBuffer.bench.ts b/packages/server-renderer/__tests__/createBuffer.bench.ts new file mode 100644 index 00000000000..fff20f927fb --- /dev/null +++ b/packages/server-renderer/__tests__/createBuffer.bench.ts @@ -0,0 +1,65 @@ +import { bench, describe } from 'vitest' + +import { createBuffer } from '../src/render' + +describe('createBuffer', () => { + let stringBuffer = createBuffer() + + bench( + 'string only', + () => { + for (let i = 0; i < 10; i += 1) { + stringBuffer.push('hello') + } + }, + { + setup() { + stringBuffer = createBuffer() + }, + }, + ) + + let stringNestedBuffer = createBuffer() + + bench( + 'string with nested', + () => { + for (let i = 0; i < 10; i += 1) { + if (i % 3 === 0) { + stringNestedBuffer.push('hello') + } else { + const buffer = createBuffer() + buffer.push('hello') + stringNestedBuffer.push(buffer.getBuffer()) + } + } + }, + { + setup() { + stringNestedBuffer = createBuffer() + }, + }, + ) + + bench( + 'string with nested async', + () => { + for (let i = 0; i < 10; i += 1) { + if (i % 3 === 0) { + const buffer = createBuffer() + buffer.push('hello') + stringNestedBuffer.push(Promise.resolve(buffer.getBuffer())) + } else { + const buffer = createBuffer() + buffer.push('hello') + stringNestedBuffer.push(buffer.getBuffer()) + } + } + }, + { + setup() { + stringNestedBuffer = createBuffer() + }, + }, + ) +}) diff --git a/packages/server-renderer/src/render.ts b/packages/server-renderer/src/render.ts index 7e274c3b981..ab84dd212f0 100644 --- a/packages/server-renderer/src/render.ts +++ b/packages/server-renderer/src/render.ts @@ -73,9 +73,9 @@ export function createBuffer() { const isStringItem = isString(item) if (appendable && isStringItem) { buffer[buffer.length - 1] += item as string - } else { - buffer.push(item) + return } + buffer.push(item) appendable = isStringItem if (isPromise(item) || (isArray(item) && item.hasAsync)) { // promise, or child buffer with async, mark as async. From ae52a371e5ec3a2327c5cc24792245bf90535f7c Mon Sep 17 00:00:00 2001 From: fang-ng4 <907648506@qq.com> Date: Mon, 15 Jul 2024 22:36:48 +0800 Subject: [PATCH 24/61] test: edge case for decodeHtmlBrowser (#11339) Co-authored-by: unknown --- packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts b/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts index ecdc070ad96..70b6997277c 100644 --- a/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts +++ b/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts @@ -40,5 +40,11 @@ describe('decodeHtmlBrowser', () => { true, ), ).toBe('&') + expect(decodeHtmlBrowser('"', true)).toBe( + '"', + ) + expect(decodeHtmlBrowser("'", true)).toBe( + "'", + ) }) }) From f44c3b37d446d5f8e34539029dae0d806b25bb47 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 16 Jul 2024 11:06:45 +0800 Subject: [PATCH 25/61] fix(hydration): handle consectuvie text nodes during hydration close #7285 close #7301 --- .../runtime-core/__tests__/hydration.spec.ts | 20 +++++++++++++++++ packages/runtime-core/src/hydration.ts | 22 ++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index 60941d0369c..6ae9caf8e79 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -148,6 +148,15 @@ describe('SSR hydration', () => { expect(container.innerHTML).toBe(`
bar
`) }) + // #7285 + test('element with multiple continuous text vnodes', async () => { + // should no mismatch warning + const { container } = mountWithHydration('
fooo
', () => + h('div', ['fo', createTextVNode('o'), 'o']), + ) + expect(container.textContent).toBe('fooo') + }) + test('element with elements children', async () => { const msg = ref('foo') const fn = vi.fn() @@ -239,6 +248,17 @@ describe('SSR hydration', () => { ) }) + // #7285 + test('Fragment (multiple continuous text vnodes)', async () => { + // should no mismatch warning + const { container } = mountWithHydration('fooo', () => [ + 'fo', + createTextVNode('o'), + 'o', + ]) + expect(container.textContent).toBe('fooo') + }) + test('Teleport', async () => { const msg = ref('foo') const fn = vi.fn() diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 8eca0705dfd..20ff37cdf1c 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -531,7 +531,27 @@ export function createHydrationFunctions( const vnode = optimized ? children[i] : (children[i] = normalizeVNode(children[i])) + const isText = vnode.type === Text if (node) { + if (isText && !optimized) { + // #7285 possible consecutive text vnodes from manual render fns or + // JSX-compiled fns, but on the client the browser parses only 1 text + // node. + // look ahead for next possible text vnode + let next = children[i + 1] + if (next && (next = normalizeVNode(next)).type === Text) { + // create an extra TextNode on the client for the next vnode to + // adopt + insert( + createText( + (node as Text).data.slice((vnode.children as string).length), + ), + container, + nextSibling(node), + ) + ;(node as Text).data = vnode.children as string + } + } node = hydrateNode( node, vnode, @@ -540,7 +560,7 @@ export function createHydrationFunctions( slotScopeIds, optimized, ) - } else if (vnode.type === Text && !vnode.children) { + } else if (isText && !vnode.children) { // #7215 create a TextNode for empty text node // because server rendered HTML won't contain a text node insert((vnode.el = createText('')), container) From c0b9bd125ce5b1889f175a6f6a9152234ba8e1cf Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 16 Jul 2024 11:09:34 +0800 Subject: [PATCH 26/61] chore: format --- .../compiler-dom/__tests__/decoderHtmlBrowser.spec.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts b/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts index 70b6997277c..507d4243b88 100644 --- a/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts +++ b/packages/compiler-dom/__tests__/decoderHtmlBrowser.spec.ts @@ -40,11 +40,7 @@ describe('decodeHtmlBrowser', () => { true, ), ).toBe('&') - expect(decodeHtmlBrowser('"', true)).toBe( - '"', - ) - expect(decodeHtmlBrowser("'", true)).toBe( - "'", - ) + expect(decodeHtmlBrowser('"', true)).toBe('"') + expect(decodeHtmlBrowser("'", true)).toBe("'") }) }) From 2d854414facc1e872d00bfab4291ac39aa8abb28 Mon Sep 17 00:00:00 2001 From: Linghao Su Date: Tue, 16 Jul 2024 11:40:53 +0800 Subject: [PATCH 27/61] test(runtime-core): test effectscope instance null (#8397) --- .../runtime-core/__tests__/apiWatch.spec.ts | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index febfd462d06..82630c46377 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -5,6 +5,7 @@ import { defineComponent, getCurrentInstance, nextTick, + onErrorCaptured, reactive, ref, watch, @@ -1576,4 +1577,60 @@ describe('api: watch', () => { expect(spy).toHaveBeenCalledTimes(1) expect(foo.value.a).toBe(2) }) + + test('watch immediate error in effect scope should be catched by onErrorCaptured', async () => { + const warn = vi.spyOn(console, 'warn') + warn.mockImplementation(() => {}) + const ERROR_IN_SCOPE = 'ERROR_IN_SCOPE' + const ERROR_OUT_SCOPE = 'ERROR_OUT_SCOPE' + + const errors = ref([]) + const Comp = { + setup() { + const trigger = ref(0) + + effectScope(true).run(() => { + watch( + trigger, + () => { + throw new Error(ERROR_IN_SCOPE) + }, + { immediate: true }, + ) + }) + + watchEffect(() => { + throw new Error(ERROR_OUT_SCOPE) + }) + + return () => '' + }, + } + + const root = nodeOps.createElement('div') + render( + h( + { + setup(_, { slots }) { + onErrorCaptured(e => { + errors.value.push(e.message) + return false + }) + + return () => h('div', slots.default && slots.default()) + }, + }, + null, + () => [h(Comp)], + ), + root, + ) + await nextTick() + // only watchEffect as ran so far + expect(errors.value).toHaveLength(2) + expect(errors.value[0]).toBe(ERROR_IN_SCOPE) + expect(errors.value[1]).toBe(ERROR_OUT_SCOPE) + + warn.mockRestore() + }) }) From 50ddafe91b9195cf94124466239f82c9794699fb Mon Sep 17 00:00:00 2001 From: LiuSeen <91084928+liuseen-l@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:07:06 +0800 Subject: [PATCH 28/61] fix(reactivity): shallowReactive map "unwraps" the nested refs (#8503) fix #8501 fix #11249 --- .../reactivity/__tests__/reactive.spec.ts | 23 +++++++++++++++ .../__tests__/shallowReactive.spec.ts | 23 +++++++++++++++ packages/reactivity/src/collectionHandlers.ts | 28 ++++++++++++++----- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/packages/reactivity/__tests__/reactive.spec.ts b/packages/reactivity/__tests__/reactive.spec.ts index bd4ec402bb2..1c25c49121b 100644 --- a/packages/reactivity/__tests__/reactive.spec.ts +++ b/packages/reactivity/__tests__/reactive.spec.ts @@ -2,6 +2,8 @@ import { isRef, ref } from '../src/ref' import { isProxy, isReactive, + isReadonly, + isShallow, markRaw, reactive, readonly, @@ -359,4 +361,25 @@ describe('reactivity/reactive', () => { const c = computed(() => {}) expect(isProxy(c)).toBe(false) }) + + test('The results of the shallow and readonly assignments are the same (Map)', () => { + const map = reactive(new Map()) + map.set('foo', shallowReactive({ a: 2 })) + expect(isShallow(map.get('foo'))).toBe(true) + + map.set('bar', readonly({ b: 2 })) + expect(isReadonly(map.get('bar'))).toBe(true) + }) + + test('The results of the shallow and readonly assignments are the same (Set)', () => { + const set = reactive(new Set()) + set.add(shallowReactive({ a: 2 })) + set.add(readonly({ b: 2 })) + let count = 0 + for (const i of set) { + if (count === 0) expect(isShallow(i)).toBe(true) + else expect(isReadonly(i)).toBe(true) + count++ + } + }) }) diff --git a/packages/reactivity/__tests__/shallowReactive.spec.ts b/packages/reactivity/__tests__/shallowReactive.spec.ts index e9b64d39b36..cb5ef8e6d97 100644 --- a/packages/reactivity/__tests__/shallowReactive.spec.ts +++ b/packages/reactivity/__tests__/shallowReactive.spec.ts @@ -123,6 +123,29 @@ describe('shallowReactive', () => { shallowSet.forEach(x => expect(isReactive(x)).toBe(false)) }) + test('Setting a reactive object on a shallowReactive map', () => { + const msg = ref('ads') + const bar = reactive({ msg }) + const foo = shallowReactive(new Map([['foo1', bar]])) + foo.set('foo2', bar) + + expect(isReactive(foo.get('foo2'))).toBe(true) + expect(isReactive(foo.get('foo1'))).toBe(true) + }) + + test('Setting a reactive object on a shallowReactive set', () => { + const msg = ref(1) + const bar = reactive({ msg }) + const foo = reactive({ msg }) + + const deps = shallowReactive(new Set([bar])) + deps.add(foo) + + deps.forEach(dep => { + expect(isReactive(dep)).toBe(true) + }) + }) + // #1210 test('onTrack on called on objectSpread', () => { const onTrackFn = vi.fn() diff --git a/packages/reactivity/src/collectionHandlers.ts b/packages/reactivity/src/collectionHandlers.ts index 7c4b36fbe94..c39e3ed48cd 100644 --- a/packages/reactivity/src/collectionHandlers.ts +++ b/packages/reactivity/src/collectionHandlers.ts @@ -1,4 +1,10 @@ -import { toRaw, toReactive, toReadonly } from './reactive' +import { + isReadonly, + isShallow, + toRaw, + toReactive, + toReadonly, +} from './reactive' import { ITERATE_KEY, MAP_KEY_ITERATE_KEY, @@ -72,8 +78,10 @@ function size(target: IterableCollections, isReadonly = false) { return Reflect.get(target, 'size', target) } -function add(this: SetTypes, value: unknown) { - value = toRaw(value) +function add(this: SetTypes, value: unknown, _isShallow = false) { + if (!_isShallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value) + } const target = toRaw(this) const proto = getProto(target) const hadKey = proto.has.call(target, value) @@ -84,8 +92,10 @@ function add(this: SetTypes, value: unknown) { return this } -function set(this: MapTypes, key: unknown, value: unknown) { - value = toRaw(value) +function set(this: MapTypes, key: unknown, value: unknown, _isShallow = false) { + if (!_isShallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value) + } const target = toRaw(this) const { has, get } = getProto(target) @@ -263,8 +273,12 @@ function createInstrumentations() { return size(this as unknown as IterableCollections) }, has, - add, - set, + add(this: SetTypes, value: unknown) { + return add.call(this, value, true) + }, + set(this: MapTypes, key: unknown, value: unknown) { + return set.call(this, key, value, true) + }, delete: deleteEntry, clear, forEach: createForEach(false, true), From 8655ced480ea0fe453ff5fe445cecf97b91ec260 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 16 Jul 2024 17:17:25 +0800 Subject: [PATCH 29/61] fix(teleport): skip teleported nodes when locating patch anchor close #9071 close #9134 close #9313 Tests reused from #9313 --- .../__tests__/components/Teleport.spec.ts | 69 ++++++++++++++++++- .../runtime-core/src/components/Teleport.ts | 23 ++++++- packages/runtime-core/src/renderer.ts | 15 +++- packages/runtime-core/src/vnode.ts | 3 + 4 files changed, 103 insertions(+), 7 deletions(-) diff --git a/packages/runtime-core/__tests__/components/Teleport.spec.ts b/packages/runtime-core/__tests__/components/Teleport.spec.ts index 9c85cd8beb6..aca9432b6e1 100644 --- a/packages/runtime-core/__tests__/components/Teleport.spec.ts +++ b/packages/runtime-core/__tests__/components/Teleport.spec.ts @@ -16,7 +16,7 @@ import { serializeInner, withDirectives, } from '@vue/runtime-test' -import { Fragment, createVNode } from '../../src/vnode' +import { Fragment, createCommentVNode, createVNode } from '../../src/vnode' import { compile, render as domRender } from 'vue' describe('renderer: teleport', () => { @@ -553,4 +553,71 @@ describe('renderer: teleport', () => { `"
teleported
"`, ) }) + + //#9071 + test('toggle sibling node inside target node', async () => { + const root = document.createElement('div') + const show = ref(false) + const App = defineComponent({ + setup() { + return () => { + return show.value + ? h(Teleport, { to: root }, [h('div', 'teleported')]) + : h('div', 'foo') + } + }, + }) + + domRender(h(App), root) + expect(root.innerHTML).toMatchInlineSnapshot('"
foo
"') + + show.value = true + await nextTick() + + expect(root.innerHTML).toMatchInlineSnapshot( + '"
teleported
"', + ) + + show.value = false + await nextTick() + + expect(root.innerHTML).toMatchInlineSnapshot('"
foo
"') + }) + + test('unmount previous sibling node inside target node', async () => { + const root = document.createElement('div') + const parentShow = ref(false) + const childShow = ref(true) + + const Comp = { + setup() { + return () => h(Teleport, { to: root }, [h('div', 'foo')]) + }, + } + + const App = defineComponent({ + setup() { + return () => { + return parentShow.value + ? h(Fragment, { key: 0 }, [ + childShow.value ? h(Comp) : createCommentVNode('v-if'), + ]) + : createCommentVNode('v-if') + } + }, + }) + + domRender(h(App), root) + expect(root.innerHTML).toMatchInlineSnapshot('""') + + parentShow.value = true + await nextTick() + expect(root.innerHTML).toMatchInlineSnapshot( + '"
foo
"', + ) + + parentShow.value = false + await nextTick() + expect(root.innerHTML).toMatchInlineSnapshot('""') + }) }) diff --git a/packages/runtime-core/src/components/Teleport.ts b/packages/runtime-core/src/components/Teleport.ts index a10ae84d428..65437300cff 100644 --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@ -21,6 +21,8 @@ export interface TeleportProps { disabled?: boolean } +export const TeleportEndKey = Symbol('_vte') + export const isTeleport = (type: any): boolean => type.__isTeleport const isTeleportDisabled = (props: VNode['props']): boolean => @@ -105,11 +107,16 @@ export const TeleportImpl = { const mainAnchor = (n2.anchor = __DEV__ ? createComment('teleport end') : createText('')) - insert(placeholder, container, anchor) - insert(mainAnchor, container, anchor) const target = (n2.target = resolveTarget(n2.props, querySelector)) + const targetStart = (n2.targetStart = createText('')) const targetAnchor = (n2.targetAnchor = createText('')) + insert(placeholder, container, anchor) + insert(mainAnchor, container, anchor) + // attach a special property so we can skip teleported content in + // renderer's nextSibling search + targetStart[TeleportEndKey] = targetAnchor if (target) { + insert(targetStart, target) insert(targetAnchor, target) // #2652 we could be teleporting from a non-SVG tree into an SVG tree if (namespace === 'svg' || isTargetSVG(target)) { @@ -146,6 +153,7 @@ export const TeleportImpl = { } else { // update content n2.el = n1.el + n2.targetStart = n1.targetStart const mainAnchor = (n2.anchor = n1.anchor)! const target = (n2.target = n1.target)! const targetAnchor = (n2.targetAnchor = n1.targetAnchor)! @@ -253,9 +261,18 @@ export const TeleportImpl = { { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean, ) { - const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props, + } = vnode if (target) { + hostRemove(targetStart!) hostRemove(targetAnchor!) } diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 8a64baad1c0..088d1565cbb 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -58,7 +58,11 @@ import { type SuspenseImpl, queueEffectWithSuspense, } from './components/Suspense' -import type { TeleportImpl, TeleportVNode } from './components/Teleport' +import { + TeleportEndKey, + type TeleportImpl, + type TeleportVNode, +} from './components/Teleport' import { type KeepAliveContext, isKeepAlive } from './components/KeepAlive' import { isHmrUpdating, registerHMR, unregisterHMR } from './hmr' import { type RootHydrateFunction, createHydrationFunctions } from './hydration' @@ -140,7 +144,7 @@ export interface RendererOptions< // functions provided via options, so the internal constraint is really just // a generic object. export interface RendererNode { - [key: string]: any + [key: string | symbol]: any } export interface RendererElement extends RendererNode {} @@ -2368,7 +2372,12 @@ function baseCreateRenderer( if (__FEATURE_SUSPENSE__ && vnode.shapeFlag & ShapeFlags.SUSPENSE) { return vnode.suspense!.next() } - return hostNextSibling((vnode.anchor || vnode.el)!) + const el = hostNextSibling((vnode.anchor || vnode.el)!) + // #9071, #9313 + // teleported content can mess up nextSibling searches during patch so + // we need to skip them during nextSibling search + const teleportEnd = el && el[TeleportEndKey] + return teleportEnd ? hostNextSibling(teleportEnd) : el } let isFlushing = false diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index a0d4074aaea..75024b73c77 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -198,6 +198,7 @@ export interface VNode< el: HostNode | null anchor: HostNode | null // fragment anchor target: HostElement | null // teleport target + targetStart: HostNode | null // teleport target start anchor targetAnchor: HostNode | null // teleport target anchor /** * number of elements contained in a static vnode @@ -477,6 +478,7 @@ function createBaseVNode( el: null, anchor: null, target: null, + targetStart: null, targetAnchor: null, staticCount: 0, shapeFlag, @@ -677,6 +679,7 @@ export function cloneVNode( ? (children as VNode[]).map(deepCloneVNode) : children, target: vnode.target, + targetStart: vnode.targetStart, targetAnchor: vnode.targetAnchor, staticCount: vnode.staticCount, shapeFlag: vnode.shapeFlag, From 3ee7b4c7b1374c5bdc50a579b49f6bc15022b085 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 16 Jul 2024 18:05:44 +0800 Subject: [PATCH 30/61] fix(runtime-core): avoid recursive warning close #8074 --- packages/runtime-core/src/warning.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/runtime-core/src/warning.ts b/packages/runtime-core/src/warning.ts index d130638b6af..169cdd907ae 100644 --- a/packages/runtime-core/src/warning.ts +++ b/packages/runtime-core/src/warning.ts @@ -30,7 +30,12 @@ export function popWarningContext() { stack.pop() } +let isWarning = false + export function warn(msg: string, ...args: any[]) { + if (isWarning) return + isWarning = true + // avoid props formatting or warn handler tracking deps that might be mutated // during patch, leading to infinite recursion. pauseTracking() @@ -70,6 +75,7 @@ export function warn(msg: string, ...args: any[]) { } resetTracking() + isWarning = false } export function getComponentTrace(): ComponentTraceStack { From a509e30f059fcdd158f39fdf34670b1019eaf2d1 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 17 Jul 2024 10:09:57 +0800 Subject: [PATCH 31/61] fix(reactivity): ensure `unref` correctly resolves type for `ShallowRef` (#11360) close #11356 --- packages/dts-test/ref.test-d.ts | 4 ++++ packages/reactivity/src/ref.ts | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/dts-test/ref.test-d.ts b/packages/dts-test/ref.test-d.ts index 5d4c9d95dab..1456c523239 100644 --- a/packages/dts-test/ref.test-d.ts +++ b/packages/dts-test/ref.test-d.ts @@ -452,3 +452,7 @@ describe('toRef <-> toValue', () => { ), ) }) + +// unref +declare const text: ShallowRef | ComputedRef | MaybeRef +expectType(unref(text)) diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index e47b8aa5582..3e9b05062f3 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -235,7 +235,7 @@ export type MaybeRefOrGetter = MaybeRef | (() => T) * @param ref - Ref or plain value to be converted into the plain value. * @see {@link https://vuejs.org/api/reactivity-utilities.html#unref} */ -export function unref(ref: MaybeRef | ComputedRef): T { +export function unref(ref: MaybeRef | ComputedRef | ShallowRef): T { return isRef(ref) ? ref.value : ref } @@ -255,7 +255,9 @@ export function unref(ref: MaybeRef | ComputedRef): T { * @param source - A getter, an existing ref, or a non-function value. * @see {@link https://vuejs.org/api/reactivity-utilities.html#tovalue} */ -export function toValue(source: MaybeRefOrGetter | ComputedRef): T { +export function toValue( + source: MaybeRefOrGetter | ComputedRef | ShallowRef, +): T { return isFunction(source) ? source() : unref(source) } From c10e40a217b89ab7e0f7f3515242d4246ecffbdd Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 17 Jul 2024 12:14:25 +0800 Subject: [PATCH 32/61] fix(hydration): fix tracking of reactive style objects in production close #11372 --- .../runtime-core/__tests__/hydration.spec.ts | 35 ++++++++++++++++++- packages/runtime-core/src/hydration.ts | 6 ++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index 6ae9caf8e79..ea1d626f7c4 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -22,6 +22,7 @@ import { nextTick, onMounted, openBlock, + reactive, ref, renderSlot, useCssVars, @@ -31,7 +32,7 @@ import { withDirectives, } from '@vue/runtime-dom' import { type SSRContext, renderToString } from '@vue/server-renderer' -import { PatchFlags } from '@vue/shared' +import { PatchFlags, normalizeStyle } from '@vue/shared' import { vShowOriginalDisplay } from '../../runtime-dom/src/directives/vShow' import { expect } from 'vitest' @@ -1196,6 +1197,38 @@ describe('SSR hydration', () => { expect(text.nodeType).toBe(3) }) + // #11372 + test('object style value tracking in prod', async () => { + __DEV__ = false + try { + const style = reactive({ color: 'red' }) + const Comp = { + render(this: any) { + return ( + openBlock(), + createElementBlock( + 'div', + { + style: normalizeStyle(style), + }, + null, + 4 /* STYLE */, + ) + ) + }, + } + const { container } = mountWithHydration( + `
`, + () => h(Comp), + ) + style.color = 'green' + await nextTick() + expect(container.innerHTML).toBe(`
`) + } finally { + __DEV__ = true + } + }) + test('app.unmount()', async () => { const container = document.createElement('DIV') container.innerHTML = '' diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index 20ff37cdf1c..fe267f4fef6 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -39,6 +39,7 @@ import { } from './components/Suspense' import type { TeleportImpl, TeleportVNode } from './components/Teleport' import { isAsyncWrapper } from './apiAsyncComponent' +import { isReactive } from '@vue/reactivity' export type RootHydrateFunction = ( vnode: VNode, @@ -487,6 +488,11 @@ export function createHydrationFunctions( undefined, parentComponent, ) + } else if (patchFlag & PatchFlags.STYLE && isReactive(props.style)) { + // #11372: object style values are iterated during patch instead of + // render/normalization phase, but style patch is skipped during + // hydration, so we need to force iterate the object to track deps + for (const key in props.style) props.style[key] } } From 3dc5a1ad98d9ca7e9af04eb32e605c3870ff2576 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 17 Jul 2024 14:29:54 +0800 Subject: [PATCH 33/61] test: test case for #11286 --- .../__tests__/errorHandling.spec.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/runtime-core/__tests__/errorHandling.spec.ts b/packages/runtime-core/__tests__/errorHandling.spec.ts index cf148bd2fe6..4cf4ffe3126 100644 --- a/packages/runtime-core/__tests__/errorHandling.spec.ts +++ b/packages/runtime-core/__tests__/errorHandling.spec.ts @@ -1,5 +1,6 @@ import { type VNode, + computed, createApp, defineComponent, h, @@ -639,5 +640,35 @@ describe('error handling', () => { ) }) + // #11286 + test('handle error in computed', async () => { + const err = new Error() + const handler = vi.fn() + + const count = ref(1) + const x = computed(() => { + if (count.value === 2) throw err + return count.value + 1 + }) + + const app = createApp({ + setup() { + return () => x.value + }, + }) + + app.config.errorHandler = handler + app.mount(nodeOps.createElement('div')) + + count.value = 2 + + await nextTick() + expect(handler).toHaveBeenCalledWith( + err, + {}, + ErrorTypeStrings[ErrorCodes.COMPONENT_UPDATE], + ) + }) + // native event handler handling should be tested in respective renderers }) From b287aeec3ea85f20e4b1fc3d907c901bdc2a0176 Mon Sep 17 00:00:00 2001 From: Zhaolin Liang Date: Wed, 17 Jul 2024 15:06:14 +0800 Subject: [PATCH 34/61] fix(compiler-sfc): correctly resolve type annotation for declared function (#11279) close #11266 --- .../compileScript/resolveType.spec.ts | 20 +++++++++++++++++++ .../compiler-sfc/src/script/resolveType.ts | 1 + 2 files changed, 21 insertions(+) diff --git a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts index 0b5549cc407..b8b71878e03 100644 --- a/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts @@ -635,6 +635,26 @@ describe('resolveType', () => { }) }) + // #11266 + test('correctly parse type annotation for declared function', () => { + const { props } = resolve(` + import { ExtractPropTypes } from 'vue' + interface UploadFile { + xhr?: T + } + declare function uploadProps(): { + fileList: { + type: PropType[]> + default: UploadFile[] + } + } + type UploadProps = ExtractPropTypes> + defineProps()`) + expect(props).toStrictEqual({ + fileList: ['Array'], + }) + }) + describe('generics', () => { test('generic with type literal', () => { expect( diff --git a/packages/compiler-sfc/src/script/resolveType.ts b/packages/compiler-sfc/src/script/resolveType.ts index 5a4c84b4ab7..398d3ba9f42 100644 --- a/packages/compiler-sfc/src/script/resolveType.ts +++ b/packages/compiler-sfc/src/script/resolveType.ts @@ -177,6 +177,7 @@ function innerResolveTypeElements( case 'TSInterfaceDeclaration': return resolveInterfaceMembers(ctx, node, scope, typeParameters) case 'TSTypeAliasDeclaration': + case 'TSTypeAnnotation': case 'TSParenthesizedType': return resolveTypeElements( ctx, From 3e9e32ee0a6d0fbf67e9098a66ff0a1ea6647806 Mon Sep 17 00:00:00 2001 From: linzhe <40790268+linzhe141@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:37:14 +0800 Subject: [PATCH 35/61] fix(runtime-dom): properly handle innerHTML unmount into new children (#11159) close #9135 --- packages/runtime-core/src/hydration.ts | 11 +-- packages/runtime-core/src/renderer.ts | 73 ++++--------------- .../runtime-dom/__tests__/patchProps.spec.ts | 21 +++++- packages/runtime-dom/src/modules/props.ts | 14 +--- packages/runtime-dom/src/patchProp.ts | 13 +--- 5 files changed, 40 insertions(+), 92 deletions(-) diff --git a/packages/runtime-core/src/hydration.ts b/packages/runtime-core/src/hydration.ts index fe267f4fef6..c371542607d 100644 --- a/packages/runtime-core/src/hydration.ts +++ b/packages/runtime-core/src/hydration.ts @@ -465,15 +465,7 @@ export function createHydrationFunctions( // force hydrate v-bind with .prop modifiers key[0] === '.' ) { - patchProp( - el, - key, - null, - props[key], - undefined, - undefined, - parentComponent, - ) + patchProp(el, key, null, props[key], undefined, parentComponent) } } } else if (props.onClick) { @@ -485,7 +477,6 @@ export function createHydrationFunctions( null, props.onClick, undefined, - undefined, parentComponent, ) } else if (patchFlag & PatchFlags.STYLE && isReactive(props.style)) { diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 088d1565cbb..db674f987d8 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -107,10 +107,7 @@ export interface RendererOptions< prevValue: any, nextValue: any, namespace?: ElementNamespace, - prevChildren?: VNode[], parentComponent?: ComponentInternalInstance | null, - parentSuspense?: SuspenseBoundary | null, - unmountChildren?: UnmountChildrenFn, ): void insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void remove(el: HostNode): void @@ -670,17 +667,7 @@ function baseCreateRenderer( if (props) { for (const key in props) { if (key !== 'value' && !isReservedProp(key)) { - hostPatchProp( - el, - key, - null, - props[key], - namespace, - vnode.children as VNode[], - parentComponent, - parentSuspense, - unmountChildren, - ) + hostPatchProp(el, key, null, props[key], namespace, parentComponent) } } /** @@ -833,6 +820,15 @@ function baseCreateRenderer( dynamicChildren = null } + // #9135 innerHTML / textContent unset needs to happen before possible + // new children mount + if ( + (oldProps.innerHTML && newProps.innerHTML == null) || + (oldProps.textContent && newProps.textContent == null) + ) { + hostSetElementText(el, '') + } + if (dynamicChildren) { patchBlockChildren( n1.dynamicChildren!, @@ -869,15 +865,7 @@ function baseCreateRenderer( // (i.e. at the exact same position in the source template) if (patchFlag & PatchFlags.FULL_PROPS) { // element props contain dynamic keys, full diff needed - patchProps( - el, - n2, - oldProps, - newProps, - parentComponent, - parentSuspense, - namespace, - ) + patchProps(el, oldProps, newProps, parentComponent, namespace) } else { // class // this flag is matched when the element has dynamic class bindings. @@ -908,17 +896,7 @@ function baseCreateRenderer( const next = newProps[key] // #1471 force patch value if (next !== prev || key === 'value') { - hostPatchProp( - el, - key, - prev, - next, - namespace, - n1.children as VNode[], - parentComponent, - parentSuspense, - unmountChildren, - ) + hostPatchProp(el, key, prev, next, namespace, parentComponent) } } } @@ -933,15 +911,7 @@ function baseCreateRenderer( } } else if (!optimized && dynamicChildren == null) { // unoptimized, full diff - patchProps( - el, - n2, - oldProps, - newProps, - parentComponent, - parentSuspense, - namespace, - ) + patchProps(el, oldProps, newProps, parentComponent, namespace) } if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { @@ -998,11 +968,9 @@ function baseCreateRenderer( const patchProps = ( el: RendererElement, - vnode: VNode, oldProps: Data, newProps: Data, parentComponent: ComponentInternalInstance | null, - parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, ) => { if (oldProps !== newProps) { @@ -1015,10 +983,7 @@ function baseCreateRenderer( oldProps[key], null, namespace, - vnode.children as VNode[], parentComponent, - parentSuspense, - unmountChildren, ) } } @@ -1030,17 +995,7 @@ function baseCreateRenderer( const prev = oldProps[key] // defer patching value if (next !== prev && key !== 'value') { - hostPatchProp( - el, - key, - prev, - next, - namespace, - vnode.children as VNode[], - parentComponent, - parentSuspense, - unmountChildren, - ) + hostPatchProp(el, key, prev, next, namespace, parentComponent) } } if ('value' in newProps) { diff --git a/packages/runtime-dom/__tests__/patchProps.spec.ts b/packages/runtime-dom/__tests__/patchProps.spec.ts index 61dd98513ce..7f418847f5f 100644 --- a/packages/runtime-dom/__tests__/patchProps.spec.ts +++ b/packages/runtime-dom/__tests__/patchProps.spec.ts @@ -1,5 +1,5 @@ import { patchProp } from '../src/patchProp' -import { h, render } from '../src' +import { h, nextTick, ref, render } from '../src' describe('runtime-dom: props patching', () => { test('basic', () => { @@ -133,6 +133,25 @@ describe('runtime-dom: props patching', () => { expect(fn).toHaveBeenCalled() }) + test('patch innerHTML porp', async () => { + const root = document.createElement('div') + const state = ref(false) + const Comp = { + render: () => { + if (state.value) { + return h('div', [h('del', null, 'baz')]) + } else { + return h('div', { innerHTML: 'baz' }) + } + }, + } + render(h(Comp), root) + expect(root.innerHTML).toBe(`
baz
`) + state.value = true + await nextTick() + expect(root.innerHTML).toBe(`
baz
`) + }) + test('textContent unmount prev children', () => { const fn = vi.fn() const comp = { diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index 2eb83ea39f7..04f0d0e866d 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -10,19 +10,13 @@ export function patchDOMProp( el: any, key: string, value: any, - // the following args are passed only due to potential innerHTML/textContent - // overriding existing VNodes, in which case the old tree must be properly - // unmounted. - prevChildren: any, parentComponent: any, - parentSuspense: any, - unmountChildren: any, ) { if (key === 'innerHTML' || key === 'textContent') { - if (prevChildren) { - unmountChildren(prevChildren, parentComponent, parentSuspense) - } - el[key] = value == null ? '' : value + // null value case is handled in renderer patchElement before patching + // children + if (value === null) return + el[key] = value return } diff --git a/packages/runtime-dom/src/patchProp.ts b/packages/runtime-dom/src/patchProp.ts index e7b733c74af..f3ef14ee83c 100644 --- a/packages/runtime-dom/src/patchProp.ts +++ b/packages/runtime-dom/src/patchProp.ts @@ -21,10 +21,7 @@ export const patchProp: DOMRendererOptions['patchProp'] = ( prevValue, nextValue, namespace, - prevChildren, parentComponent, - parentSuspense, - unmountChildren, ) => { const isSVG = namespace === 'svg' if (key === 'class') { @@ -43,15 +40,7 @@ export const patchProp: DOMRendererOptions['patchProp'] = ( ? ((key = key.slice(1)), false) : shouldSetAsProp(el, key, nextValue, isSVG) ) { - patchDOMProp( - el, - key, - nextValue, - prevChildren, - parentComponent, - parentSuspense, - unmountChildren, - ) + patchDOMProp(el, key, nextValue, parentComponent) // #6007 also set form state as attributes so they work with // or libs / extensions that expect attributes // #11163 custom elements may use value as an prop and set it as object From f1bb0aef084b5cdd4d49aecfed01ec106d9b6897 Mon Sep 17 00:00:00 2001 From: yangxiuxiu <79584569+yangxiuxiu1115@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:46:10 +0800 Subject: [PATCH 36/61] fix(runtime-core): do not emit when defineModel ref is set with same value (#11162) close #11125 --- .../__tests__/helpers/useModel.spec.ts | 40 +++++++++++++++++++ packages/runtime-core/src/helpers/useModel.ts | 6 ++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/useModel.spec.ts b/packages/runtime-core/__tests__/helpers/useModel.spec.ts index f5b2a0108b0..097e52f9167 100644 --- a/packages/runtime-core/__tests__/helpers/useModel.spec.ts +++ b/packages/runtime-core/__tests__/helpers/useModel.spec.ts @@ -612,4 +612,44 @@ describe('useModel', () => { // should not force local update if set to the same value expect(compRender).toHaveBeenCalledTimes(3) }) + + test('set no change value', async () => { + let changeChildMsg: (() => void) | null = null + + const compRender = vi.fn() + const Comp = defineComponent({ + props: ['msg'], + emits: ['update:msg'], + setup(props) { + const childMsg = useModel(props, 'msg') + changeChildMsg = () => { + childMsg.value = childMsg.value + } + return () => { + return childMsg.value + } + }, + }) + + const msg = ref('HI') + const Parent = defineComponent({ + setup() { + return () => + h(Comp, { + msg: msg.value, + 'onUpdate:msg': val => { + msg.value = val + compRender() + }, + }) + }, + }) + + const root = nodeOps.createElement('div') + render(h(Parent), root) + + expect(compRender).toBeCalledTimes(0) + changeChildMsg!() + expect(compRender).toBeCalledTimes(0) + }) }) diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index 8e775a4b90e..493264ea73a 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -51,6 +51,9 @@ export function useModel( }, set(value) { + if (!hasChanged(value, localValue)) { + return + } const rawProps = i.vnode!.props if ( !( @@ -62,8 +65,7 @@ export function useModel( (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps) - ) && - hasChanged(value, localValue) + ) ) { // no v-model, local update localValue = value From fd5c001ec732197b1bbfc42b666a72ba65c4c4d7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 17 Jul 2024 17:07:05 +0800 Subject: [PATCH 37/61] release: v3.4.32 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++ 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, 45 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f21c0647b..8bb29d9eedc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## [3.4.32](https://github.com/vuejs/core/compare/v3.4.31...v3.4.32) (2024-07-17) + + +### Bug Fixes + +* **build:** use consistent minify options from previous terser config ([789675f](https://github.com/vuejs/core/commit/789675f65d2b72cf979ba6a29bd323f716154a4b)) +* **compiler-sfc:** correctly resolve type annotation for declared function ([#11279](https://github.com/vuejs/core/issues/11279)) ([b287aee](https://github.com/vuejs/core/commit/b287aeec3ea85f20e4b1fc3d907c901bdc2a0176)), closes [#11266](https://github.com/vuejs/core/issues/11266) +* **defineModel:** force local update when setter results in same emitted value ([de174e1](https://github.com/vuejs/core/commit/de174e1aa756508c7542605a448e55a373afb1ed)), closes [#10279](https://github.com/vuejs/core/issues/10279) [#10301](https://github.com/vuejs/core/issues/10301) +* **hmr:** hmr reload should work with async component ([#11248](https://github.com/vuejs/core/issues/11248)) ([c8b9794](https://github.com/vuejs/core/commit/c8b97945759e869c997d60c3350d2451c5ff7887)) +* **hydration:** fix tracking of reactive style objects in production ([c10e40a](https://github.com/vuejs/core/commit/c10e40a217b89ab7e0f7f3515242d4246ecffbdd)), closes [#11372](https://github.com/vuejs/core/issues/11372) +* **hydration:** handle consectuvie text nodes during hydration ([f44c3b3](https://github.com/vuejs/core/commit/f44c3b37d446d5f8e34539029dae0d806b25bb47)), closes [#7285](https://github.com/vuejs/core/issues/7285) [#7301](https://github.com/vuejs/core/issues/7301) +* **reactivity:** ensure `unref` correctly resolves type for `ShallowRef` ([#11360](https://github.com/vuejs/core/issues/11360)) ([a509e30](https://github.com/vuejs/core/commit/a509e30f059fcdd158f39fdf34670b1019eaf2d1)), closes [#11356](https://github.com/vuejs/core/issues/11356) +* **reactivity:** shallowReactive map "unwraps" the nested refs ([#8503](https://github.com/vuejs/core/issues/8503)) ([50ddafe](https://github.com/vuejs/core/commit/50ddafe91b9195cf94124466239f82c9794699fb)), closes [#8501](https://github.com/vuejs/core/issues/8501) [#11249](https://github.com/vuejs/core/issues/11249) +* **runtime-core:** avoid recursive warning ([3ee7b4c](https://github.com/vuejs/core/commit/3ee7b4c7b1374c5bdc50a579b49f6bc15022b085)), closes [#8074](https://github.com/vuejs/core/issues/8074) +* **runtime-core:** bail manually rendered compiler slot fragments in all cases ([3d34f40](https://github.com/vuejs/core/commit/3d34f406ac7497dafd2f4e62ab23579b78a0e08a)), closes [#10870](https://github.com/vuejs/core/issues/10870) +* **runtime-core:** do not emit when defineModel ref is set with same value ([#11162](https://github.com/vuejs/core/issues/11162)) ([f1bb0ae](https://github.com/vuejs/core/commit/f1bb0aef084b5cdd4d49aecfed01ec106d9b6897)), closes [#11125](https://github.com/vuejs/core/issues/11125) +* **runtime-core:** errors during component patch should be caught by error handlers ([ee0248a](https://github.com/vuejs/core/commit/ee0248accff589a94688e177e5e3af10c18288cb)) +* **runtime-core:** force diff slot fallback content and provided content ([d76dd9c](https://github.com/vuejs/core/commit/d76dd9c58de24b273bc55af3a8ed81ba693e9683)), closes [#7256](https://github.com/vuejs/core/issues/7256) [#9200](https://github.com/vuejs/core/issues/9200) [#9308](https://github.com/vuejs/core/issues/9308) [#7266](https://github.com/vuejs/core/issues/7266) [#9213](https://github.com/vuejs/core/issues/9213) +* **runtime-core:** more edge case fix for manually rendered compiled slot ([685e3f3](https://github.com/vuejs/core/commit/685e3f381c024b9f4023e60fe0545dc60d90d984)), closes [#11336](https://github.com/vuejs/core/issues/11336) +* **runtime-core:** use separate prop caches for components and mixins ([#11350](https://github.com/vuejs/core/issues/11350)) ([b0aa234](https://github.com/vuejs/core/commit/b0aa234e5e7a611c018de68bc31e0cf55518d5ce)), closes [#7998](https://github.com/vuejs/core/issues/7998) +* **runtime-dom:** properly handle innerHTML unmount into new children ([#11159](https://github.com/vuejs/core/issues/11159)) ([3e9e32e](https://github.com/vuejs/core/commit/3e9e32ee0a6d0fbf67e9098a66ff0a1ea6647806)), closes [#9135](https://github.com/vuejs/core/issues/9135) +* **teleport:** skip teleported nodes when locating patch anchor ([8655ced](https://github.com/vuejs/core/commit/8655ced480ea0fe453ff5fe445cecf97b91ec260)), closes [#9071](https://github.com/vuejs/core/issues/9071) [#9134](https://github.com/vuejs/core/issues/9134) [#9313](https://github.com/vuejs/core/issues/9313) [#9313](https://github.com/vuejs/core/issues/9313) +* **v-model:** component v-model modifiers trim and number when cases don't match ([#9609](https://github.com/vuejs/core/issues/9609)) ([7fb6eb8](https://github.com/vuejs/core/commit/7fb6eb882b64bf99a99d00606e54b0e050674206)), closes [#4848](https://github.com/vuejs/core/issues/4848) [#4850](https://github.com/vuejs/core/issues/4850) [#4850](https://github.com/vuejs/core/issues/4850) +* **v-once:** properly unmount v-once cached trees ([d343a0d](https://github.com/vuejs/core/commit/d343a0dc01663f91db42b4ddb693e6fffcb45873)), closes [#5154](https://github.com/vuejs/core/issues/5154) [#8809](https://github.com/vuejs/core/issues/8809) + + +### Performance Improvements + +* **server-renderer:** avoid unnecessary checks in `createBuffer` ([#11364](https://github.com/vuejs/core/issues/11364)) ([fc205bf](https://github.com/vuejs/core/commit/fc205bf4decde5ce0f4a61394ffa3914b502c287)) +* **server-renderer:** optimize `unrollBuffer` by avoiding promises ([#11340](https://github.com/vuejs/core/issues/11340)) ([05779a7](https://github.com/vuejs/core/commit/05779a70bd0b567ae458a07636d229bd07c44c4e)) + + + ## [3.4.31](https://github.com/vuejs/core/compare/v3.4.30...v3.4.31) (2024-06-28) diff --git a/package.json b/package.json index d405d373f16..e4fa3447529 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.4.31", + "version": "3.4.32", "packageManager": "pnpm@9.5.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index f79314ad45b..f3202f80fb0 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.4.31", + "version": "3.4.32", "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 b18785c7d74..131abe7b33b 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.4.31", + "version": "3.4.32", "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 e1d81c7cdde..0031aac7df1 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.4.31", + "version": "3.4.32", "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 a7b71e94cba..2e90c2f292a 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.4.31", + "version": "3.4.32", "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 8f989994260..bbea042b9cb 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.4.31", + "version": "3.4.32", "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 48ff50e8f8a..f08ce5c9b35 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.4.31", + "version": "3.4.32", "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 490be0fbd28..49b301b4717 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.4.31", + "version": "3.4.32", "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 cace5e23b1b..81a3fd1d444 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.4.31", + "version": "3.4.32", "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 a332a6ac4e0..c60f0873017 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.4.31", + "version": "3.4.32", "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 216fb71e0c9..6503406872b 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.4.31", + "version": "3.4.32", "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 3b83a6b70a2..df1f4ea2c17 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.4.31", + "version": "3.4.32", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From c7f5c70ebac8f91daf6b56c131b2af2df6e162c8 Mon Sep 17 00:00:00 2001 From: Hongkun Peng Date: Fri, 19 Jul 2024 16:48:13 +0800 Subject: [PATCH 38/61] chore(build): fix build error on Windows (#11389) --- scripts/utils.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 7eec806531d..2050b05b7cd 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -60,13 +60,14 @@ export function fuzzyMatchTarget(partialTargets, includeAllMatching) { */ export async function exec(command, args, options) { return new Promise((resolve, reject) => { - const process = spawn(command, args, { + const _process = spawn(command, args, { stdio: [ 'ignore', // stdin 'pipe', // stdout 'pipe', // stderr ], ...options, + shell: process.platform === 'win32', }) /** @@ -78,19 +79,19 @@ export async function exec(command, args, options) { */ const stdoutChunks = [] - process.stderr?.on('data', chunk => { + _process.stderr?.on('data', chunk => { stderrChunks.push(chunk) }) - process.stdout?.on('data', chunk => { + _process.stdout?.on('data', chunk => { stdoutChunks.push(chunk) }) - process.on('error', error => { + _process.on('error', error => { reject(error) }) - process.on('exit', code => { + _process.on('exit', code => { const ok = code === 0 const stderr = Buffer.concat(stderrChunks).toString().trim() const stdout = Buffer.concat(stdoutChunks).toString().trim() From 5df67e36756639ea7b923d1b139d6cb14450123b Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 19 Jul 2024 16:52:03 +0800 Subject: [PATCH 39/61] fix(runtime-dom): handle undefined values in v-html (#11403) --- packages/runtime-dom/__tests__/patchProps.spec.ts | 6 ++++++ packages/runtime-dom/src/modules/props.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/runtime-dom/__tests__/patchProps.spec.ts b/packages/runtime-dom/__tests__/patchProps.spec.ts index 7f418847f5f..3e7de54a767 100644 --- a/packages/runtime-dom/__tests__/patchProps.spec.ts +++ b/packages/runtime-dom/__tests__/patchProps.spec.ts @@ -152,6 +152,12 @@ describe('runtime-dom: props patching', () => { expect(root.innerHTML).toBe(`
baz
`) }) + test('patch innerHTML porp w/ undefined value', async () => { + const root = document.createElement('div') + render(h('div', { innerHTML: undefined }), root) + expect(root.innerHTML).toBe(`
`) + }) + test('textContent unmount prev children', () => { const fn = vi.fn() const comp = { diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index 04f0d0e866d..aaacd81972c 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -15,7 +15,7 @@ export function patchDOMProp( if (key === 'innerHTML' || key === 'textContent') { // null value case is handled in renderer patchElement before patching // children - if (value === null) return + if (value == null) return el[key] = value return } From 1b81d14bfdc01ea403d0ee1b419718abaf930f52 Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 19 Jul 2024 17:02:14 +0800 Subject: [PATCH 40/61] refactor(runtime-core): remove attrsProxy and slotsProxy from instance (#11390) --- packages/runtime-core/src/component.ts | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index df3a6376989..238c718199d 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -396,9 +396,6 @@ export interface ComponentInternalInstance { refs: Data emit: EmitFn - attrsProxy: Data | null - slotsProxy: Slots | null - /** * used for keeping track of .once event handlers on components * @internal @@ -599,9 +596,6 @@ export function createComponentInstance( setupState: EMPTY_OBJ, setupContext: null, - attrsProxy: null, - slotsProxy: null, - // suspense related suspense, suspenseId: suspense ? suspense.pendingId : 0, @@ -1042,15 +1036,12 @@ const attrsProxyHandlers = __DEV__ * Dev-only */ function getSlotsProxy(instance: ComponentInternalInstance): Slots { - return ( - instance.slotsProxy || - (instance.slotsProxy = new Proxy(instance.slots, { - get(target, key: string) { - track(instance, TrackOpTypes.GET, '$slots') - return target[key] - }, - })) - ) + return new Proxy(instance.slots, { + get(target, key: string) { + track(instance, TrackOpTypes.GET, '$slots') + return target[key] + }, + }) } export function createSetupContext( @@ -1084,6 +1075,7 @@ export function createSetupContext( // We use getters in dev in case libs like test-utils overwrite instance // properties (overwrites should not be done in prod) let attrsProxy: Data + let slotsProxy: Slots return Object.freeze({ get attrs() { return ( @@ -1092,7 +1084,7 @@ export function createSetupContext( ) }, get slots() { - return getSlotsProxy(instance) + return slotsProxy || (slotsProxy = getSlotsProxy(instance)) }, get emit() { return (event: string, ...args: any[]) => instance.emit(event, ...args) From 422ef34e487f801e1162bed80c0e88e868576e1d Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 19 Jul 2024 17:24:34 +0800 Subject: [PATCH 41/61] release: v3.4.33 --- 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 8bb29d9eedc..5c2ca79bdb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [3.4.33](https://github.com/vuejs/core/compare/v3.4.32...v3.4.33) (2024-07-19) + + +### Bug Fixes + +* **runtime-dom:** handle undefined values in v-html ([#11403](https://github.com/vuejs/core/issues/11403)) ([5df67e3](https://github.com/vuejs/core/commit/5df67e36756639ea7b923d1b139d6cb14450123b)) + + + ## [3.4.32](https://github.com/vuejs/core/compare/v3.4.31...v3.4.32) (2024-07-17) diff --git a/package.json b/package.json index e4fa3447529..c7c67bcdbfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.4.32", + "version": "3.4.33", "packageManager": "pnpm@9.5.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index f3202f80fb0..8bc86be5a7f 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.4.32", + "version": "3.4.33", "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 131abe7b33b..a133afaf18b 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.4.32", + "version": "3.4.33", "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 0031aac7df1..a2c994f6dd1 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.4.32", + "version": "3.4.33", "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 2e90c2f292a..6fd6e16f8f6 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.4.32", + "version": "3.4.33", "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 bbea042b9cb..95ddefb0233 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.4.32", + "version": "3.4.33", "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 f08ce5c9b35..adf471ab997 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.4.32", + "version": "3.4.33", "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 49b301b4717..ca9fbd84156 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.4.32", + "version": "3.4.33", "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 81a3fd1d444..10ff8b514bb 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.4.32", + "version": "3.4.33", "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 c60f0873017..23255bfadd4 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.4.32", + "version": "3.4.33", "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 6503406872b..3086d398627 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.4.32", + "version": "3.4.33", "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 df1f4ea2c17..d7487c97148 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.4.32", + "version": "3.4.33", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From a18f1ecf05842337f1eb39a6871adb8cb4024093 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 24 Jul 2024 23:25:22 +0800 Subject: [PATCH 42/61] fix(defineModel): correct update with multiple changes in same tick (#11430) close #11429 --- .../__tests__/helpers/useModel.spec.ts | 25 +++++++++++-------- packages/runtime-core/src/helpers/useModel.ts | 7 ++++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/packages/runtime-core/__tests__/helpers/useModel.spec.ts b/packages/runtime-core/__tests__/helpers/useModel.spec.ts index 097e52f9167..4c30de2f26a 100644 --- a/packages/runtime-core/__tests__/helpers/useModel.spec.ts +++ b/packages/runtime-core/__tests__/helpers/useModel.spec.ts @@ -614,24 +614,23 @@ describe('useModel', () => { }) test('set no change value', async () => { - let changeChildMsg: (() => void) | null = null + let changeChildMsg!: (val: string) => void - const compRender = vi.fn() + const setValue = vi.fn() const Comp = defineComponent({ props: ['msg'], emits: ['update:msg'], setup(props) { const childMsg = useModel(props, 'msg') - changeChildMsg = () => { - childMsg.value = childMsg.value - } + changeChildMsg = (val: string) => (childMsg.value = val) return () => { return childMsg.value } }, }) - const msg = ref('HI') + const defaultVal = 'defaultVal' + const msg = ref(defaultVal) const Parent = defineComponent({ setup() { return () => @@ -639,7 +638,7 @@ describe('useModel', () => { msg: msg.value, 'onUpdate:msg': val => { msg.value = val - compRender() + setValue() }, }) }, @@ -648,8 +647,14 @@ describe('useModel', () => { const root = nodeOps.createElement('div') render(h(Parent), root) - expect(compRender).toBeCalledTimes(0) - changeChildMsg!() - expect(compRender).toBeCalledTimes(0) + expect(setValue).toBeCalledTimes(0) + + changeChildMsg(defaultVal) + expect(setValue).toBeCalledTimes(0) + + changeChildMsg('changed') + changeChildMsg(defaultVal) + expect(setValue).toBeCalledTimes(2) + expect(msg.value).toBe(defaultVal) }) }) diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index 493264ea73a..c490a699f84 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -33,7 +33,7 @@ export function useModel( const res = customRef((track, trigger) => { let localValue: any - let prevSetValue: any + let prevSetValue: any = EMPTY_OBJ let prevEmittedValue: any watchSyncEffect(() => { @@ -51,7 +51,10 @@ export function useModel( }, set(value) { - if (!hasChanged(value, localValue)) { + if ( + !hasChanged(value, localValue) && + !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue)) + ) { return } const rawProps = i.vnode!.props From b5cad0e91c41502eaf4c1261e72077e432961216 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 24 Jul 2024 23:26:13 +0800 Subject: [PATCH 43/61] refactor: use hasChanged for useModel comparisons --- packages/runtime-core/src/helpers/useModel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/runtime-core/src/helpers/useModel.ts b/packages/runtime-core/src/helpers/useModel.ts index c490a699f84..5bcd316931d 100644 --- a/packages/runtime-core/src/helpers/useModel.ts +++ b/packages/runtime-core/src/helpers/useModel.ts @@ -81,9 +81,9 @@ export function useModel( // updates and there will be no prop sync. However the local input state // may be out of sync, so we need to force an update here. if ( - value !== emittedValue && - value !== prevSetValue && - emittedValue === prevEmittedValue + hasChanged(value, emittedValue) && + hasChanged(value, prevSetValue) && + !hasChanged(emittedValue, prevEmittedValue) ) { trigger() } From 91112520427ff55941a1c759d7d60a0811ff4a61 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 24 Jul 2024 23:30:30 +0800 Subject: [PATCH 44/61] release: v3.4.34 --- 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 5c2ca79bdb5..2c253a60eb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [3.4.34](https://github.com/vuejs/core/compare/v3.4.33...v3.4.34) (2024-07-24) + + +### Bug Fixes + +* **defineModel:** correct update with multiple changes in same tick ([#11430](https://github.com/vuejs/core/issues/11430)) ([a18f1ec](https://github.com/vuejs/core/commit/a18f1ecf05842337f1eb39a6871adb8cb4024093)), closes [#11429](https://github.com/vuejs/core/issues/11429) + + + ## [3.4.33](https://github.com/vuejs/core/compare/v3.4.32...v3.4.33) (2024-07-19) diff --git a/package.json b/package.json index c7c67bcdbfe..a532294d4c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.4.33", + "version": "3.4.34", "packageManager": "pnpm@9.5.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 8bc86be5a7f..41347148bfd 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.4.33", + "version": "3.4.34", "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 a133afaf18b..452e57c6707 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.4.33", + "version": "3.4.34", "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 a2c994f6dd1..8eab5b0c222 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.4.33", + "version": "3.4.34", "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 6fd6e16f8f6..27ce3f49509 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.4.33", + "version": "3.4.34", "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 95ddefb0233..95413ce3437 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.4.33", + "version": "3.4.34", "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 adf471ab997..a590e951995 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.4.33", + "version": "3.4.34", "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 ca9fbd84156..51450c5a0fe 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.4.33", + "version": "3.4.34", "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 10ff8b514bb..78a8de2fbdd 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.4.33", + "version": "3.4.34", "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 23255bfadd4..5df49087d2d 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.4.33", + "version": "3.4.34", "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 3086d398627..41d0a893b51 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.4.33", + "version": "3.4.34", "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 d7487c97148..7171f086447 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.4.33", + "version": "3.4.34", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", From fe527741d8f909a6d0a0c84e9ec94ea5c892aca6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:06:00 +0800 Subject: [PATCH 45/61] chore(deps): update autofix-ci/action digest to ff86a55 (#11414) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/autofix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 8daee2ed5f9..d5c31beffba 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -31,4 +31,4 @@ jobs: - name: Run prettier run: pnpm run format - - uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 + - uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c From 6a6daff7ab10f0d06b8f4616a108386dfd5f68fe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:06:19 +0800 Subject: [PATCH 46/61] chore(deps): update all non-major dependencies (#11415) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 6 ++-- pnpm-lock.yaml | 76 +++++++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index a532294d4c5..45bb3a9b472 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "version": "3.4.34", - "packageManager": "pnpm@9.5.0", + "packageManager": "pnpm@9.6.0", "type": "module", "scripts": { "dev": "node scripts/dev.js", @@ -68,7 +68,7 @@ "@rollup/plugin-replace": "5.0.4", "@swc/core": "^1.6.13", "@types/hash-sum": "^1.0.2", - "@types/node": "^20.14.10", + "@types/node": "^20.14.13", "@types/semver": "^7.5.8", "@vitest/coverage-istanbul": "^1.6.0", "@vue/consolidate": "1.0.0", @@ -97,7 +97,7 @@ "rollup-plugin-dts": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-polyfill-node": "^0.13.0", - "semver": "^7.6.2", + "semver": "^7.6.3", "serve": "^14.2.3", "simple-git-hooks": "^2.11.1", "todomvc-app-css": "^2.4.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 417554c9185..c5d1a8e5eca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,14 +57,14 @@ importers: specifier: ^1.0.2 version: 1.0.2 '@types/node': - specifier: ^20.14.10 - version: 20.14.10 + specifier: ^20.14.13 + version: 20.14.13 '@types/semver': specifier: ^7.5.8 version: 7.5.8 '@vitest/coverage-istanbul': specifier: ^1.6.0 - version: 1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) + version: 1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -88,7 +88,7 @@ importers: version: 0.5.3(eslint@9.6.0)(typescript@5.4.5) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) + version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -144,8 +144,8 @@ importers: specifier: ^0.13.0 version: 0.13.0(rollup@4.18.1) semver: - specifier: ^7.6.2 - version: 7.6.2 + specifier: ^7.6.3 + version: 7.6.3 serve: specifier: ^14.2.3 version: 14.2.3 @@ -169,10 +169,10 @@ importers: version: 7.15.0(eslint@9.6.0)(typescript@5.4.5) vite: specifier: 'catalog:' - version: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + version: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + version: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) packages/compiler-core: dependencies: @@ -364,10 +364,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^5.0.5 - version: 5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue) + version: 5.0.5(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue) vite: specifier: 'catalog:' - version: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + version: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) packages/shared: {} @@ -1196,8 +1196,8 @@ packages: '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} - '@types/node@20.14.10': - resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} + '@types/node@20.14.13': + resolution: {integrity: sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -3084,8 +3084,8 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} hasBin: true @@ -4211,7 +4211,7 @@ snapshots: '@types/hash-sum@1.0.2': {} - '@types/node@20.14.10': + '@types/node@20.14.13': dependencies: undici-types: 5.26.5 @@ -4223,7 +4223,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.10 + '@types/node': 20.14.13 optional: true '@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.4.5))(eslint@9.6.0)(typescript@5.4.5)': @@ -4284,7 +4284,7 @@ snapshots: globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.6.2 + semver: 7.6.3 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 @@ -4307,12 +4307,12 @@ snapshots: '@typescript-eslint/types': 7.15.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': + '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': dependencies: - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) vue: link:packages/vue - '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': + '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': dependencies: debug: 4.3.5 istanbul-lib-coverage: 3.2.2 @@ -4323,7 +4323,7 @@ snapshots: magicast: 0.3.4 picocolors: 1.0.1 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color @@ -4743,7 +4743,7 @@ snapshots: handlebars: 4.7.8 json-stringify-safe: 5.0.1 meow: 12.1.1 - semver: 7.6.2 + semver: 7.6.3 split2: 4.2.0 conventional-changelog@5.1.0: @@ -4991,19 +4991,19 @@ snapshots: get-tsconfig: 4.7.5 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.6.2 + semver: 7.6.3 stable-hash: 0.0.4 tslib: 2.6.3 transitivePeerDependencies: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)): + eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)): dependencies: '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) eslint: 9.6.0 optionalDependencies: - vitest: 1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color - typescript @@ -5247,7 +5247,7 @@ snapshots: git-semver-tags@7.0.1: dependencies: meow: 12.1.1 - semver: 7.6.2 + semver: 7.6.3 glob-parent@5.1.2: dependencies: @@ -5476,7 +5476,7 @@ snapshots: '@babel/parser': 7.24.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.6.2 + semver: 7.6.3 transitivePeerDependencies: - supports-color @@ -5685,7 +5685,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.6.2 + semver: 7.6.3 markdown-table@3.0.3: {} @@ -5768,7 +5768,7 @@ snapshots: normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 - semver: 7.6.2 + semver: 7.6.3 validate-npm-package-license: 3.0.4 normalize-path@3.0.0: {} @@ -6294,7 +6294,7 @@ snapshots: dependencies: lru-cache: 6.0.0 - semver@7.6.2: {} + semver@7.6.3: {} serve-handler@6.1.5: dependencies: @@ -6635,13 +6635,13 @@ snapshots: vary@1.1.2: {} - vite-node@1.6.0(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1): + vite-node@1.6.0(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1): dependencies: cac: 6.7.14 debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - less @@ -6652,18 +6652,18 @@ snapshots: - supports-color - terser - vite@5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1): + vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1): dependencies: esbuild: 0.21.5 postcss: 8.4.39 rollup: 4.18.0 optionalDependencies: - '@types/node': 20.14.10 + '@types/node': 20.14.13 fsevents: 2.3.3 sass: 1.77.8 terser: 5.31.1 - vitest@1.6.0(@types/node@20.14.10)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1): + vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -6682,11 +6682,11 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.3.3(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) - vite-node: 1.6.0(@types/node@20.14.10)(sass@1.77.8)(terser@5.31.1) + vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) + vite-node: 1.6.0(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) why-is-node-running: 2.2.2 optionalDependencies: - '@types/node': 20.14.10 + '@types/node': 20.14.13 jsdom: 24.1.0 transitivePeerDependencies: - less From 62e5aa451724147d9d48863baab6d2598338fa65 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:06:40 +0800 Subject: [PATCH 47/61] fix(deps): update compiler (#11416) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/compiler-sfc/package.json | 4 +- pnpm-lock.yaml | 66 +++++++++++++++--------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 8eab5b0c222..c9e771abbc7 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -49,7 +49,7 @@ "@vue/shared": "workspace:*", "estree-walker": "catalog:", "magic-string": "catalog:", - "postcss": "^8.4.39", + "postcss": "^8.4.40", "source-map-js": "catalog:" }, "devDependencies": { @@ -60,7 +60,7 @@ "merge-source-map": "^1.1.0", "minimatch": "^9.0.5", "postcss-modules": "^6.0.0", - "postcss-selector-parser": "^6.1.0", + "postcss-selector-parser": "^6.1.1", "pug": "^3.0.3", "sass": "^1.77.8" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5d1a8e5eca..d86be5d4439 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -229,8 +229,8 @@ importers: specifier: 'catalog:' version: 0.30.10 postcss: - specifier: ^8.4.39 - version: 8.4.39 + specifier: ^8.4.40 + version: 8.4.40 source-map-js: specifier: 'catalog:' version: 1.2.0 @@ -255,10 +255,10 @@ importers: version: 9.0.5 postcss-modules: specifier: ^6.0.0 - version: 6.0.0(postcss@8.4.39) + version: 6.0.0(postcss@8.4.40) postcss-selector-parser: - specifier: ^6.1.0 - version: 6.1.0 + specifier: ^6.1.1 + version: 6.1.1 pug: specifier: ^3.0.3 version: 3.0.3 @@ -2832,15 +2832,15 @@ packages: peerDependencies: postcss: ^8.0.0 - postcss-selector-parser@6.1.0: - resolution: {integrity: sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==} + postcss-selector-parser@6.1.1: + resolution: {integrity: sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==} engines: {node: '>=4'} postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - postcss@8.4.39: - resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} + postcss@8.4.40: + resolution: {integrity: sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -5359,9 +5359,9 @@ snapshots: dependencies: safer-buffer: 2.1.2 - icss-utils@5.1.0(postcss@8.4.39): + icss-utils@5.1.0(postcss@8.4.40): dependencies: - postcss: 8.4.39 + postcss: 8.4.40 ieee754@1.2.1: {} @@ -5926,47 +5926,47 @@ snapshots: mlly: 1.7.1 pathe: 1.1.2 - postcss-modules-extract-imports@3.1.0(postcss@8.4.39): + postcss-modules-extract-imports@3.1.0(postcss@8.4.40): dependencies: - postcss: 8.4.39 + postcss: 8.4.40 - postcss-modules-local-by-default@4.0.5(postcss@8.4.39): + postcss-modules-local-by-default@4.0.5(postcss@8.4.40): dependencies: - icss-utils: 5.1.0(postcss@8.4.39) - postcss: 8.4.39 - postcss-selector-parser: 6.1.0 + icss-utils: 5.1.0(postcss@8.4.40) + postcss: 8.4.40 + postcss-selector-parser: 6.1.1 postcss-value-parser: 4.2.0 - postcss-modules-scope@3.2.0(postcss@8.4.39): + postcss-modules-scope@3.2.0(postcss@8.4.40): dependencies: - postcss: 8.4.39 - postcss-selector-parser: 6.1.0 + postcss: 8.4.40 + postcss-selector-parser: 6.1.1 - postcss-modules-values@4.0.0(postcss@8.4.39): + postcss-modules-values@4.0.0(postcss@8.4.40): dependencies: - icss-utils: 5.1.0(postcss@8.4.39) - postcss: 8.4.39 + icss-utils: 5.1.0(postcss@8.4.40) + postcss: 8.4.40 - postcss-modules@6.0.0(postcss@8.4.39): + postcss-modules@6.0.0(postcss@8.4.40): dependencies: generic-names: 4.0.0 - icss-utils: 5.1.0(postcss@8.4.39) + icss-utils: 5.1.0(postcss@8.4.40) lodash.camelcase: 4.3.0 - postcss: 8.4.39 - postcss-modules-extract-imports: 3.1.0(postcss@8.4.39) - postcss-modules-local-by-default: 4.0.5(postcss@8.4.39) - postcss-modules-scope: 3.2.0(postcss@8.4.39) - postcss-modules-values: 4.0.0(postcss@8.4.39) + postcss: 8.4.40 + postcss-modules-extract-imports: 3.1.0(postcss@8.4.40) + postcss-modules-local-by-default: 4.0.5(postcss@8.4.40) + postcss-modules-scope: 3.2.0(postcss@8.4.40) + postcss-modules-values: 4.0.0(postcss@8.4.40) string-hash: 1.1.3 - postcss-selector-parser@6.1.0: + postcss-selector-parser@6.1.1: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 postcss-value-parser@4.2.0: {} - postcss@8.4.39: + postcss@8.4.40: dependencies: nanoid: 3.3.7 picocolors: 1.0.1 @@ -6655,7 +6655,7 @@ snapshots: vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1): dependencies: esbuild: 0.21.5 - postcss: 8.4.39 + postcss: 8.4.40 rollup: 4.18.0 optionalDependencies: '@types/node': 20.14.13 From c8395f27bdf3105c5729a9e7895e36d83b123be9 Mon Sep 17 00:00:00 2001 From: wzc520pyfm <1528857653@qq.com> Date: Mon, 29 Jul 2024 09:10:52 +0800 Subject: [PATCH 48/61] chore(docs): update the minimum requeird version of node and pnpm (#11443) [ci skip] --- .github/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/contributing.md b/.github/contributing.md index 5b9206a8529..3ed1de4e02a 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -82,7 +82,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before ## Development Setup -You will need [Node.js](https://nodejs.org) **version 18.12+**, and [PNPM](https://pnpm.io) **version 8+**. +You will need [Node.js](https://nodejs.org) with minimum version as specified in the [`.node-version`](https://github.com/vuejs/core/blob/main/.node-version) file, and [PNPM](https://pnpm.io) with minimum version as specified in the [`"packageManager"` field in `package.json`](https://github.com/vuejs/core/blob/main/package.json#L4). We also recommend installing [@antfu/ni](https://github.com/antfu/ni) to help switching between repos using different package managers. `ni` also provides the handy `nr` command which running npm scripts easier. From d40bbcb1407748ea918591f1915158832fe61c23 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:11:08 +0800 Subject: [PATCH 49/61] chore(deps): update test (#11417) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- pnpm-lock.yaml | 131 ++++++++++++++++++------------------------------- 2 files changed, 50 insertions(+), 85 deletions(-) diff --git a/package.json b/package.json index 45bb3a9b472..68e466eb91b 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "eslint-plugin-import-x": "^0.5.3", "eslint-plugin-vitest": "^0.5.4", "estree-walker": "catalog:", - "jsdom": "^24.1.0", + "jsdom": "^24.1.1", "lint-staged": "^15.2.7", "lodash": "^4.17.21", "magic-string": "^0.30.10", @@ -91,7 +91,7 @@ "prettier": "^3.3.2", "pretty-bytes": "^6.1.1", "pug": "^3.0.3", - "puppeteer": "~22.12.1", + "puppeteer": "~22.14.0", "rimraf": "^5.0.9", "rollup": "^4.18.1", "rollup-plugin-dts": "^6.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d86be5d4439..c0bb0954fd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,7 +64,7 @@ importers: version: 7.5.8 '@vitest/coverage-istanbul': specifier: ^1.6.0 - version: 1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) + version: 1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)) '@vue/consolidate': specifier: 1.0.0 version: 1.0.0 @@ -88,13 +88,13 @@ importers: version: 0.5.3(eslint@9.6.0)(typescript@5.4.5) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)) + version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)) estree-walker: specifier: 'catalog:' version: 2.0.2 jsdom: - specifier: ^24.1.0 - version: 24.1.0 + specifier: ^24.1.1 + version: 24.1.1 lint-staged: specifier: ^15.2.7 version: 15.2.7 @@ -126,8 +126,8 @@ importers: specifier: ^3.0.3 version: 3.0.3 puppeteer: - specifier: ~22.12.1 - version: 22.12.1(typescript@5.4.5) + specifier: ~22.14.0 + version: 22.14.0(typescript@5.4.5) rimraf: specifier: ^5.0.9 version: 5.0.9 @@ -172,7 +172,7 @@ importers: version: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + version: 1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1) packages/compiler-core: dependencies: @@ -881,8 +881,8 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@puppeteer/browsers@2.2.3': - resolution: {integrity: sha512-bJ0UBsk0ESOs6RFcLXOt99a3yTDcOKlzfjad+rhFwdaG1Lu/Wzq58GHYCDTlZ9z6mldf4g+NTb+TXEfe0PpnsQ==} + '@puppeteer/browsers@2.3.0': + resolution: {integrity: sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==} engines: {node: '>=18'} hasBin: true @@ -1542,8 +1542,8 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} - chromium-bidi@0.5.24: - resolution: {integrity: sha512-5xQNN2SVBdZv4TxeMLaI+PelrnZsHDhn8h2JtyriLr+0qHcZS8BMuo93qN6J1VmtmrgYP+rmcLHcbpnA8QJh+w==} + chromium-bidi@0.6.2: + resolution: {integrity: sha512-4WVBa6ijmUTVr9cZD4eicQD8Mdy/HCX3bzEIYYpmk0glqYLoWH+LqQEvV9RpDRzoQSbY1KJHloYXbDMXMbDPhg==} peerDependencies: devtools-protocol: '*' @@ -1747,15 +1747,6 @@ packages: supports-color: optional: true - debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.5: resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} engines: {node: '>=6.0'} @@ -1795,8 +1786,8 @@ packages: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - devtools-protocol@0.0.1299070: - resolution: {integrity: sha512-+qtL3eX50qsJ7c+qVyagqi7AWMoQCBGNfoyJZMwm/NSXVqLYbuitrWEEIzxfUmTNy7//Xe8yhMmQ+elj3uAqSg==} + devtools-protocol@0.0.1312386: + resolution: {integrity: sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==} diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} @@ -2389,8 +2380,8 @@ packages: jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - jsdom@24.1.0: - resolution: {integrity: sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==} + jsdom@24.1.1: + resolution: {integrity: sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==} engines: {node: '>=18'} peerDependencies: canvas: ^2.11.2 @@ -2516,10 +2507,6 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} @@ -2667,8 +2654,8 @@ packages: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - nwsapi@2.2.10: - resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} + nwsapi@2.2.12: + resolution: {integrity: sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==} object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} @@ -2926,12 +2913,12 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - puppeteer-core@22.12.1: - resolution: {integrity: sha512-XmqeDPVdC5/3nGJys1jbgeoZ02wP0WV1GBlPtr/ULRbGXJFuqgXMcKQ3eeNtFpBzGRbpeoCGWHge1ZWKWl0Exw==} + puppeteer-core@22.14.0: + resolution: {integrity: sha512-rl4tOY5LcA3e374GAlsGGHc05HL3eGNf5rZ+uxkl6id9zVZKcwcp1Z+Nd6byb6WPiPeecT/dwz8f/iUm+AZQSw==} engines: {node: '>=18'} - puppeteer@22.12.1: - resolution: {integrity: sha512-1GxY8dnEnHr1SLzdSDr0FCjM6JQfAh2E2I/EqzeF8a58DbGVk9oVjj4lFdqNoVbpgFSpAbz7VER9St7S1wDpNg==} + puppeteer@22.14.0: + resolution: {integrity: sha512-MGTR6/pM8zmWbTdazb6FKnwIihzsSEXBPH49mFFU96DNZpQOevCAZMnjBZGlZRGRzRK6aADCavR6SQtrbv5dQw==} engines: {node: '>=18'} hasBin: true @@ -3079,11 +3066,6 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} - engines: {node: '>=10'} - hasBin: true - semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} @@ -3263,8 +3245,8 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - tar-fs@3.0.5: - resolution: {integrity: sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==} + tar-fs@3.0.6: + resolution: {integrity: sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==} tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} @@ -3580,9 +3562,6 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yaml@2.4.5: resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} @@ -3985,14 +3964,14 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@puppeteer/browsers@2.2.3': + '@puppeteer/browsers@2.3.0': dependencies: - debug: 4.3.4 + debug: 4.3.5 extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.4.0 - semver: 7.6.0 - tar-fs: 3.0.5 + semver: 7.6.3 + tar-fs: 3.0.6 unbzip2-stream: 1.4.3 yargs: 17.7.2 transitivePeerDependencies: @@ -4312,7 +4291,7 @@ snapshots: vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) vue: link:packages/vue - '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1))': + '@vitest/coverage-istanbul@1.6.0(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1))': dependencies: debug: 4.3.5 istanbul-lib-coverage: 3.2.2 @@ -4323,7 +4302,7 @@ snapshots: magicast: 0.3.4 picocolors: 1.0.1 test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color @@ -4604,9 +4583,9 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - chromium-bidi@0.5.24(devtools-protocol@0.0.1299070): + chromium-bidi@0.6.2(devtools-protocol@0.0.1312386): dependencies: - devtools-protocol: 0.0.1299070 + devtools-protocol: 0.0.1312386 mitt: 3.0.1 urlpattern-polyfill: 10.0.0 zod: 3.23.8 @@ -4813,10 +4792,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.4: - dependencies: - ms: 2.1.2 - debug@4.3.5: dependencies: ms: 2.1.2 @@ -4847,7 +4822,7 @@ snapshots: delayed-stream@1.0.0: {} - devtools-protocol@0.0.1299070: {} + devtools-protocol@0.0.1312386: {} diff-sequences@29.6.3: {} @@ -4998,12 +4973,12 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1)): + eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)): dependencies: '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) eslint: 9.6.0 optionalDependencies: - vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1) + vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color - typescript @@ -5517,7 +5492,7 @@ snapshots: jsbn@1.1.0: {} - jsdom@24.1.0: + jsdom@24.1.1: dependencies: cssstyle: 4.0.1 data-urls: 5.0.0 @@ -5527,7 +5502,7 @@ snapshots: http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.5 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.10 + nwsapi: 2.2.12 parse5: 7.1.2 rrweb-cssom: 0.7.1 saxes: 6.0.0 @@ -5667,10 +5642,6 @@ snapshots: dependencies: yallist: 3.1.1 - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - lru-cache@7.18.3: {} magic-string@0.30.10: @@ -5793,7 +5764,7 @@ snapshots: dependencies: path-key: 4.0.0 - nwsapi@2.2.10: {} + nwsapi@2.2.12: {} object-assign@4.1.1: {} @@ -6085,24 +6056,24 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@22.12.1: + puppeteer-core@22.14.0: dependencies: - '@puppeteer/browsers': 2.2.3 - chromium-bidi: 0.5.24(devtools-protocol@0.0.1299070) + '@puppeteer/browsers': 2.3.0 + chromium-bidi: 0.6.2(devtools-protocol@0.0.1312386) debug: 4.3.5 - devtools-protocol: 0.0.1299070 + devtools-protocol: 0.0.1312386 ws: 8.18.0 transitivePeerDependencies: - bufferutil - supports-color - utf-8-validate - puppeteer@22.12.1(typescript@5.4.5): + puppeteer@22.14.0(typescript@5.4.5): dependencies: - '@puppeteer/browsers': 2.2.3 + '@puppeteer/browsers': 2.3.0 cosmiconfig: 9.0.0(typescript@5.4.5) - devtools-protocol: 0.0.1299070 - puppeteer-core: 22.12.1 + devtools-protocol: 0.0.1312386 + puppeteer-core: 22.14.0 transitivePeerDependencies: - bufferutil - supports-color @@ -6290,10 +6261,6 @@ snapshots: semver@6.3.1: {} - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 - semver@7.6.3: {} serve-handler@6.1.5: @@ -6479,7 +6446,7 @@ snapshots: symbol-tree@3.2.4: {} - tar-fs@3.0.5: + tar-fs@3.0.6: dependencies: pump: 3.0.0 tar-stream: 3.1.7 @@ -6663,7 +6630,7 @@ snapshots: sass: 1.77.8 terser: 5.31.1 - vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.0)(sass@1.77.8)(terser@5.31.1): + vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -6687,7 +6654,7 @@ snapshots: why-is-node-running: 2.2.2 optionalDependencies: '@types/node': 20.14.13 - jsdom: 24.1.0 + jsdom: 24.1.1 transitivePeerDependencies: - less - lightningcss @@ -6770,8 +6737,6 @@ snapshots: yallist@3.1.1: {} - yallist@4.0.0: {} - yaml@2.4.5: {} yargs-parser@21.1.1: {} From b0d899d68abdad44aecd184ef664002c20c1e513 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:24:03 +0800 Subject: [PATCH 50/61] chore(deps): update build (#11447) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- packages/sfc-playground/package.json | 2 +- .../src/download/template/package.json | 4 +- pnpm-lock.yaml | 316 +++++++++--------- 4 files changed, 163 insertions(+), 163 deletions(-) diff --git a/package.json b/package.json index 68e466eb91b..60a1025c6eb 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "5.0.4", - "@swc/core": "^1.6.13", + "@swc/core": "^1.7.3", "@types/hash-sum": "^1.0.2", "@types/node": "^20.14.13", "@types/semver": "^7.5.8", @@ -93,7 +93,7 @@ "pug": "^3.0.3", "puppeteer": "~22.14.0", "rimraf": "^5.0.9", - "rollup": "^4.18.1", + "rollup": "^4.19.1", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-polyfill-node": "^0.13.0", diff --git a/packages/sfc-playground/package.json b/packages/sfc-playground/package.json index f4e50d687a1..74302db32e0 100644 --- a/packages/sfc-playground/package.json +++ b/packages/sfc-playground/package.json @@ -9,7 +9,7 @@ "serve": "vite preview" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.5", + "@vitejs/plugin-vue": "^5.1.1", "vite": "catalog:" }, "dependencies": { diff --git a/packages/sfc-playground/src/download/template/package.json b/packages/sfc-playground/src/download/template/package.json index 9cce6418897..6747f24c8c0 100644 --- a/packages/sfc-playground/src/download/template/package.json +++ b/packages/sfc-playground/src/download/template/package.json @@ -11,7 +11,7 @@ "vue": "^3.4.0" }, "devDependencies": { - "@vitejs/plugin-vue": "^5.0.5", - "vite": "^5.3.3" + "@vitejs/plugin-vue": "^5.1.1", + "vite": "^5.3.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0bb0954fd3..5fbcbbe325d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,22 +37,22 @@ importers: version: 7.24.7 '@rollup/plugin-alias': specifier: ^5.1.0 - version: 5.1.0(rollup@4.18.1) + version: 5.1.0(rollup@4.19.1) '@rollup/plugin-commonjs': specifier: ^26.0.1 - version: 26.0.1(rollup@4.18.1) + version: 26.0.1(rollup@4.19.1) '@rollup/plugin-json': specifier: ^6.1.0 - version: 6.1.0(rollup@4.18.1) + version: 6.1.0(rollup@4.19.1) '@rollup/plugin-node-resolve': specifier: ^15.2.3 - version: 15.2.3(rollup@4.18.1) + version: 15.2.3(rollup@4.19.1) '@rollup/plugin-replace': specifier: 5.0.4 - version: 5.0.4(rollup@4.18.1) + version: 5.0.4(rollup@4.19.1) '@swc/core': - specifier: ^1.6.13 - version: 1.6.13 + specifier: ^1.7.3 + version: 1.7.3 '@types/hash-sum': specifier: ^1.0.2 version: 1.0.2 @@ -132,17 +132,17 @@ importers: specifier: ^5.0.9 version: 5.0.9 rollup: - specifier: ^4.18.1 - version: 4.18.1 + specifier: ^4.19.1 + version: 4.19.1 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.18.1)(typescript@5.4.5) + version: 6.1.1(rollup@4.19.1)(typescript@5.4.5) rollup-plugin-esbuild: specifier: ^6.1.1 - version: 6.1.1(esbuild@0.23.0)(rollup@4.18.1) + version: 6.1.1(esbuild@0.23.0)(rollup@4.19.1) rollup-plugin-polyfill-node: specifier: ^0.13.0 - version: 0.13.0(rollup@4.18.1) + version: 0.13.0(rollup@4.19.1) semver: specifier: ^7.6.3 version: 7.6.3 @@ -363,8 +363,8 @@ importers: version: link:../vue devDependencies: '@vitejs/plugin-vue': - specifier: ^5.0.5 - version: 5.0.5(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue) + specifier: ^5.1.1 + version: 5.1.1(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue) vite: specifier: 'catalog:' version: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) @@ -954,8 +954,8 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.18.1': - resolution: {integrity: sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==} + '@rollup/rollup-android-arm-eabi@4.19.1': + resolution: {integrity: sha512-XzqSg714++M+FXhHfXpS1tDnNZNpgxxuGZWlRG/jSj+VEPmZ0yg6jV4E0AL3uyBKxO8mO3xtOsP5mQ+XLfrlww==} cpu: [arm] os: [android] @@ -964,8 +964,8 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.18.1': - resolution: {integrity: sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==} + '@rollup/rollup-android-arm64@4.19.1': + resolution: {integrity: sha512-thFUbkHteM20BGShD6P08aungq4irbIZKUNbG70LN8RkO7YztcGPiKTTGZS7Kw+x5h8hOXs0i4OaHwFxlpQN6A==} cpu: [arm64] os: [android] @@ -974,8 +974,8 @@ packages: cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.18.1': - resolution: {integrity: sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==} + '@rollup/rollup-darwin-arm64@4.19.1': + resolution: {integrity: sha512-8o6eqeFZzVLia2hKPUZk4jdE3zW7LCcZr+MD18tXkgBBid3lssGVAYuox8x6YHoEPDdDa9ixTaStcmx88lio5Q==} cpu: [arm64] os: [darwin] @@ -984,8 +984,8 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.18.1': - resolution: {integrity: sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==} + '@rollup/rollup-darwin-x64@4.19.1': + resolution: {integrity: sha512-4T42heKsnbjkn7ovYiAdDVRRWZLU9Kmhdt6HafZxFcUdpjlBlxj4wDrt1yFWLk7G4+E+8p2C9tcmSu0KA6auGA==} cpu: [x64] os: [darwin] @@ -994,8 +994,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.18.1': - resolution: {integrity: sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==} + '@rollup/rollup-linux-arm-gnueabihf@4.19.1': + resolution: {integrity: sha512-MXg1xp+e5GhZ3Vit1gGEyoC+dyQUBy2JgVQ+3hUrD9wZMkUw/ywgkpK7oZgnB6kPpGrxJ41clkPPnsknuD6M2Q==} cpu: [arm] os: [linux] @@ -1004,8 +1004,8 @@ packages: cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.18.1': - resolution: {integrity: sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==} + '@rollup/rollup-linux-arm-musleabihf@4.19.1': + resolution: {integrity: sha512-DZNLwIY4ftPSRVkJEaxYkq7u2zel7aah57HESuNkUnz+3bZHxwkCUkrfS2IWC1sxK6F2QNIR0Qr/YXw7nkF3Pw==} cpu: [arm] os: [linux] @@ -1014,8 +1014,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.18.1': - resolution: {integrity: sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==} + '@rollup/rollup-linux-arm64-gnu@4.19.1': + resolution: {integrity: sha512-C7evongnjyxdngSDRRSQv5GvyfISizgtk9RM+z2biV5kY6S/NF/wta7K+DanmktC5DkuaJQgoKGf7KUDmA7RUw==} cpu: [arm64] os: [linux] @@ -1024,8 +1024,8 @@ packages: cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.18.1': - resolution: {integrity: sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==} + '@rollup/rollup-linux-arm64-musl@4.19.1': + resolution: {integrity: sha512-89tFWqxfxLLHkAthAcrTs9etAoBFRduNfWdl2xUs/yLV+7XDrJ5yuXMHptNqf1Zw0UCA3cAutkAiAokYCkaPtw==} cpu: [arm64] os: [linux] @@ -1034,8 +1034,8 @@ packages: cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': - resolution: {integrity: sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==} + '@rollup/rollup-linux-powerpc64le-gnu@4.19.1': + resolution: {integrity: sha512-PromGeV50sq+YfaisG8W3fd+Cl6mnOOiNv2qKKqKCpiiEke2KiKVyDqG/Mb9GWKbYMHj5a01fq/qlUR28PFhCQ==} cpu: [ppc64] os: [linux] @@ -1044,8 +1044,8 @@ packages: cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.18.1': - resolution: {integrity: sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==} + '@rollup/rollup-linux-riscv64-gnu@4.19.1': + resolution: {integrity: sha512-/1BmHYh+iz0cNCP0oHCuF8CSiNj0JOGf0jRlSo3L/FAyZyG2rGBuKpkZVH9YF+x58r1jgWxvm1aRg3DHrLDt6A==} cpu: [riscv64] os: [linux] @@ -1054,8 +1054,8 @@ packages: cpu: [s390x] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.18.1': - resolution: {integrity: sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==} + '@rollup/rollup-linux-s390x-gnu@4.19.1': + resolution: {integrity: sha512-0cYP5rGkQWRZKy9/HtsWVStLXzCF3cCBTRI+qRL8Z+wkYlqN7zrSYm6FuY5Kd5ysS5aH0q5lVgb/WbG4jqXN1Q==} cpu: [s390x] os: [linux] @@ -1064,8 +1064,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.18.1': - resolution: {integrity: sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==} + '@rollup/rollup-linux-x64-gnu@4.19.1': + resolution: {integrity: sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==} cpu: [x64] os: [linux] @@ -1074,8 +1074,8 @@ packages: cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.18.1': - resolution: {integrity: sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==} + '@rollup/rollup-linux-x64-musl@4.19.1': + resolution: {integrity: sha512-V7cBw/cKXMfEVhpSvVZhC+iGifD6U1zJ4tbibjjN+Xi3blSXaj/rJynAkCFFQfoG6VZrAiP7uGVzL440Q6Me2Q==} cpu: [x64] os: [linux] @@ -1084,8 +1084,8 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.18.1': - resolution: {integrity: sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==} + '@rollup/rollup-win32-arm64-msvc@4.19.1': + resolution: {integrity: sha512-88brja2vldW/76jWATlBqHEoGjJLRnP0WOEKAUbMcXaAZnemNhlAHSyj4jIwMoP2T750LE9lblvD4e2jXleZsA==} cpu: [arm64] os: [win32] @@ -1094,8 +1094,8 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.18.1': - resolution: {integrity: sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==} + '@rollup/rollup-win32-ia32-msvc@4.19.1': + resolution: {integrity: sha512-LdxxcqRVSXi6k6JUrTah1rHuaupoeuiv38du8Mt4r4IPer3kwlTo+RuvfE8KzZ/tL6BhaPlzJ3835i6CxrFIRQ==} cpu: [ia32] os: [win32] @@ -1104,76 +1104,76 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.18.1': - resolution: {integrity: sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==} + '@rollup/rollup-win32-x64-msvc@4.19.1': + resolution: {integrity: sha512-2bIrL28PcK3YCqD9anGxDxamxdiJAxA+l7fWIwM5o8UqNy1t3d1NdAweO2XhA0KTDJ5aH1FsuiT5+7VhtHliXg==} cpu: [x64] os: [win32] '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - '@swc/core-darwin-arm64@1.6.13': - resolution: {integrity: sha512-SOF4buAis72K22BGJ3N8y88mLNfxLNprTuJUpzikyMGrvkuBFNcxYtMhmomO0XHsgLDzOJ+hWzcgjRNzjMsUcQ==} + '@swc/core-darwin-arm64@1.7.3': + resolution: {integrity: sha512-CTkHa6MJdov9t41vuV2kmQIMu+Q19LrEHGIR/UiJYH06SC/sOu35ZZH8DyfLp9ZoaCn21gwgWd61ixOGQlwzTw==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.6.13': - resolution: {integrity: sha512-AW8akFSC+tmPE6YQQvK9S2A1B8pjnXEINg+gGgw0KRUUXunvu1/OEOeC5L2Co1wAwhD7bhnaefi06Qi9AiwOag==} + '@swc/core-darwin-x64@1.7.3': + resolution: {integrity: sha512-mun623y6rCoZ2EFIYfIRqXYRFufJOopoYSJcxYhZUrfTpAvQ1zLngjQpWCUU1krggXR2U0PQj+ls0DfXUTraNg==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.6.13': - resolution: {integrity: sha512-f4gxxvDXVUm2HLYXRd311mSrmbpQF2MZ4Ja6XCQz1hWAxXdhRl1gpnZ+LH/xIfGSwQChrtLLVrkxdYUCVuIjFg==} + '@swc/core-linux-arm-gnueabihf@1.7.3': + resolution: {integrity: sha512-4Jz4UcIcvZNMp9qoHbBx35bo3rjt8hpYLPqnR4FFq6gkAsJIMFC56UhRZwdEQoDuYiOFMBnnrsg31Fyo6YQypA==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.6.13': - resolution: {integrity: sha512-Nf/eoW2CbG8s+9JoLtjl9FByBXyQ5cjdBsA4efO7Zw4p+YSuXDgc8HRPC+E2+ns0praDpKNZtLvDtmF2lL+2Gg==} + '@swc/core-linux-arm64-gnu@1.7.3': + resolution: {integrity: sha512-p+U/M/oqV7HC4erQ5TVWHhJU1984QD+wQBPxslAYq751bOQGm0R/mXK42GjugqjnR6yYrAiwKKbpq4iWVXNePA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.6.13': - resolution: {integrity: sha512-2OysYSYtdw79prJYuKIiux/Gj0iaGEbpS2QZWCIY4X9sGoETJ5iMg+lY+YCrIxdkkNYd7OhIbXdYFyGs/w5LDg==} + '@swc/core-linux-arm64-musl@1.7.3': + resolution: {integrity: sha512-s6VzyaJwaRGTi2mz2h6Ywxfmgpkc69IxhuMzl+sl34plH0V0RgnZDm14HoCGIKIzRk4+a2EcBV1ZLAfWmPACQg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.6.13': - resolution: {integrity: sha512-PkR4CZYJNk5hcd2+tMWBpnisnmYsUzazI1O5X7VkIGFcGePTqJ/bWlfUIVVExWxvAI33PQFzLbzmN5scyIUyGQ==} + '@swc/core-linux-x64-gnu@1.7.3': + resolution: {integrity: sha512-IrFY48C356Z2dU2pjYg080yvMXzmSV3Lmm/Wna4cfcB1nkVLjWsuYwwRAk9CY7E19c+q8N1sMNggubAUDYoX2g==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.6.13': - resolution: {integrity: sha512-OdsY7wryTxCKwGQcwW9jwWg3cxaHBkTTHi91+5nm7hFPpmZMz1HivJrWAMwVE7iXFw+M4l6ugB/wCvpYrUAAjA==} + '@swc/core-linux-x64-musl@1.7.3': + resolution: {integrity: sha512-qoLgxBlBnnyUEDu5vmRQqX90h9jldU1JXI96e6eh2d1gJyKRA0oSK7xXmTzorv1fGHiHulv9qiJOUG+g6uzJWg==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.6.13': - resolution: {integrity: sha512-ap6uNmYjwk9M/+bFEuWRNl3hq4VqgQ/Lk+ID/F5WGqczNr0L7vEf+pOsRAn0F6EV+o/nyb3ePt8rLhE/wjHpPg==} + '@swc/core-win32-arm64-msvc@1.7.3': + resolution: {integrity: sha512-OAd7jVVJ7nb0Ev80VAa1aeK+FldPeC4eZ35H4Qn6EICzIz0iqJo2T33qLKkSZiZEBKSoF4KcwrqYfkjLOp5qWg==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.6.13': - resolution: {integrity: sha512-IJ8KH4yIUHTnS/U1jwQmtbfQals7zWPG0a9hbEfIr4zI0yKzjd83lmtS09lm2Q24QBWOCFGEEbuZxR4tIlvfzA==} + '@swc/core-win32-ia32-msvc@1.7.3': + resolution: {integrity: sha512-31+Le1NyfSnILFV9+AhxfFOG0DK0272MNhbIlbcv4w/iqpjkhaOnNQnLsYJD1Ow7lTX1MtIZzTjOhRlzSviRWg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.6.13': - resolution: {integrity: sha512-f6/sx6LMuEnbuxtiSL/EkR0Y6qUHFw1XVrh6rwzKXptTipUdOY+nXpKoh+1UsBm/r7H0/5DtOdrn3q5ZHbFZjQ==} + '@swc/core-win32-x64-msvc@1.7.3': + resolution: {integrity: sha512-jVQPbYrwcuueI4QB0fHC29SVrkFOBcfIspYDlgSoHnEz6tmLMqUy+txZUypY/ZH/KaK0HEY74JkzgbRC1S6LFQ==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.6.13': - resolution: {integrity: sha512-eailUYex6fkfaQTev4Oa3mwn0/e3mQU4H8y1WPuImYQESOQDtVrowwUGDSc19evpBbHpKtwM+hw8nLlhIsF+Tw==} + '@swc/core@1.7.3': + resolution: {integrity: sha512-HHAlbXjWI6Kl9JmmUW1LSygT1YbblXgj2UvvDzMkTBPRzYMhW6xchxdO8HbtMPtFYRt/EQq9u1z7j4ttRSrFsA==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -1184,8 +1184,8 @@ packages: '@swc/counter@0.1.3': resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} - '@swc/types@0.1.9': - resolution: {integrity: sha512-qKnCno++jzcJ4lM4NTfYifm1EFSCeIfKiAHAfkENZAV5Kl9PjJIyd2yeeVv6c/2CckuLyv2NmRC5pv6pm2WQBg==} + '@swc/types@0.1.12': + resolution: {integrity: sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==} '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} @@ -1269,8 +1269,8 @@ packages: resolution: {integrity: sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==} engines: {node: ^18.18.0 || >=20.0.0} - '@vitejs/plugin-vue@5.0.5': - resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==} + '@vitejs/plugin-vue@5.1.1': + resolution: {integrity: sha512-sDckXxlHpMsjRQbAH9WanangrfrblsOd3pNifePs+FOHjJg1jfWq5L/P0PsBRndEt3nmdUnmvieP8ULDeX5AvA==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 @@ -3030,8 +3030,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.18.1: - resolution: {integrity: sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==} + rollup@4.19.1: + resolution: {integrity: sha512-K5vziVlg7hTpYfFBI+91zHBEMo6jafYXpkMlqZjg7/zhIG9iHqazBf4xz9AVdjS9BruRn280ROqLI7G3OFRIlw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3977,210 +3977,210 @@ snapshots: transitivePeerDependencies: - supports-color - '@rollup/plugin-alias@5.1.0(rollup@4.18.1)': + '@rollup/plugin-alias@5.1.0(rollup@4.19.1)': dependencies: slash: 4.0.0 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/plugin-commonjs@26.0.1(rollup@4.18.1)': + '@rollup/plugin-commonjs@26.0.1(rollup@4.19.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) commondir: 1.0.1 estree-walker: 2.0.2 glob: 10.4.3 is-reference: 1.2.1 magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/plugin-inject@5.0.5(rollup@4.18.1)': + '@rollup/plugin-inject@5.0.5(rollup@4.19.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) estree-walker: 2.0.2 magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/plugin-json@6.1.0(rollup@4.18.1)': + '@rollup/plugin-json@6.1.0(rollup@4.19.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/plugin-node-resolve@15.2.3(rollup@4.18.1)': + '@rollup/plugin-node-resolve@15.2.3(rollup@4.19.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/plugin-replace@5.0.4(rollup@4.18.1)': + '@rollup/plugin-replace@5.0.4(rollup@4.19.1)': dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) magic-string: 0.30.10 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 - '@rollup/pluginutils@5.1.0(rollup@4.18.1)': + '@rollup/pluginutils@5.1.0(rollup@4.19.1)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.18.1 + rollup: 4.19.1 '@rollup/rollup-android-arm-eabi@4.18.0': optional: true - '@rollup/rollup-android-arm-eabi@4.18.1': + '@rollup/rollup-android-arm-eabi@4.19.1': optional: true '@rollup/rollup-android-arm64@4.18.0': optional: true - '@rollup/rollup-android-arm64@4.18.1': + '@rollup/rollup-android-arm64@4.19.1': optional: true '@rollup/rollup-darwin-arm64@4.18.0': optional: true - '@rollup/rollup-darwin-arm64@4.18.1': + '@rollup/rollup-darwin-arm64@4.19.1': optional: true '@rollup/rollup-darwin-x64@4.18.0': optional: true - '@rollup/rollup-darwin-x64@4.18.1': + '@rollup/rollup-darwin-x64@4.19.1': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.18.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.18.1': + '@rollup/rollup-linux-arm-gnueabihf@4.19.1': optional: true '@rollup/rollup-linux-arm-musleabihf@4.18.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.18.1': + '@rollup/rollup-linux-arm-musleabihf@4.19.1': optional: true '@rollup/rollup-linux-arm64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.18.1': + '@rollup/rollup-linux-arm64-gnu@4.19.1': optional: true '@rollup/rollup-linux-arm64-musl@4.18.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.18.1': + '@rollup/rollup-linux-arm64-musl@4.19.1': optional: true '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.18.1': + '@rollup/rollup-linux-powerpc64le-gnu@4.19.1': optional: true '@rollup/rollup-linux-riscv64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.18.1': + '@rollup/rollup-linux-riscv64-gnu@4.19.1': optional: true '@rollup/rollup-linux-s390x-gnu@4.18.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.18.1': + '@rollup/rollup-linux-s390x-gnu@4.19.1': optional: true '@rollup/rollup-linux-x64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.18.1': + '@rollup/rollup-linux-x64-gnu@4.19.1': optional: true '@rollup/rollup-linux-x64-musl@4.18.0': optional: true - '@rollup/rollup-linux-x64-musl@4.18.1': + '@rollup/rollup-linux-x64-musl@4.19.1': optional: true '@rollup/rollup-win32-arm64-msvc@4.18.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.18.1': + '@rollup/rollup-win32-arm64-msvc@4.19.1': optional: true '@rollup/rollup-win32-ia32-msvc@4.18.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.18.1': + '@rollup/rollup-win32-ia32-msvc@4.19.1': optional: true '@rollup/rollup-win32-x64-msvc@4.18.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.18.1': + '@rollup/rollup-win32-x64-msvc@4.19.1': optional: true '@sinclair/typebox@0.27.8': {} - '@swc/core-darwin-arm64@1.6.13': + '@swc/core-darwin-arm64@1.7.3': optional: true - '@swc/core-darwin-x64@1.6.13': + '@swc/core-darwin-x64@1.7.3': optional: true - '@swc/core-linux-arm-gnueabihf@1.6.13': + '@swc/core-linux-arm-gnueabihf@1.7.3': optional: true - '@swc/core-linux-arm64-gnu@1.6.13': + '@swc/core-linux-arm64-gnu@1.7.3': optional: true - '@swc/core-linux-arm64-musl@1.6.13': + '@swc/core-linux-arm64-musl@1.7.3': optional: true - '@swc/core-linux-x64-gnu@1.6.13': + '@swc/core-linux-x64-gnu@1.7.3': optional: true - '@swc/core-linux-x64-musl@1.6.13': + '@swc/core-linux-x64-musl@1.7.3': optional: true - '@swc/core-win32-arm64-msvc@1.6.13': + '@swc/core-win32-arm64-msvc@1.7.3': optional: true - '@swc/core-win32-ia32-msvc@1.6.13': + '@swc/core-win32-ia32-msvc@1.7.3': optional: true - '@swc/core-win32-x64-msvc@1.6.13': + '@swc/core-win32-x64-msvc@1.7.3': optional: true - '@swc/core@1.6.13': + '@swc/core@1.7.3': dependencies: '@swc/counter': 0.1.3 - '@swc/types': 0.1.9 + '@swc/types': 0.1.12 optionalDependencies: - '@swc/core-darwin-arm64': 1.6.13 - '@swc/core-darwin-x64': 1.6.13 - '@swc/core-linux-arm-gnueabihf': 1.6.13 - '@swc/core-linux-arm64-gnu': 1.6.13 - '@swc/core-linux-arm64-musl': 1.6.13 - '@swc/core-linux-x64-gnu': 1.6.13 - '@swc/core-linux-x64-musl': 1.6.13 - '@swc/core-win32-arm64-msvc': 1.6.13 - '@swc/core-win32-ia32-msvc': 1.6.13 - '@swc/core-win32-x64-msvc': 1.6.13 + '@swc/core-darwin-arm64': 1.7.3 + '@swc/core-darwin-x64': 1.7.3 + '@swc/core-linux-arm-gnueabihf': 1.7.3 + '@swc/core-linux-arm64-gnu': 1.7.3 + '@swc/core-linux-arm64-musl': 1.7.3 + '@swc/core-linux-x64-gnu': 1.7.3 + '@swc/core-linux-x64-musl': 1.7.3 + '@swc/core-win32-arm64-msvc': 1.7.3 + '@swc/core-win32-ia32-msvc': 1.7.3 + '@swc/core-win32-x64-msvc': 1.7.3 '@swc/counter@0.1.3': {} - '@swc/types@0.1.9': + '@swc/types@0.1.12': dependencies: '@swc/counter': 0.1.3 @@ -4286,7 +4286,7 @@ snapshots: '@typescript-eslint/types': 7.15.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.0.5(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': + '@vitejs/plugin-vue@5.1.1(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': dependencies: vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) vue: link:packages/vue @@ -6167,29 +6167,29 @@ snapshots: dependencies: glob: 10.4.3 - rollup-plugin-dts@6.1.1(rollup@4.18.1)(typescript@5.4.5): + rollup-plugin-dts@6.1.1(rollup@4.19.1)(typescript@5.4.5): dependencies: magic-string: 0.30.10 - rollup: 4.18.1 + rollup: 4.19.1 typescript: 5.4.5 optionalDependencies: '@babel/code-frame': 7.24.7 - rollup-plugin-esbuild@6.1.1(esbuild@0.23.0)(rollup@4.18.1): + rollup-plugin-esbuild@6.1.1(esbuild@0.23.0)(rollup@4.19.1): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.18.1) + '@rollup/pluginutils': 5.1.0(rollup@4.19.1) debug: 4.3.5 es-module-lexer: 1.5.4 esbuild: 0.23.0 get-tsconfig: 4.7.5 - rollup: 4.18.1 + rollup: 4.19.1 transitivePeerDependencies: - supports-color - rollup-plugin-polyfill-node@0.13.0(rollup@4.18.1): + rollup-plugin-polyfill-node@0.13.0(rollup@4.19.1): dependencies: - '@rollup/plugin-inject': 5.0.5(rollup@4.18.1) - rollup: 4.18.1 + '@rollup/plugin-inject': 5.0.5(rollup@4.19.1) + rollup: 4.19.1 rollup@4.18.0: dependencies: @@ -6213,26 +6213,26 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.18.0 fsevents: 2.3.3 - rollup@4.18.1: + rollup@4.19.1: dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.18.1 - '@rollup/rollup-android-arm64': 4.18.1 - '@rollup/rollup-darwin-arm64': 4.18.1 - '@rollup/rollup-darwin-x64': 4.18.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.18.1 - '@rollup/rollup-linux-arm-musleabihf': 4.18.1 - '@rollup/rollup-linux-arm64-gnu': 4.18.1 - '@rollup/rollup-linux-arm64-musl': 4.18.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.18.1 - '@rollup/rollup-linux-riscv64-gnu': 4.18.1 - '@rollup/rollup-linux-s390x-gnu': 4.18.1 - '@rollup/rollup-linux-x64-gnu': 4.18.1 - '@rollup/rollup-linux-x64-musl': 4.18.1 - '@rollup/rollup-win32-arm64-msvc': 4.18.1 - '@rollup/rollup-win32-ia32-msvc': 4.18.1 - '@rollup/rollup-win32-x64-msvc': 4.18.1 + '@rollup/rollup-android-arm-eabi': 4.19.1 + '@rollup/rollup-android-arm64': 4.19.1 + '@rollup/rollup-darwin-arm64': 4.19.1 + '@rollup/rollup-darwin-x64': 4.19.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.19.1 + '@rollup/rollup-linux-arm-musleabihf': 4.19.1 + '@rollup/rollup-linux-arm64-gnu': 4.19.1 + '@rollup/rollup-linux-arm64-musl': 4.19.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.19.1 + '@rollup/rollup-linux-riscv64-gnu': 4.19.1 + '@rollup/rollup-linux-s390x-gnu': 4.19.1 + '@rollup/rollup-linux-x64-gnu': 4.19.1 + '@rollup/rollup-linux-x64-musl': 4.19.1 + '@rollup/rollup-win32-arm64-msvc': 4.19.1 + '@rollup/rollup-win32-ia32-msvc': 4.19.1 + '@rollup/rollup-win32-x64-msvc': 4.19.1 fsevents: 2.3.3 rrweb-cssom@0.6.0: {} From c803e6a107d1bc9a762780d340920e6073e77caf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:26:54 +0800 Subject: [PATCH 51/61] chore(deps): update lint (#11448) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 6 +- pnpm-lock.yaml | 201 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 136 insertions(+), 71 deletions(-) diff --git a/package.json b/package.json index 60a1025c6eb..3a32930e205 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "enquirer": "^2.4.1", "esbuild": "^0.23.0", "esbuild-plugin-polyfill-node": "^0.3.0", - "eslint": "^9.6.0", + "eslint": "^9.8.0", "eslint-plugin-import-x": "^0.5.3", "eslint-plugin-vitest": "^0.5.4", "estree-walker": "catalog:", @@ -88,7 +88,7 @@ "marked": "^12.0.2", "npm-run-all2": "^6.2.2", "picocolors": "^1.0.1", - "prettier": "^3.3.2", + "prettier": "^3.3.3", "pretty-bytes": "^6.1.1", "pug": "^3.0.3", "puppeteer": "~22.14.0", @@ -104,7 +104,7 @@ "tslib": "^2.6.3", "tsx": "^4.16.2", "typescript": "~5.4.5", - "typescript-eslint": "^7.15.0", + "typescript-eslint": "^7.17.0", "vite": "catalog:", "vitest": "^1.6.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5fbcbbe325d..ad4e1aaec12 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,14 +81,14 @@ importers: specifier: ^0.3.0 version: 0.3.0(esbuild@0.23.0) eslint: - specifier: ^9.6.0 - version: 9.6.0 + specifier: ^9.8.0 + version: 9.8.0 eslint-plugin-import-x: specifier: ^0.5.3 - version: 0.5.3(eslint@9.6.0)(typescript@5.4.5) + version: 0.5.3(eslint@9.8.0)(typescript@5.4.5) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)) + version: 0.5.4(eslint@9.8.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)) estree-walker: specifier: 'catalog:' version: 2.0.2 @@ -117,8 +117,8 @@ importers: specifier: ^1.0.1 version: 1.0.1 prettier: - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^3.3.3 + version: 3.3.3 pretty-bytes: specifier: ^6.1.1 version: 6.1.1 @@ -165,8 +165,8 @@ importers: specifier: ~5.4.5 version: 5.4.5 typescript-eslint: - specifier: ^7.15.0 - version: 7.15.0(eslint@9.6.0)(typescript@5.4.5) + specifier: ^7.17.0 + version: 7.17.0(eslint@9.8.0)(typescript@5.4.5) vite: specifier: 'catalog:' version: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) @@ -801,16 +801,16 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.17.0': - resolution: {integrity: sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==} + '@eslint/config-array@0.17.1': + resolution: {integrity: sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==} 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.6.0': - resolution: {integrity: sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==} + '@eslint/js@9.8.0': + resolution: {integrity: sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': @@ -1211,8 +1211,8 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@7.15.0': - resolution: {integrity: sha512-uiNHpyjZtFrLwLDpHnzaDlP3Tt6sGMqTCiqmxaN4n4RP0EfYZDODJyddiFDF44Hjwxr5xAcaYxVKm9QKQFJFLA==} + '@typescript-eslint/eslint-plugin@7.17.0': + resolution: {integrity: sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1222,8 +1222,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.15.0': - resolution: {integrity: sha512-k9fYuQNnypLFcqORNClRykkGOMOj+pV6V91R4GO/l1FDGwpqmSwoOQrOHo3cGaH63e+D3ZiCAOsuS/D2c99j/A==} + '@typescript-eslint/parser@7.17.0': + resolution: {integrity: sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1236,8 +1236,12 @@ packages: resolution: {integrity: sha512-Q/1yrF/XbxOTvttNVPihxh1b9fxamjEoz2Os/Pe38OHwxC24CyCqXxGTOdpb4lt6HYtqw9HetA/Rf6gDGaMPlw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.15.0': - resolution: {integrity: sha512-SkgriaeV6PDvpA6253PDVep0qCqgbO1IOBiycjnXsszNTVQe5flN5wR5jiczoEoDEnAqYFSFFc9al9BSGVltkg==} + '@typescript-eslint/scope-manager@7.17.0': + resolution: {integrity: sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==} + engines: {node: ^18.18.0 || >=20.0.0} + + '@typescript-eslint/type-utils@7.17.0': + resolution: {integrity: sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1250,6 +1254,10 @@ packages: resolution: {integrity: sha512-aV1+B1+ySXbQH0pLK0rx66I3IkiZNidYobyfn0WFsdGhSXw+P3YOqeTq5GED458SfB24tg+ux3S+9g118hjlTw==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@7.17.0': + resolution: {integrity: sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/typescript-estree@7.15.0': resolution: {integrity: sha512-gjyB/rHAopL/XxfmYThQbXbzRMGhZzGw6KpcMbfe8Q3nNQKStpxnUKeXb0KiN/fFDR42Z43szs6rY7eHk0zdGQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1259,16 +1267,35 @@ packages: typescript: optional: true + '@typescript-eslint/typescript-estree@7.17.0': + resolution: {integrity: sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/utils@7.15.0': resolution: {integrity: sha512-hfDMDqaqOqsUVGiEPSMLR/AjTSCsmJwjpKkYQRo1FNbmW4tBwBspYDwO9eh7sKSTwMQgBw9/T4DHudPaqshRWA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 + '@typescript-eslint/utils@7.17.0': + resolution: {integrity: sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + '@typescript-eslint/visitor-keys@7.15.0': resolution: {integrity: sha512-Hqgy/ETgpt2L5xueA/zHHIl4fJI2O4XUE9l4+OIfbJIRSnTJb/QscncdqqZzofQegIJugRIF57OJea1khw2SDw==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@7.17.0': + resolution: {integrity: sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==} + engines: {node: ^18.18.0 || >=20.0.0} + '@vitejs/plugin-vue@5.1.1': resolution: {integrity: sha512-sDckXxlHpMsjRQbAH9WanangrfrblsOd3pNifePs+FOHjJg1jfWq5L/P0PsBRndEt3nmdUnmvieP8ULDeX5AvA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1906,8 +1933,8 @@ packages: vitest: optional: true - eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + eslint-scope@8.0.2: + resolution: {integrity: sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: @@ -1918,8 +1945,8 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.6.0: - resolution: {integrity: sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==} + eslint@9.8.0: + resolution: {integrity: sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true @@ -2834,8 +2861,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.3.2: - resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} + prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} hasBin: true @@ -3349,8 +3376,8 @@ packages: resolution: {integrity: sha512-ADn2w7hVPcK6w1I0uWnM//y1rLXZhzB9mr0a3OirzclKF1Wp6VzevUmzz/NRAWunOT6E8HrnpGY7xOfc6K57fA==} engines: {node: '>=16'} - typescript-eslint@7.15.0: - resolution: {integrity: sha512-Ta40FhMXBCwHura4X4fncaCVkVcnJ9jnOq5+Lp4lN8F4DzHZtOwZdRvVBiNUGznUDHPwdGnrnwxmUOU2fFQqFA==} + typescript-eslint@7.17.0: + resolution: {integrity: sha512-spQxsQvPguduCUfyUvLItvKqK3l8KJ/kqs5Pb/URtzQ5AC53Z6us32St37rpmlt2uESG23lOFpV4UErrmy4dZQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -3870,14 +3897,14 @@ snapshots: '@esbuild/win32-x64@0.23.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.6.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.8.0)': dependencies: - eslint: 9.6.0 + eslint: 9.8.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} - '@eslint/config-array@0.17.0': + '@eslint/config-array@0.17.1': dependencies: '@eslint/object-schema': 2.1.4 debug: 4.3.5 @@ -3899,7 +3926,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.6.0': {} + '@eslint/js@9.8.0': {} '@eslint/object-schema@2.1.4': {} @@ -4205,15 +4232,15 @@ snapshots: '@types/node': 20.14.13 optional: true - '@typescript-eslint/eslint-plugin@7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.4.5))(eslint@9.6.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.17.0(@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.4.5))(eslint@9.8.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.15.0 - '@typescript-eslint/type-utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.15.0 - eslint: 9.6.0 + '@typescript-eslint/parser': 7.17.0(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/type-utils': 7.17.0(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.17.0 + eslint: 9.8.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -4223,14 +4250,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/scope-manager': 7.15.0 - '@typescript-eslint/types': 7.15.0 - '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.15.0 + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.17.0 debug: 4.3.5 - eslint: 9.6.0 + eslint: 9.8.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -4241,12 +4268,17 @@ snapshots: '@typescript-eslint/types': 7.15.0 '@typescript-eslint/visitor-keys': 7.15.0 - '@typescript-eslint/type-utils@7.15.0(eslint@9.6.0)(typescript@5.4.5)': + '@typescript-eslint/scope-manager@7.17.0': dependencies: - '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + + '@typescript-eslint/type-utils@7.17.0(eslint@9.8.0)(typescript@5.4.5)': + dependencies: + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.4.5) debug: 4.3.5 - eslint: 9.6.0 + eslint: 9.8.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 @@ -4255,6 +4287,8 @@ snapshots: '@typescript-eslint/types@7.15.0': {} + '@typescript-eslint/types@7.17.0': {} + '@typescript-eslint/typescript-estree@7.15.0(typescript@5.4.5)': dependencies: '@typescript-eslint/types': 7.15.0 @@ -4270,13 +4304,39 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.15.0(eslint@9.6.0)(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.17.0(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/visitor-keys': 7.17.0 + debug: 4.3.5 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + optionalDependencies: + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@7.15.0(eslint@9.8.0)(typescript@5.4.5)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) '@typescript-eslint/scope-manager': 7.15.0 '@typescript-eslint/types': 7.15.0 '@typescript-eslint/typescript-estree': 7.15.0(typescript@5.4.5) - eslint: 9.6.0 + eslint: 9.8.0 + transitivePeerDependencies: + - supports-color + - typescript + + '@typescript-eslint/utils@7.17.0(eslint@9.8.0)(typescript@5.4.5)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) + '@typescript-eslint/scope-manager': 7.17.0 + '@typescript-eslint/types': 7.17.0 + '@typescript-eslint/typescript-estree': 7.17.0(typescript@5.4.5) + eslint: 9.8.0 transitivePeerDependencies: - supports-color - typescript @@ -4286,6 +4346,11 @@ snapshots: '@typescript-eslint/types': 7.15.0 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@7.17.0': + dependencies: + '@typescript-eslint/types': 7.17.0 + eslint-visitor-keys: 3.4.3 + '@vitejs/plugin-vue@5.1.1(vite@5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1))(vue@packages+vue)': dependencies: vite: 5.3.3(@types/node@20.14.13)(sass@1.77.8)(terser@5.31.1) @@ -4956,12 +5021,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import-x@0.5.3(eslint@9.6.0)(typescript@5.4.5): + eslint-plugin-import-x@0.5.3(eslint@9.8.0)(typescript@5.4.5): dependencies: - '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.15.0(eslint@9.8.0)(typescript@5.4.5) debug: 4.3.5 doctrine: 3.0.0 - eslint: 9.6.0 + eslint: 9.8.0 eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.5 is-glob: 4.0.3 @@ -4973,17 +5038,17 @@ snapshots: - supports-color - typescript - eslint-plugin-vitest@0.5.4(eslint@9.6.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)): + eslint-plugin-vitest@0.5.4(eslint@9.8.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)): dependencies: - '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - eslint: 9.6.0 + '@typescript-eslint/utils': 7.15.0(eslint@9.8.0)(typescript@5.4.5) + eslint: 9.8.0 optionalDependencies: vitest: 1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1) transitivePeerDependencies: - supports-color - typescript - eslint-scope@8.0.1: + eslint-scope@8.0.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -4992,13 +5057,13 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.6.0: + eslint@9.8.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.8.0) '@eslint-community/regexpp': 4.11.0 - '@eslint/config-array': 0.17.0 + '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.6.0 + '@eslint/js': 9.8.0 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 @@ -5007,7 +5072,7 @@ snapshots: cross-spawn: 7.0.3 debug: 4.3.5 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 + eslint-scope: 8.0.2 eslint-visitor-keys: 4.0.0 espree: 10.1.0 esquery: 1.5.0 @@ -5945,7 +6010,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.3.2: {} + prettier@3.3.3: {} pretty-bytes@6.1.1: {} @@ -6542,12 +6607,12 @@ snapshots: type-fest@4.21.0: {} - typescript-eslint@7.15.0(eslint@9.6.0)(typescript@5.4.5): + typescript-eslint@7.17.0(eslint@9.8.0)(typescript@5.4.5): dependencies: - '@typescript-eslint/eslint-plugin': 7.15.0(@typescript-eslint/parser@7.15.0(eslint@9.6.0)(typescript@5.4.5))(eslint@9.6.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.15.0(eslint@9.6.0)(typescript@5.4.5) - eslint: 9.6.0 + '@typescript-eslint/eslint-plugin': 7.17.0(@typescript-eslint/parser@7.17.0(eslint@9.8.0)(typescript@5.4.5))(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.17.0(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.4.5) + eslint: 9.8.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: From 8e052eecf3258a12af6ef6f54d2b94714f44782d Mon Sep 17 00:00:00 2001 From: wzc520pyfm <1528857653@qq.com> Date: Mon, 29 Jul 2024 09:43:25 +0800 Subject: [PATCH 52/61] chore(sfc-playgroud): highlight the commit and latest version when active in dropdown (#11445) --- packages/sfc-playground/src/Header.vue | 2 +- packages/sfc-playground/src/VersionSelect.vue | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/sfc-playground/src/Header.vue b/packages/sfc-playground/src/Header.vue index 6506ad7bab2..8e810d89441 100644 --- a/packages/sfc-playground/src/Header.vue +++ b/packages/sfc-playground/src/Header.vue @@ -80,7 +80,7 @@ function toggleDark() { pkg="vue" label="Vue Version" > -
  • +
  • This Commit ({{ currentCommit }})
  • diff --git a/packages/sfc-playground/src/VersionSelect.vue b/packages/sfc-playground/src/VersionSelect.vue index 50c3c59ac24..bd24ac21a9e 100644 --- a/packages/sfc-playground/src/VersionSelect.vue +++ b/packages/sfc-playground/src/VersionSelect.vue @@ -74,7 +74,12 @@ onMounted(() => {
    • loading versions...
    • -
    • +
    • v{{ ver }}
    • From e0b2975ef65ae6a0be0aa0a0df43fb887c665251 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 29 Jul 2024 10:52:38 +0800 Subject: [PATCH 53/61] fix(types/ref): allow getter and setter types to be unrelated (#11442) --- packages/dts-test/ref.test-d.ts | 10 ++++++++++ packages/dts-test/watch.test-d.ts | 8 ++++++++ packages/reactivity/src/ref.ts | 7 ++++--- packages/runtime-core/src/apiWatch.ts | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/dts-test/ref.test-d.ts b/packages/dts-test/ref.test-d.ts index 1456c523239..46d39214b93 100644 --- a/packages/dts-test/ref.test-d.ts +++ b/packages/dts-test/ref.test-d.ts @@ -172,6 +172,16 @@ describe('ref with generic', () => { expectType(ss.value.name) }) +describe('allow getter and setter types to be unrelated', () => { + const a = { b: ref(0) } + const c = ref(a) + c.value = a + + const d = {} as T + const e = ref(d) + e.value = d +}) + // shallowRef type Status = 'initial' | 'ready' | 'invalidating' const shallowStatus = shallowRef('initial') diff --git a/packages/dts-test/watch.test-d.ts b/packages/dts-test/watch.test-d.ts index 45c898ef672..6c8576f0c6b 100644 --- a/packages/dts-test/watch.test-d.ts +++ b/packages/dts-test/watch.test-d.ts @@ -1,5 +1,6 @@ import { type ComputedRef, + type MaybeRef, type Ref, computed, defineComponent, @@ -203,3 +204,10 @@ defineComponent({ expectType<{ foo: string }>(value) }) } + +{ + const css: MaybeRef = '' + watch(ref(css), value => { + expectType(value) + }) +} diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 3e9b05062f3..6e22d1bcd58 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -30,8 +30,9 @@ import { warn } from './warning' declare const RefSymbol: unique symbol export declare const RawSymbol: unique symbol -export interface Ref { - value: T +export interface Ref { + get value(): T + set value(_: S) /** * Type differentiator only. * We need this to be in public d.ts but don't want it to show up in IDE @@ -108,7 +109,7 @@ export function isRef(r: any): r is Ref { * @param value - The object to wrap in the ref. * @see {@link https://vuejs.org/api/reactivity-core.html#ref} */ -export function ref(value: T): Ref> +export function ref(value: T): Ref, UnwrapRef | T> export function ref(): Ref export function ref(value?: unknown) { return createRef(value, false) diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index cdf8b8c888f..8b570bc28fa 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -46,7 +46,7 @@ import { useSSRContext } from './helpers/useSsrContext' export type WatchEffect = (onCleanup: OnCleanup) => void -export type WatchSource = Ref | ComputedRef | (() => T) +export type WatchSource = Ref | ComputedRef | (() => T) export type WatchCallback = ( value: V, From 5bca503d1ee9842819bf8033492849976e4d2c1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:17:45 +0800 Subject: [PATCH 54/61] chore(deps): update dependency eslint-plugin-import-x to v3 (#11450) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3a32930e205..64fc33e7f56 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "esbuild": "^0.23.0", "esbuild-plugin-polyfill-node": "^0.3.0", "eslint": "^9.8.0", - "eslint-plugin-import-x": "^0.5.3", + "eslint-plugin-import-x": "^3.1.0", "eslint-plugin-vitest": "^0.5.4", "estree-walker": "catalog:", "jsdom": "^24.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad4e1aaec12..f4909b410a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,8 +84,8 @@ importers: specifier: ^9.8.0 version: 9.8.0 eslint-plugin-import-x: - specifier: ^0.5.3 - version: 0.5.3(eslint@9.8.0)(typescript@5.4.5) + specifier: ^3.1.0 + version: 3.1.0(eslint@9.8.0)(typescript@5.4.5) eslint-plugin-vitest: specifier: ^0.5.4 version: 0.5.4(eslint@9.8.0)(typescript@5.4.5)(vitest@1.6.0(@types/node@20.14.13)(jsdom@24.1.1)(sass@1.77.8)(terser@5.31.1)) @@ -1914,8 +1914,8 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-plugin-import-x@0.5.3: - resolution: {integrity: sha512-hJ/wkMcsLQXAZL3+txXIDpbW5cqwdm1rLTqV4VRY03aIbzE3zWE7rPZKW6Gzf7xyl1u3V1iYC6tOG77d9NF4GQ==} + eslint-plugin-import-x@3.1.0: + resolution: {integrity: sha512-/UbPA+bYY7nIxcjL3kpcDY3UNdoLHFhyBFzHox2M0ypcUoueTn6woZUUmzzi5et/dXChksasYYFeKE2wshOrhg==} engines: {node: '>=16'} peerDependencies: eslint: ^8.56.0 || ^9.0.0-0 @@ -5021,9 +5021,9 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import-x@0.5.3(eslint@9.8.0)(typescript@5.4.5): + eslint-plugin-import-x@3.1.0(eslint@9.8.0)(typescript@5.4.5): dependencies: - '@typescript-eslint/utils': 7.15.0(eslint@9.8.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.17.0(eslint@9.8.0)(typescript@5.4.5) debug: 4.3.5 doctrine: 3.0.0 eslint: 9.8.0 From 208f5c04e7fb066ac23e2dc2c5c0b7043fcb4464 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:18:02 +0800 Subject: [PATCH 55/61] chore(deps): update dependency conventional-changelog-cli to v5 (#11449) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 401 +++++++++++++++++++++---------------------------- 2 files changed, 175 insertions(+), 228 deletions(-) diff --git a/package.json b/package.json index 64fc33e7f56..80e74ed2089 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@types/semver": "^7.5.8", "@vitest/coverage-istanbul": "^1.6.0", "@vue/consolidate": "1.0.0", - "conventional-changelog-cli": "^4.1.0", + "conventional-changelog-cli": "^5.0.0", "enquirer": "^2.4.1", "esbuild": "^0.23.0", "esbuild-plugin-polyfill-node": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4909b410a1..4b23377766c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: 1.0.0 version: 1.0.0 conventional-changelog-cli: - specifier: ^4.1.0 - version: 4.1.0 + specifier: ^5.0.0 + version: 5.0.0(conventional-commits-filter@5.0.0) enquirer: specifier: ^2.4.1 version: 2.4.1 @@ -509,6 +509,18 @@ packages: resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} engines: {node: '>=6.9.0'} + '@conventional-changelog/git-client@1.0.1': + resolution: {integrity: sha512-PJEqBwAleffCMETaVm/fUgHldzBE35JFk3/9LL6NUA5EXa3qednu+UT6M7E5iBu3zIQZCULYIiZ90fBYHt6xUw==} + engines: {node: '>=18'} + peerDependencies: + conventional-commits-filter: ^5.0.0 + conventional-commits-parser: ^6.0.0 + peerDependenciesMeta: + conventional-commits-filter: + optional: true + conventional-commits-parser: + optional: true + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -1333,10 +1345,6 @@ packages: '@zeit/schemas@2.36.0': resolution: {integrity: sha512-7kjMwcChYEzMKjeex9ZFXkt1AyNov9R5HZtjBKVsmVpw7pa7ZtlCGvCBC2vnnXctaYN+aRI61HjIqeetZW5ROg==} - JSONStream@1.3.5: - resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} - hasBin: true - accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -1648,71 +1656,71 @@ packages: resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==} engines: {node: '>= 0.6'} - conventional-changelog-angular@7.0.0: - resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==} - engines: {node: '>=16'} + conventional-changelog-angular@8.0.0: + resolution: {integrity: sha512-CLf+zr6St0wIxos4bmaKHRXWAcsCXrJU6F4VdNDrGRK3B8LDLKoX3zuMV5GhtbGkVR/LohZ6MT6im43vZLSjmA==} + engines: {node: '>=18'} - conventional-changelog-atom@4.0.0: - resolution: {integrity: sha512-q2YtiN7rnT1TGwPTwjjBSIPIzDJCRE+XAUahWxnh+buKK99Kks4WLMHoexw38GXx9OUxAsrp44f9qXe5VEMYhw==} - engines: {node: '>=16'} + conventional-changelog-atom@5.0.0: + resolution: {integrity: sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g==} + engines: {node: '>=18'} - conventional-changelog-cli@4.1.0: - resolution: {integrity: sha512-MscvILWZ6nWOoC+p/3Nn3D2cVLkjeQjyZPUr0bQ+vUORE/SPrkClJh8BOoMNpS4yk+zFJ5LlgXACxH6XGQoRXA==} - engines: {node: '>=16'} + conventional-changelog-cli@5.0.0: + resolution: {integrity: sha512-9Y8fucJe18/6ef6ZlyIlT2YQUbczvoQZZuYmDLaGvcSBP+M6h+LAvf7ON7waRxKJemcCII8Yqu5/8HEfskTxJQ==} + engines: {node: '>=18'} hasBin: true - conventional-changelog-codemirror@4.0.0: - resolution: {integrity: sha512-hQSojc/5imn1GJK3A75m9hEZZhc3urojA5gMpnar4JHmgLnuM3CUIARPpEk86glEKr3c54Po3WV/vCaO/U8g3Q==} - engines: {node: '>=16'} + conventional-changelog-codemirror@5.0.0: + resolution: {integrity: sha512-8gsBDI5Y3vrKUCxN6Ue8xr6occZ5nsDEc4C7jO/EovFGozx8uttCAyfhRrvoUAWi2WMm3OmYs+0mPJU7kQdYWQ==} + engines: {node: '>=18'} - conventional-changelog-conventionalcommits@7.0.2: - resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} - engines: {node: '>=16'} + conventional-changelog-conventionalcommits@8.0.0: + resolution: {integrity: sha512-eOvlTO6OcySPyyyk8pKz2dP4jjElYunj9hn9/s0OB+gapTO8zwS9UQWrZ1pmF2hFs3vw1xhonOLGcGjy/zgsuA==} + engines: {node: '>=18'} - conventional-changelog-core@7.0.0: - resolution: {integrity: sha512-UYgaB1F/COt7VFjlYKVE/9tTzfU3VUq47r6iWf6lM5T7TlOxr0thI63ojQueRLIpVbrtHK4Ffw+yQGduw2Bhdg==} - engines: {node: '>=16'} + conventional-changelog-core@8.0.0: + resolution: {integrity: sha512-EATUx5y9xewpEe10UEGNpbSHRC6cVZgO+hXQjofMqpy+gFIrcGvH3Fl6yk2VFKh7m+ffenup2N7SZJYpyD9evw==} + engines: {node: '>=18'} - conventional-changelog-ember@4.0.0: - resolution: {integrity: sha512-D0IMhwcJUg1Y8FSry6XAplEJcljkHVlvAZddhhsdbL1rbsqRsMfGx/PIkPYq0ru5aDgn+OxhQ5N5yR7P9mfsvA==} - engines: {node: '>=16'} + conventional-changelog-ember@5.0.0: + resolution: {integrity: sha512-RPflVfm5s4cSO33GH/Ey26oxhiC67akcxSKL8CLRT3kQX2W3dbE19sSOM56iFqUJYEwv9mD9r6k79weWe1urfg==} + engines: {node: '>=18'} - conventional-changelog-eslint@5.0.0: - resolution: {integrity: sha512-6JtLWqAQIeJLn/OzUlYmzd9fKeNSWmQVim9kql+v4GrZwLx807kAJl3IJVc3jTYfVKWLxhC3BGUxYiuVEcVjgA==} - engines: {node: '>=16'} + conventional-changelog-eslint@6.0.0: + resolution: {integrity: sha512-eiUyULWjzq+ybPjXwU6NNRflApDWlPEQEHvI8UAItYW/h22RKkMnOAtfCZxMmrcMO1OKUWtcf2MxKYMWe9zJuw==} + engines: {node: '>=18'} - conventional-changelog-express@4.0.0: - resolution: {integrity: sha512-yWyy5c7raP9v7aTvPAWzqrztACNO9+FEI1FSYh7UP7YT1AkWgv5UspUeB5v3Ibv4/o60zj2o9GF2tqKQ99lIsw==} - engines: {node: '>=16'} + conventional-changelog-express@5.0.0: + resolution: {integrity: sha512-D8Q6WctPkQpvr2HNCCmwU5GkX22BVHM0r4EW8vN0230TSyS/d6VQJDAxGb84lbg0dFjpO22MwmsikKL++Oo/oQ==} + engines: {node: '>=18'} - conventional-changelog-jquery@5.0.0: - resolution: {integrity: sha512-slLjlXLRNa/icMI3+uGLQbtrgEny3RgITeCxevJB+p05ExiTgHACP5p3XiMKzjBn80n+Rzr83XMYfRInEtCPPw==} - engines: {node: '>=16'} + conventional-changelog-jquery@6.0.0: + resolution: {integrity: sha512-2kxmVakyehgyrho2ZHBi90v4AHswkGzHuTaoH40bmeNqUt20yEkDOSpw8HlPBfvEQBwGtbE+5HpRwzj6ac2UfA==} + engines: {node: '>=18'} - conventional-changelog-jshint@4.0.0: - resolution: {integrity: sha512-LyXq1bbl0yG0Ai1SbLxIk8ZxUOe3AjnlwE6sVRQmMgetBk+4gY9EO3d00zlEt8Y8gwsITytDnPORl8al7InTjg==} - engines: {node: '>=16'} + conventional-changelog-jshint@5.0.0: + resolution: {integrity: sha512-gGNphSb/opc76n2eWaO6ma4/Wqu3tpa2w7i9WYqI6Cs2fncDSI2/ihOfMvXveeTTeld0oFvwMVNV+IYQIk3F3g==} + engines: {node: '>=18'} - conventional-changelog-preset-loader@4.1.0: - resolution: {integrity: sha512-HozQjJicZTuRhCRTq4rZbefaiCzRM2pr6u2NL3XhrmQm4RMnDXfESU6JKu/pnKwx5xtdkYfNCsbhN5exhiKGJA==} - engines: {node: '>=16'} + conventional-changelog-preset-loader@5.0.0: + resolution: {integrity: sha512-SetDSntXLk8Jh1NOAl1Gu5uLiCNSYenB5tm0YVeZKePRIgDW9lQImromTwLa3c/Gae298tsgOM+/CYT9XAl0NA==} + engines: {node: '>=18'} - conventional-changelog-writer@7.0.1: - resolution: {integrity: sha512-Uo+R9neH3r/foIvQ0MKcsXkX642hdm9odUp7TqgFS7BsalTcjzRlIfWZrZR1gbxOozKucaKt5KAbjW8J8xRSmA==} - engines: {node: '>=16'} + conventional-changelog-writer@8.0.0: + resolution: {integrity: sha512-TQcoYGRatlAnT2qEWDON/XSfnVG38JzA7E0wcGScu7RElQBkg9WWgZd1peCWFcWDh1xfb2CfsrcvOn1bbSzztA==} + engines: {node: '>=18'} hasBin: true - conventional-changelog@5.1.0: - resolution: {integrity: sha512-aWyE/P39wGYRPllcCEZDxTVEmhyLzTc9XA6z6rVfkuCD2UBnhV/sgSOKbQrEG5z9mEZJjnopjgQooTKxEg8mAg==} - engines: {node: '>=16'} + conventional-changelog@6.0.0: + resolution: {integrity: sha512-tuUH8H/19VjtD9Ig7l6TQRh+Z0Yt0NZ6w/cCkkyzUbGQTnUEmKfGtkC9gGfVgCfOL1Rzno5NgNF4KY8vR+Jo3w==} + engines: {node: '>=18'} - conventional-commits-filter@4.0.0: - resolution: {integrity: sha512-rnpnibcSOdFcdclpFwWa+pPlZJhXE7l+XK04zxhbWrhgpR96h33QLz8hITTXbcYICxVr3HZFtbtUAQ+4LdBo9A==} - engines: {node: '>=16'} + conventional-commits-filter@5.0.0: + resolution: {integrity: sha512-tQMagCOC59EVgNZcC5zl7XqO30Wki9i9J3acbUvkaosCT6JX3EeFwJD7Qqp4MCikRnzS18WXV3BLIQ66ytu6+Q==} + engines: {node: '>=18'} - conventional-commits-parser@5.0.0: - resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==} - engines: {node: '>=16'} + conventional-commits-parser@6.0.0: + resolution: {integrity: sha512-TbsINLp48XeMXR8EvGjTnKGsZqBemisPoyWESlpRyR8lif0lcwzqz+NMtYSj1ooF/WYjSuu7wX0CtdeeMEQAmA==} + engines: {node: '>=18'} hasBin: true convert-source-map@2.0.0: @@ -1746,10 +1754,6 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - dargs@8.1.0: - resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==} - engines: {node: '>=12'} - data-uri-to-buffer@6.0.2: resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} engines: {node: '>= 14'} @@ -2033,14 +2037,14 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + find-up-simple@1.0.0: + resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} + engines: {node: '>=18'} + find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - find-up@6.3.0: - resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -2112,14 +2116,14 @@ packages: resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==} engines: {node: '>= 14'} - git-raw-commits@4.0.0: - resolution: {integrity: sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==} - engines: {node: '>=16'} + git-raw-commits@5.0.0: + resolution: {integrity: sha512-I2ZXrXeOc0KrCvC7swqtIFXFN+rbjnC7b2T943tvemIOVNl+XP8YnA9UVwqFhzzLClnSA60KR/qEjLpXzs73Qg==} + engines: {node: '>=18'} hasBin: true - git-semver-tags@7.0.1: - resolution: {integrity: sha512-NY0ZHjJzyyNXHTDZmj+GG7PyuAKtMsyWSwh07CR2hOZFa+/yoTsXci/nF2obzL8UDhakFNkD9gNdt/Ed+cxh2Q==} - engines: {node: '>=16'} + git-semver-tags@8.0.0: + resolution: {integrity: sha512-N7YRIklvPH3wYWAR2vysaqGLPRcpwQ0GKdlqTiVN5w1UmCdaeY3K8s6DMKRCh54DDdzyt/OAB6C8jgVtb7Y2Fg==} + engines: {node: '>=18'} hasBin: true glob-parent@5.1.2: @@ -2256,6 +2260,10 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + index-to-position@0.1.2: + resolution: {integrity: sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==} + engines: {node: '>=18'} + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -2353,10 +2361,6 @@ packages: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-text-path@2.0.0: - resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==} - engines: {node: '>=8'} - is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -2440,9 +2444,6 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - json-stringify-safe@5.0.1: - resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} - json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -2451,10 +2452,6 @@ packages: jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - jsonparse@1.3.1: - resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} - jstransformer@1.0.0: resolution: {integrity: sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==} @@ -2478,10 +2475,6 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lines-and-columns@2.0.4: - resolution: {integrity: sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - lint-staged@15.2.7: resolution: {integrity: sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==} engines: {node: '>=18.12.0'} @@ -2503,10 +2496,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - locate-path@7.2.0: - resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} @@ -2560,9 +2549,9 @@ packages: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} - meow@12.1.1: - resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==} - engines: {node: '>=16.10'} + meow@13.2.0: + resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} + engines: {node: '>=18'} merge-source-map@1.1.0: resolution: {integrity: sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==} @@ -2711,10 +2700,6 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - p-limit@5.0.0: resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} engines: {node: '>=18'} @@ -2723,10 +2708,6 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-locate@6.0.0: - resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - pac-proxy-agent@7.0.2: resolution: {integrity: sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==} engines: {node: '>= 14'} @@ -2749,9 +2730,9 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - parse-json@7.1.1: - resolution: {integrity: sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==} - engines: {node: '>=16'} + parse-json@8.1.0: + resolution: {integrity: sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==} + engines: {node: '>=18'} parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} @@ -2760,10 +2741,6 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - path-exists@5.0.0: - resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -2973,13 +2950,13 @@ packages: resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - read-pkg-up@10.1.0: - resolution: {integrity: sha512-aNtBq4jR8NawpKJQldrQcSW9y/d+KWH4v24HWkHljOZ7H0av+YTGANBzRh9A5pw7v/bLVsLVPpOhJ7gHNVy8lA==} - engines: {node: '>=16'} + read-package-up@11.0.0: + resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} + engines: {node: '>=18'} - read-pkg@8.1.0: - resolution: {integrity: sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==} - engines: {node: '>=16'} + read-pkg@9.0.1: + resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} + engines: {node: '>=18'} readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} @@ -3189,10 +3166,6 @@ packages: spdx-license-ids@3.0.18: resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} - split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} - engines: {node: '>= 10.x'} - sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} @@ -3298,10 +3271,6 @@ packages: text-decoder@1.1.1: resolution: {integrity: sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==} - text-extensions@2.4.0: - resolution: {integrity: sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==} - engines: {node: '>=8'} - text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -3368,10 +3337,6 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - type-fest@3.13.1: - resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} - engines: {node: '>=14.16'} - type-fest@4.21.0: resolution: {integrity: sha512-ADn2w7hVPcK6w1I0uWnM//y1rLXZhzB9mr0a3OirzclKF1Wp6VzevUmzz/NRAWunOT6E8HrnpGY7xOfc6K57fA==} engines: {node: '>=16'} @@ -3405,6 +3370,10 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} @@ -3756,6 +3725,14 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@conventional-changelog/git-client@1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)': + dependencies: + '@types/semver': 7.5.8 + semver: 7.6.3 + optionalDependencies: + conventional-commits-filter: 5.0.0 + conventional-commits-parser: 6.0.0 + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -4406,11 +4383,6 @@ snapshots: '@zeit/schemas@2.36.0': {} - JSONStream@1.3.5: - dependencies: - jsonparse: 1.3.1 - through: 2.3.8 - accepts@1.3.8: dependencies: mime-types: 2.1.35 @@ -4735,83 +4707,85 @@ snapshots: content-disposition@0.5.2: {} - conventional-changelog-angular@7.0.0: + conventional-changelog-angular@8.0.0: dependencies: compare-func: 2.0.0 - conventional-changelog-atom@4.0.0: {} + conventional-changelog-atom@5.0.0: {} - conventional-changelog-cli@4.1.0: + conventional-changelog-cli@5.0.0(conventional-commits-filter@5.0.0): dependencies: add-stream: 1.0.0 - conventional-changelog: 5.1.0 - meow: 12.1.1 + conventional-changelog: 6.0.0(conventional-commits-filter@5.0.0) + meow: 13.2.0 tempfile: 5.0.0 + transitivePeerDependencies: + - conventional-commits-filter - conventional-changelog-codemirror@4.0.0: {} + conventional-changelog-codemirror@5.0.0: {} - conventional-changelog-conventionalcommits@7.0.2: + conventional-changelog-conventionalcommits@8.0.0: dependencies: compare-func: 2.0.0 - conventional-changelog-core@7.0.0: + conventional-changelog-core@8.0.0(conventional-commits-filter@5.0.0): dependencies: '@hutson/parse-repository-url': 5.0.0 add-stream: 1.0.0 - conventional-changelog-writer: 7.0.1 - conventional-commits-parser: 5.0.0 - git-raw-commits: 4.0.0 - git-semver-tags: 7.0.1 + conventional-changelog-writer: 8.0.0 + conventional-commits-parser: 6.0.0 + git-raw-commits: 5.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0) + git-semver-tags: 8.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0) hosted-git-info: 7.0.2 normalize-package-data: 6.0.2 - read-pkg: 8.1.0 - read-pkg-up: 10.1.0 + read-package-up: 11.0.0 + read-pkg: 9.0.1 + transitivePeerDependencies: + - conventional-commits-filter - conventional-changelog-ember@4.0.0: {} + conventional-changelog-ember@5.0.0: {} - conventional-changelog-eslint@5.0.0: {} + conventional-changelog-eslint@6.0.0: {} - conventional-changelog-express@4.0.0: {} + conventional-changelog-express@5.0.0: {} - conventional-changelog-jquery@5.0.0: {} + conventional-changelog-jquery@6.0.0: {} - conventional-changelog-jshint@4.0.0: + conventional-changelog-jshint@5.0.0: dependencies: compare-func: 2.0.0 - conventional-changelog-preset-loader@4.1.0: {} + conventional-changelog-preset-loader@5.0.0: {} - conventional-changelog-writer@7.0.1: + conventional-changelog-writer@8.0.0: dependencies: - conventional-commits-filter: 4.0.0 + '@types/semver': 7.5.8 + conventional-commits-filter: 5.0.0 handlebars: 4.7.8 - json-stringify-safe: 5.0.1 - meow: 12.1.1 + meow: 13.2.0 semver: 7.6.3 - split2: 4.2.0 - conventional-changelog@5.1.0: - dependencies: - conventional-changelog-angular: 7.0.0 - conventional-changelog-atom: 4.0.0 - conventional-changelog-codemirror: 4.0.0 - conventional-changelog-conventionalcommits: 7.0.2 - conventional-changelog-core: 7.0.0 - conventional-changelog-ember: 4.0.0 - conventional-changelog-eslint: 5.0.0 - conventional-changelog-express: 4.0.0 - conventional-changelog-jquery: 5.0.0 - conventional-changelog-jshint: 4.0.0 - conventional-changelog-preset-loader: 4.1.0 + conventional-changelog@6.0.0(conventional-commits-filter@5.0.0): + dependencies: + conventional-changelog-angular: 8.0.0 + conventional-changelog-atom: 5.0.0 + conventional-changelog-codemirror: 5.0.0 + conventional-changelog-conventionalcommits: 8.0.0 + conventional-changelog-core: 8.0.0(conventional-commits-filter@5.0.0) + conventional-changelog-ember: 5.0.0 + conventional-changelog-eslint: 6.0.0 + conventional-changelog-express: 5.0.0 + conventional-changelog-jquery: 6.0.0 + conventional-changelog-jshint: 5.0.0 + conventional-changelog-preset-loader: 5.0.0 + transitivePeerDependencies: + - conventional-commits-filter - conventional-commits-filter@4.0.0: {} + conventional-commits-filter@5.0.0: {} - conventional-commits-parser@5.0.0: + conventional-commits-parser@6.0.0: dependencies: - JSONStream: 1.3.5 - is-text-path: 2.0.0 - meow: 12.1.1 - split2: 4.2.0 + meow: 13.2.0 convert-source-map@2.0.0: {} @@ -4840,8 +4814,6 @@ snapshots: csstype@3.1.3: {} - dargs@8.1.0: {} - data-uri-to-buffer@6.0.2: {} data-urls@5.0.0: @@ -5196,16 +5168,13 @@ snapshots: dependencies: to-regex-range: 5.0.1 + find-up-simple@1.0.0: {} + find-up@5.0.0: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - find-up@6.3.0: - dependencies: - locate-path: 7.2.0 - path-exists: 5.0.0 - flat-cache@4.0.1: dependencies: flatted: 3.3.1 @@ -5278,16 +5247,21 @@ snapshots: transitivePeerDependencies: - supports-color - git-raw-commits@4.0.0: + git-raw-commits@5.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0): dependencies: - dargs: 8.1.0 - meow: 12.1.1 - split2: 4.2.0 + '@conventional-changelog/git-client': 1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0) + meow: 13.2.0 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser - git-semver-tags@7.0.1: + git-semver-tags@8.0.0(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0): dependencies: - meow: 12.1.1 - semver: 7.6.3 + '@conventional-changelog/git-client': 1.0.1(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0) + meow: 13.2.0 + transitivePeerDependencies: + - conventional-commits-filter + - conventional-commits-parser glob-parent@5.1.2: dependencies: @@ -5420,6 +5394,8 @@ snapshots: imurmurhash@0.1.4: {} + index-to-position@0.1.2: {} + inflight@1.0.6: dependencies: once: 1.4.0 @@ -5496,10 +5472,6 @@ snapshots: is-stream@3.0.0: {} - is-text-path@2.0.0: - dependencies: - text-extensions: 2.4.0 - is-wsl@2.2.0: dependencies: is-docker: 2.2.1 @@ -5599,8 +5571,6 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} - json-stringify-safe@5.0.1: {} - json5@2.2.3: {} jsonfile@6.1.0: @@ -5609,8 +5579,6 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 - jsonparse@1.3.1: {} - jstransformer@1.0.0: dependencies: is-promise: 2.2.2 @@ -5640,8 +5608,6 @@ snapshots: lines-and-columns@1.2.4: {} - lines-and-columns@2.0.4: {} - lint-staged@15.2.7: dependencies: chalk: 5.3.0 @@ -5677,10 +5643,6 @@ snapshots: dependencies: p-locate: 5.0.0 - locate-path@7.2.0: - dependencies: - p-locate: 6.0.0 - lodash.camelcase@4.3.0: {} lodash.merge@4.6.2: {} @@ -5729,7 +5691,7 @@ snapshots: memorystream@0.3.1: {} - meow@12.1.1: {} + meow@13.2.0: {} merge-source-map@1.1.0: dependencies: @@ -5860,10 +5822,6 @@ snapshots: dependencies: yocto-queue: 0.1.0 - p-limit@4.0.0: - dependencies: - yocto-queue: 1.1.1 - p-limit@5.0.0: dependencies: yocto-queue: 1.1.1 @@ -5872,10 +5830,6 @@ snapshots: dependencies: p-limit: 3.1.0 - p-locate@6.0.0: - dependencies: - p-limit: 4.0.0 - pac-proxy-agent@7.0.2: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 @@ -5909,13 +5863,11 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-json@7.1.1: + parse-json@8.1.0: dependencies: '@babel/code-frame': 7.24.7 - error-ex: 1.3.2 - json-parse-even-better-errors: 3.0.2 - lines-and-columns: 2.0.4 - type-fest: 3.13.1 + index-to-position: 0.1.2 + type-fest: 4.21.0 parse5@7.1.2: dependencies: @@ -5923,8 +5875,6 @@ snapshots: path-exists@4.0.0: {} - path-exists@5.0.0: {} - path-is-absolute@1.0.1: {} path-is-inside@1.0.2: {} @@ -6167,18 +6117,19 @@ snapshots: json-parse-even-better-errors: 3.0.2 npm-normalize-package-bin: 3.0.1 - read-pkg-up@10.1.0: + read-package-up@11.0.0: dependencies: - find-up: 6.3.0 - read-pkg: 8.1.0 + find-up-simple: 1.0.0 + read-pkg: 9.0.1 type-fest: 4.21.0 - read-pkg@8.1.0: + read-pkg@9.0.1: dependencies: '@types/normalize-package-data': 2.4.4 normalize-package-data: 6.0.2 - parse-json: 7.1.1 + parse-json: 8.1.0 type-fest: 4.21.0 + unicorn-magic: 0.1.0 readable-stream@2.3.8: dependencies: @@ -6435,8 +6386,6 @@ snapshots: spdx-license-ids@3.0.18: {} - split2@4.2.0: {} - sprintf-js@1.1.3: {} stable-hash@0.0.4: {} @@ -6549,8 +6498,6 @@ snapshots: dependencies: b4a: 1.6.6 - text-extensions@2.4.0: {} - text-table@0.2.0: {} through@2.3.8: {} @@ -6603,8 +6550,6 @@ snapshots: type-fest@2.19.0: {} - type-fest@3.13.1: {} - type-fest@4.21.0: {} typescript-eslint@7.17.0(eslint@9.8.0)(typescript@5.4.5): @@ -6632,6 +6577,8 @@ snapshots: undici-types@5.26.5: {} + unicorn-magic@0.1.0: {} + universalify@0.2.0: {} universalify@2.0.1: {} From 87923f6af12f8ede677a3830c269d9486d9d95de Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 29 Jul 2024 21:26:48 +0800 Subject: [PATCH 56/61] chore(types): reuse built-in Iterator type (#11435) --- packages/reactivity/src/collectionHandlers.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/reactivity/src/collectionHandlers.ts b/packages/reactivity/src/collectionHandlers.ts index c39e3ed48cd..9098ad4a2e5 100644 --- a/packages/reactivity/src/collectionHandlers.ts +++ b/packages/reactivity/src/collectionHandlers.ts @@ -173,19 +173,6 @@ function createForEach(isReadonly: boolean, isShallow: boolean) { } } -interface Iterable { - [Symbol.iterator](): Iterator -} - -interface Iterator { - next(value?: any): IterationResult -} - -interface IterationResult { - value: any - done: boolean -} - function createIterableMethod( method: string | symbol, isReadonly: boolean, @@ -194,7 +181,7 @@ function createIterableMethod( return function ( this: IterableCollections, ...args: unknown[] - ): Iterable & Iterator { + ): Iterable & Iterator { const target = (this as any)[ReactiveFlags.RAW] const rawTarget = toRaw(target) const targetIsMap = isMap(rawTarget) From 5680142e68096c42e66da9f4c6220d040d7c56ba Mon Sep 17 00:00:00 2001 From: skirtle <65301168+skirtles-code@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:47:23 +0100 Subject: [PATCH 57/61] perf(runtime-core): improve efficiency of normalizePropsOptions (#11409) close #9739 --- packages/runtime-core/src/componentProps.ts | 65 +++++++++++---------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 9d7b7f0e4a5..ce39f150ef5 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -174,12 +174,10 @@ export type ExtractDefaultPropTypes = O extends object { [K in keyof Pick>]: InferPropType } : {} -type NormalizedProp = - | null - | (PropOptions & { - [BooleanFlags.shouldCast]?: boolean - [BooleanFlags.shouldCastTrue]?: boolean - }) +type NormalizedProp = PropOptions & { + [BooleanFlags.shouldCast]?: boolean + [BooleanFlags.shouldCastTrue]?: boolean +} // normalized value is a tuple of the actual normalized options // and an array of prop keys that need value casting (booleans and defaults) @@ -564,16 +562,36 @@ export function normalizePropsOptions( const opt = raw[key] const prop: NormalizedProp = (normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt)) - if (prop) { - const booleanIndex = getTypeIndex(Boolean, prop.type) - const stringIndex = getTypeIndex(String, prop.type) - prop[BooleanFlags.shouldCast] = booleanIndex > -1 - prop[BooleanFlags.shouldCastTrue] = - stringIndex < 0 || booleanIndex < stringIndex - // if the prop needs boolean casting or default value - if (booleanIndex > -1 || hasOwn(prop, 'default')) { - needCastKeys.push(normalizedKey) + const propType = prop.type + let shouldCast = false + let shouldCastTrue = true + + if (isArray(propType)) { + for (let index = 0; index < propType.length; ++index) { + const type = propType[index] + const typeName = isFunction(type) && type.name + + if (typeName === 'Boolean') { + shouldCast = true + break + } else if (typeName === 'String') { + // If we find `String` before `Boolean`, e.g. `[String, Boolean]`, + // we need to handle the casting slightly differently. Props + // passed as `` or `` + // will either be treated as strings or converted to a boolean + // `true`, depending on the order of the types. + shouldCastTrue = false + } } + } else { + shouldCast = isFunction(propType) && propType.name === 'Boolean' + } + + prop[BooleanFlags.shouldCast] = shouldCast + prop[BooleanFlags.shouldCastTrue] = shouldCastTrue + // if the prop needs boolean casting or default value + if (shouldCast || hasOwn(prop, 'default')) { + needCastKeys.push(normalizedKey) } } } @@ -595,6 +613,7 @@ function validatePropName(key: string) { return false } +// dev only // use function string name to check type constructors // so that it works across vms / iframes. function getType(ctor: Prop): string { @@ -617,22 +636,6 @@ function getType(ctor: Prop): string { return '' } -function isSameType(a: Prop, b: Prop): boolean { - return getType(a) === getType(b) -} - -function getTypeIndex( - type: Prop, - expectedTypes: PropType | void | null | true, -): number { - if (isArray(expectedTypes)) { - return expectedTypes.findIndex(t => isSameType(t, type)) - } else if (isFunction(expectedTypes)) { - return isSameType(expectedTypes, type) ? 0 : -1 - } - return -1 -} - /** * dev only */ From af60e3560c84e44136f950fc3d0e39b576098c6c Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 29 Jul 2024 22:07:40 +0800 Subject: [PATCH 58/61] test: make transition tests more stable locally --- packages/vue/__tests__/e2e/Transition.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/vue/__tests__/e2e/Transition.spec.ts b/packages/vue/__tests__/e2e/Transition.spec.ts index d005f78b84d..46d865f890e 100644 --- a/packages/vue/__tests__/e2e/Transition.spec.ts +++ b/packages/vue/__tests__/e2e/Transition.spec.ts @@ -8,7 +8,7 @@ describe('e2e: Transition', () => { const baseUrl = `file://${path.resolve(__dirname, './transition.html')}` const duration = process.env.CI ? 200 : 50 - const buffer = process.env.CI ? 20 : 5 + const buffer = 20 const transitionFinish = (time = duration) => timeout(time + buffer) @@ -29,8 +29,6 @@ describe('e2e: Transition', () => { test( 'basic transition', async () => { - await page().goto(baseUrl) - await page().waitForSelector('#app') await page().evaluate(() => { const { createApp, ref } = (window as any).Vue createApp({ @@ -1296,8 +1294,6 @@ describe('e2e: Transition', () => { test( 'wrapping transition + fallthrough attrs', async () => { - await page().goto(baseUrl) - await page().waitForSelector('#app') await page().evaluate(() => { const { createApp, ref } = (window as any).Vue createApp({ From 12667da4879f980dcf2c50e36f3642d085a87d71 Mon Sep 17 00:00:00 2001 From: edison Date: Wed, 31 Jul 2024 15:46:39 +0800 Subject: [PATCH 59/61] fix(Teleport): ensure targetAnchor and targetStart not null during hydration (#11456) close #11400 --- .../runtime-core/__tests__/hydration.spec.ts | 112 ++++++++++++++++++ .../runtime-core/src/components/Teleport.ts | 42 +++++-- 2 files changed, 144 insertions(+), 10 deletions(-) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index ea1d626f7c4..9916fafa62c 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -512,6 +512,118 @@ describe('SSR hydration', () => { ) }) + test('Teleport unmount (full integration)', async () => { + const Comp1 = { + template: ` + + Teleported Comp1 + + `, + } + const Comp2 = { + template: ` +
      Comp2
      + `, + } + + const toggle = ref(true) + const App = { + template: ` +
      + + +
      + `, + components: { + Comp1, + Comp2, + }, + setup() { + return { toggle } + }, + } + + const container = document.createElement('div') + const teleportContainer = document.createElement('div') + teleportContainer.id = 'target' + document.body.appendChild(teleportContainer) + + // server render + container.innerHTML = await renderToString(h(App)) + expect(container.innerHTML).toBe( + '
      ', + ) + expect(teleportContainer.innerHTML).toBe('') + + // hydrate + createSSRApp(App).mount(container) + expect(container.innerHTML).toBe( + '
      ', + ) + expect(teleportContainer.innerHTML).toBe('Teleported Comp1') + expect(`Hydration children mismatch`).toHaveBeenWarned() + + toggle.value = false + await nextTick() + expect(container.innerHTML).toBe('
      Comp2
      ') + expect(teleportContainer.innerHTML).toBe('') + }) + + test('Teleport target change (full integration)', async () => { + const target = ref('#target1') + const Comp = { + template: ` + + Teleported + + `, + setup() { + return { target } + }, + } + + const App = { + template: ` +
      + +
      + `, + components: { + Comp, + }, + } + + const container = document.createElement('div') + const teleportContainer1 = document.createElement('div') + teleportContainer1.id = 'target1' + const teleportContainer2 = document.createElement('div') + teleportContainer2.id = 'target2' + document.body.appendChild(teleportContainer1) + document.body.appendChild(teleportContainer2) + + // server render + container.innerHTML = await renderToString(h(App)) + expect(container.innerHTML).toBe( + '
      ', + ) + expect(teleportContainer1.innerHTML).toBe('') + expect(teleportContainer2.innerHTML).toBe('') + + // hydrate + createSSRApp(App).mount(container) + expect(container.innerHTML).toBe( + '
      ', + ) + expect(teleportContainer1.innerHTML).toBe('Teleported') + expect(teleportContainer2.innerHTML).toBe('') + expect(`Hydration children mismatch`).toHaveBeenWarned() + + target.value = '#target2' + await nextTick() + expect(teleportContainer1.innerHTML).toBe('') + expect(teleportContainer2.innerHTML).toBe('Teleported') + }) + // compile SSR + client render fn from the same template & hydrate test('full compiler integration', async () => { const mounted: string[] = [] diff --git a/packages/runtime-core/src/components/Teleport.ts b/packages/runtime-core/src/components/Teleport.ts index 65437300cff..81573cc85a7 100644 --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@ -107,17 +107,11 @@ export const TeleportImpl = { const mainAnchor = (n2.anchor = __DEV__ ? createComment('teleport end') : createText('')) - const target = (n2.target = resolveTarget(n2.props, querySelector)) - const targetStart = (n2.targetStart = createText('')) - const targetAnchor = (n2.targetAnchor = createText('')) insert(placeholder, container, anchor) insert(mainAnchor, container, anchor) - // attach a special property so we can skip teleported content in - // renderer's nextSibling search - targetStart[TeleportEndKey] = targetAnchor + const target = (n2.target = resolveTarget(n2.props, querySelector)) + const targetAnchor = prepareAnchor(target, n2, createText, insert) if (target) { - insert(targetStart, target) - insert(targetAnchor, target) // #2652 we could be teleporting from a non-SVG tree into an SVG tree if (namespace === 'svg' || isTargetSVG(target)) { namespace = 'svg' @@ -355,7 +349,7 @@ function hydrateTeleport( slotScopeIds: string[] | null, optimized: boolean, { - o: { nextSibling, parentNode, querySelector }, + o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals, hydrateChildren: ( node: Node | null, @@ -387,7 +381,7 @@ function hydrateTeleport( slotScopeIds, optimized, ) - vnode.targetAnchor = targetNode + vnode.targetStart = vnode.targetAnchor = targetNode } else { vnode.anchor = nextSibling(node) @@ -409,6 +403,13 @@ function hydrateTeleport( } } + // #11400 if the HTML corresponding to Teleport is not embedded in the correct position + // on the final page during SSR. the targetAnchor will always be null, we need to + // manually add targetAnchor to ensure Teleport it can properly unmount or move + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert) + } + hydrateChildren( targetNode, vnode, @@ -449,3 +450,24 @@ function updateCssVars(vnode: VNode) { ctx.ut() } } + +function prepareAnchor( + target: RendererElement | null, + vnode: TeleportVNode, + createText: RendererOptions['createText'], + insert: RendererOptions['insert'], +) { + const targetStart = (vnode.targetStart = createText('')) + const targetAnchor = (vnode.targetAnchor = createText('')) + + // attach a special property, so we can skip teleported content in + // renderer's nextSibling search + targetStart[TeleportEndKey] = targetAnchor + + if (target) { + insert(targetStart, target) + insert(targetAnchor, target) + } + + return targetAnchor +} From 7b18cdb0b53a94007ca6a3675bf41b5d3153fec6 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 31 Jul 2024 16:09:56 +0800 Subject: [PATCH 60/61] fix(teleport/ssr): fix Teleport hydration regression due to targetStart anchor addition --- .../runtime-core/__tests__/hydration.spec.ts | 100 +++++++++++++++--- .../runtime-core/src/components/Teleport.ts | 32 +++--- .../__tests__/ssrTeleport.spec.ts | 19 ++-- .../src/helpers/ssrRenderTeleport.ts | 3 +- 4 files changed, 114 insertions(+), 40 deletions(-) diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index 9916fafa62c..c525618b510 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -265,7 +265,7 @@ describe('SSR hydration', () => { const fn = vi.fn() const teleportContainer = document.createElement('div') teleportContainer.id = 'teleport' - teleportContainer.innerHTML = `foo` + teleportContainer.innerHTML = `foo` document.body.appendChild(teleportContainer) const { vnode, container } = mountWithHydration( @@ -281,13 +281,14 @@ describe('SSR hydration', () => { expect(vnode.anchor).toBe(container.lastChild) expect(vnode.target).toBe(teleportContainer) + expect(vnode.targetStart).toBe(teleportContainer.childNodes[0]) expect((vnode.children as VNode[])[0].el).toBe( - teleportContainer.childNodes[0], + teleportContainer.childNodes[1], ) expect((vnode.children as VNode[])[1].el).toBe( - teleportContainer.childNodes[1], + teleportContainer.childNodes[2], ) - expect(vnode.targetAnchor).toBe(teleportContainer.childNodes[2]) + expect(vnode.targetAnchor).toBe(teleportContainer.childNodes[3]) // event handler triggerEvent('click', teleportContainer.querySelector('.foo')!) @@ -296,7 +297,7 @@ describe('SSR hydration', () => { msg.value = 'bar' await nextTick() expect(teleportContainer.innerHTML).toBe( - `bar`, + `bar`, ) }) @@ -326,7 +327,7 @@ describe('SSR hydration', () => { const teleportHtml = ctx.teleports!['#teleport2'] expect(teleportHtml).toMatchInlineSnapshot( - `"foofoo2"`, + `"foofoo2"`, ) teleportContainer.innerHTML = teleportHtml @@ -342,16 +343,18 @@ describe('SSR hydration', () => { expect(teleportVnode2.anchor).toBe(container.childNodes[4]) expect(teleportVnode1.target).toBe(teleportContainer) + expect(teleportVnode1.targetStart).toBe(teleportContainer.childNodes[0]) expect((teleportVnode1 as any).children[0].el).toBe( - teleportContainer.childNodes[0], + teleportContainer.childNodes[1], ) - expect(teleportVnode1.targetAnchor).toBe(teleportContainer.childNodes[2]) + expect(teleportVnode1.targetAnchor).toBe(teleportContainer.childNodes[3]) expect(teleportVnode2.target).toBe(teleportContainer) + expect(teleportVnode2.targetStart).toBe(teleportContainer.childNodes[4]) expect((teleportVnode2 as any).children[0].el).toBe( - teleportContainer.childNodes[3], + teleportContainer.childNodes[5], ) - expect(teleportVnode2.targetAnchor).toBe(teleportContainer.childNodes[5]) + expect(teleportVnode2.targetAnchor).toBe(teleportContainer.childNodes[7]) // // event handler triggerEvent('click', teleportContainer.querySelector('.foo')!) @@ -363,7 +366,7 @@ describe('SSR hydration', () => { msg.value = 'bar' await nextTick() expect(teleportContainer.innerHTML).toMatchInlineSnapshot( - `"barbar2"`, + `"barbar2"`, ) }) @@ -390,7 +393,9 @@ describe('SSR hydration', () => { ) const teleportHtml = ctx.teleports!['#teleport3'] - expect(teleportHtml).toMatchInlineSnapshot(`""`) + expect(teleportHtml).toMatchInlineSnapshot( + `""`, + ) teleportContainer.innerHTML = teleportHtml document.body.appendChild(teleportContainer) @@ -413,7 +418,8 @@ describe('SSR hydration', () => { expect(children[2].el).toBe(container.childNodes[6]) expect(teleportVnode.target).toBe(teleportContainer) - expect(teleportVnode.targetAnchor).toBe(teleportContainer.childNodes[0]) + expect(teleportVnode.targetStart).toBe(teleportContainer.childNodes[0]) + expect(teleportVnode.targetAnchor).toBe(teleportContainer.childNodes[1]) // // event handler triggerEvent('click', container.querySelector('.foo')!) @@ -454,7 +460,7 @@ describe('SSR hydration', () => { test('Teleport (as component root)', () => { const teleportContainer = document.createElement('div') teleportContainer.id = 'teleport4' - teleportContainer.innerHTML = `hello` + teleportContainer.innerHTML = `hello` document.body.appendChild(teleportContainer) const wrapper = { @@ -483,7 +489,7 @@ describe('SSR hydration', () => { test('Teleport (nested)', () => { const teleportContainer = document.createElement('div') teleportContainer.id = 'teleport5' - teleportContainer.innerHTML = `
      child
      ` + teleportContainer.innerHTML = `
      child
      ` document.body.appendChild(teleportContainer) const { vnode, container } = mountWithHydration( @@ -498,7 +504,7 @@ describe('SSR hydration', () => { expect(vnode.anchor).toBe(container.lastChild) const childDivVNode = (vnode as any).children[0] - const div = teleportContainer.firstChild + const div = teleportContainer.childNodes[1] expect(childDivVNode.el).toBe(div) expect(vnode.targetAnchor).toBe(div?.nextSibling) @@ -548,6 +554,66 @@ describe('SSR hydration', () => { teleportContainer.id = 'target' document.body.appendChild(teleportContainer) + // server render + const ctx: SSRContext = {} + container.innerHTML = await renderToString(h(App), ctx) + expect(container.innerHTML).toBe( + '
      ', + ) + teleportContainer.innerHTML = ctx.teleports!['#target'] + + // hydrate + createSSRApp(App).mount(container) + expect(container.innerHTML).toBe( + '
      ', + ) + expect(teleportContainer.innerHTML).toBe( + 'Teleported Comp1', + ) + expect(`Hydration children mismatch`).not.toHaveBeenWarned() + + toggle.value = false + await nextTick() + expect(container.innerHTML).toBe('
      Comp2
      ') + expect(teleportContainer.innerHTML).toBe('') + }) + + test('Teleport unmount (mismatch + full integration)', async () => { + const Comp1 = { + template: ` + + Teleported Comp1 + + `, + } + const Comp2 = { + template: ` +
      Comp2
      + `, + } + + const toggle = ref(true) + const App = { + template: ` +
      + + +
      + `, + components: { + Comp1, + Comp2, + }, + setup() { + return { toggle } + }, + } + + const container = document.createElement('div') + const teleportContainer = document.createElement('div') + teleportContainer.id = 'target' + document.body.appendChild(teleportContainer) + // server render container.innerHTML = await renderToString(h(App)) expect(container.innerHTML).toBe( @@ -569,7 +635,7 @@ describe('SSR hydration', () => { expect(teleportContainer.innerHTML).toBe('') }) - test('Teleport target change (full integration)', async () => { + test('Teleport target change (mismatch + full integration)', async () => { const target = ref('#target1') const Comp = { template: ` diff --git a/packages/runtime-core/src/components/Teleport.ts b/packages/runtime-core/src/components/Teleport.ts index 81573cc85a7..d868fbbc669 100644 --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@ -381,7 +381,8 @@ function hydrateTeleport( slotScopeIds, optimized, ) - vnode.targetStart = vnode.targetAnchor = targetNode + vnode.targetStart = targetNode + vnode.targetAnchor = targetNode && nextSibling(targetNode) } else { vnode.anchor = nextSibling(node) @@ -390,28 +391,29 @@ function hydrateTeleport( // could be nested teleports let targetAnchor = targetNode while (targetAnchor) { - targetAnchor = nextSibling(targetAnchor) - if ( - targetAnchor && - targetAnchor.nodeType === 8 && - (targetAnchor as Comment).data === 'teleport anchor' - ) { - vnode.targetAnchor = targetAnchor - ;(target as TeleportTargetElement)._lpa = - vnode.targetAnchor && nextSibling(vnode.targetAnchor as Node) - break + if (targetAnchor && targetAnchor.nodeType === 8) { + if ((targetAnchor as Comment).data === 'teleport start anchor') { + vnode.targetStart = targetAnchor + } else if ((targetAnchor as Comment).data === 'teleport anchor') { + vnode.targetAnchor = targetAnchor + ;(target as TeleportTargetElement)._lpa = + vnode.targetAnchor && nextSibling(vnode.targetAnchor as Node) + break + } } + targetAnchor = nextSibling(targetAnchor) } - // #11400 if the HTML corresponding to Teleport is not embedded in the correct position - // on the final page during SSR. the targetAnchor will always be null, we need to - // manually add targetAnchor to ensure Teleport it can properly unmount or move + // #11400 if the HTML corresponding to Teleport is not embedded in the + // correct position on the final page during SSR. the targetAnchor will + // always be null, we need to manually add targetAnchor to ensure + // Teleport it can properly unmount or move if (!vnode.targetAnchor) { prepareAnchor(target, vnode, createText, insert) } hydrateChildren( - targetNode, + targetNode && nextSibling(targetNode), vnode, target, parentComponent, diff --git a/packages/server-renderer/__tests__/ssrTeleport.spec.ts b/packages/server-renderer/__tests__/ssrTeleport.spec.ts index a0a2f6ae0a1..78c56942636 100644 --- a/packages/server-renderer/__tests__/ssrTeleport.spec.ts +++ b/packages/server-renderer/__tests__/ssrTeleport.spec.ts @@ -28,7 +28,7 @@ describe('ssrRenderTeleport', () => { ) expect(html).toBe('') expect(ctx.teleports!['#target']).toBe( - `
      content
      `, + `
      content
      `, ) }) @@ -56,7 +56,9 @@ describe('ssrRenderTeleport', () => { expect(html).toBe( '
      content
      ', ) - expect(ctx.teleports!['#target']).toBe(``) + expect(ctx.teleports!['#target']).toBe( + ``, + ) }) test('teleport rendering (vnode)', async () => { @@ -73,7 +75,7 @@ describe('ssrRenderTeleport', () => { ) expect(html).toBe('') expect(ctx.teleports!['#target']).toBe( - 'hello', + 'hello', ) }) @@ -93,7 +95,9 @@ describe('ssrRenderTeleport', () => { expect(html).toBe( 'hello', ) - expect(ctx.teleports!['#target']).toBe(``) + expect(ctx.teleports!['#target']).toBe( + ``, + ) }) test('multiple teleports with same target', async () => { @@ -115,7 +119,8 @@ describe('ssrRenderTeleport', () => { '
      ', ) expect(ctx.teleports!['#target']).toBe( - 'helloworld', + 'hello' + + 'world', ) }) @@ -134,7 +139,7 @@ describe('ssrRenderTeleport', () => { ) expect(html).toBe('') expect(ctx.teleports!['#target']).toBe( - `
      content
      `, + `
      content
      `, ) }) @@ -169,7 +174,7 @@ describe('ssrRenderTeleport', () => { await p expect(html).toBe('') expect(ctx.teleports!['#target']).toBe( - `
      content
      `, + `
      content
      `, ) }) }) diff --git a/packages/server-renderer/src/helpers/ssrRenderTeleport.ts b/packages/server-renderer/src/helpers/ssrRenderTeleport.ts index d83af28c131..0806a3927be 100644 --- a/packages/server-renderer/src/helpers/ssrRenderTeleport.ts +++ b/packages/server-renderer/src/helpers/ssrRenderTeleport.ts @@ -29,9 +29,10 @@ export function ssrRenderTeleport( if (disabled) { contentRenderFn(parentPush) - teleportContent = `` + teleportContent = `` } else { const { getBuffer, push } = createBuffer() + push(``) contentRenderFn(push) push(``) teleportContent = getBuffer() From 0b8ba6320eaf8b08e83d7c1e1309254dd0b021da Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 31 Jul 2024 16:42:04 +0800 Subject: [PATCH 61/61] release: v3.4.35 --- CHANGELOG.md | 16 ++++++++++++++++ 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, 28 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c253a60eb8..70d5e5a1ea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## [3.4.35](https://github.com/vuejs/core/compare/v3.4.34...v3.4.35) (2024-07-31) + + +### Bug Fixes + +* **teleport/ssr:** fix Teleport hydration regression due to targetStart anchor addition ([7b18cdb](https://github.com/vuejs/core/commit/7b18cdb0b53a94007ca6a3675bf41b5d3153fec6)) +* **teleport/ssr:** ensure targetAnchor and targetStart not null during hydration ([#11456](https://github.com/vuejs/core/issues/11456)) ([12667da](https://github.com/vuejs/core/commit/12667da4879f980dcf2c50e36f3642d085a87d71)), closes [#11400](https://github.com/vuejs/core/issues/11400) +* **types/ref:** allow getter and setter types to be unrelated ([#11442](https://github.com/vuejs/core/issues/11442)) ([e0b2975](https://github.com/vuejs/core/commit/e0b2975ef65ae6a0be0aa0a0df43fb887c665251)) + + +### Performance Improvements + +* **runtime-core:** improve efficiency of normalizePropsOptions ([#11409](https://github.com/vuejs/core/issues/11409)) ([5680142](https://github.com/vuejs/core/commit/5680142e68096c42e66da9f4c6220d040d7c56ba)), closes [#9739](https://github.com/vuejs/core/issues/9739) + + + ## [3.4.34](https://github.com/vuejs/core/compare/v3.4.33...v3.4.34) (2024-07-24) diff --git a/package.json b/package.json index 80e74ed2089..c2b7b21ec9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "3.4.34", + "version": "3.4.35", "packageManager": "pnpm@9.6.0", "type": "module", "scripts": { diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 41347148bfd..6237a360dcf 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-core", - "version": "3.4.34", + "version": "3.4.35", "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 452e57c6707..f988fa1dd70 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-dom", - "version": "3.4.34", + "version": "3.4.35", "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 c9e771abbc7..5f2216dc8a4 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.4.34", + "version": "3.4.35", "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 27ce3f49509..7876676326a 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.4.34", + "version": "3.4.35", "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 95413ce3437..9da115b811a 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.4.34", + "version": "3.4.35", "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 a590e951995..614f2beb793 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.4.34", + "version": "3.4.35", "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 51450c5a0fe..f01d252b612 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.4.34", + "version": "3.4.35", "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 78a8de2fbdd..18d1a92f0d2 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.4.34", + "version": "3.4.35", "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 5df49087d2d..f0eadfca16d 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.4.34", + "version": "3.4.35", "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 41d0a893b51..18d818f3e41 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.4.34", + "version": "3.4.35", "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 7171f086447..891900f875e 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.4.34", + "version": "3.4.35", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js",