From: Evan You Date: Wed, 31 Jul 2024 08:49:22 +0000 (+0800) Subject: chore: Merge branch 'main' into minor X-Git-Tag: v3.5.0-alpha.5~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f35080daf564435bf7a424008784bfaa1b887112;p=thirdparty%2Fvuejs%2Fcore.git chore: Merge branch 'main' into minor --- f35080daf564435bf7a424008784bfaa1b887112 diff --cc CHANGELOG.md index a286eab0c8,70d5e5a1ea..332c549ef4 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@@ -1,21 -1,21 +1,36 @@@ - # [3.5.0-alpha.4](https://github.com/vuejs/core/compare/v3.4.34...v3.5.0-alpha.4) (2024-07-24) + ## [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.5.0-alpha.4](https://github.com/vuejs/core/compare/v3.4.34...v3.5.0-alpha.4) (2024-07-24) + +### Bug Fixes + +* **suspense/hydration:** fix hydration timing of async component inside suspense ([1b8e197](https://github.com/vuejs/core/commit/1b8e197a5b65d67a9703b8511786fb81df9aa7cc)), closes [#6638](https://github.com/vuejs/core/issues/6638) +* **useId:** properly mark async boundary for already resolved async component ([cd28172](https://github.com/vuejs/core/commit/cd281725781ada2ab279e919031ae307e146a9d9)) + + + ## [3.4.34](https://github.com/vuejs/core/compare/v3.4.33...v3.4.34) (2024-07-24) +* **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.5.0-alpha.3](https://github.com/vuejs/core/compare/v3.4.33...v3.5.0-alpha.3) (2024-07-19) + ### Bug Fixes diff --cc package.json index 7b544bdbed,c2b7b21ec9..1d0b11eefb --- a/package.json +++ b/package.json @@@ -1,7 -1,7 +1,7 @@@ { "private": true, - "version": "3.4.35", + "version": "3.5.0-alpha.4", - "packageManager": "pnpm@9.5.0", + "packageManager": "pnpm@9.6.0", "type": "module", "scripts": { "dev": "node scripts/dev.js", diff --cc packages/reactivity/src/collectionHandlers.ts index 79ec333dd0,9098ad4a2e..0b7d93be66 --- a/packages/reactivity/src/collectionHandlers.ts +++ b/packages/reactivity/src/collectionHandlers.ts @@@ -190,8 -181,8 +177,8 @@@ function createIterableMethod return function ( this: IterableCollections, ...args: unknown[] - ): Iterable & Iterator { + ): Iterable & Iterator { - const target = (this as any)[ReactiveFlags.RAW] + const target = this[ReactiveFlags.RAW] const rawTarget = toRaw(target) const targetIsMap = isMap(rawTarget) const isPair = diff --cc packages/runtime-core/src/componentProps.ts index e4e8c0709d,ce39f150ef..25431cf9f7 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@@ -597,9 -613,10 +615,10 @@@ 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 { +function getType(ctor: Prop | null): string { // Early return for null to avoid unnecessary computations if (ctor === null) { return 'null' diff --cc packages/runtime-core/src/components/Teleport.ts index 997b83cc52,d868fbbc66..1aa3ba6c4c --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@@ -112,13 -107,20 +112,8 @@@ export const TeleportImpl = const mainAnchor = (n2.anchor = __DEV__ ? createComment('teleport end') : createText('')) - 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) { - // #2652 we could be teleporting from a non-SVG tree into an SVG tree - if (namespace === 'svg' || isTargetSVG(target)) { - namespace = 'svg' - } else if (namespace === 'mathml' || isTargetMathML(target)) { - namespace = 'mathml' - } - } else if (__DEV__ && !disabled) { - warn('Invalid Teleport target on mount:', target, `(${typeof target})`) - } const mount = (container: RendererElement, anchor: RendererNode) => { // Teleport *always* has Array children. This is enforced in both the @@@ -137,39 -139,10 +132,38 @@@ } } + const mountToTarget = () => { + 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' + } else if (namespace !== 'mathml' && isTargetMathML(target)) { + namespace = 'mathml' + } + if (!disabled) { + mount(target, targetAnchor) + updateCssVars(n2) + } + } else if (__DEV__ && !disabled) { + warn( + 'Invalid Teleport target on mount:', + target, + `(${typeof target})`, + ) + } + } + if (disabled) { mount(container, mainAnchor) - } else if (target) { - mount(target, targetAnchor) + updateCssVars(n2) + } + + if (isTeleportDeferred(n2.props)) { + queuePostRenderEffect(mountToTarget, parentSuspense) + } else { + mountToTarget() } } else { // update content