Merge branch 'main' into fix/8466
This commit is contained in:
commit
6f17c77ca5
|
@ -17,10 +17,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to 18
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: '.node-version'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: 'pnpm'
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to 18
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install
|
||||
|
@ -44,10 +44,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to 18
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install
|
||||
|
@ -73,10 +73,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to 18
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install
|
||||
|
@ -96,10 +96,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to 18
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install
|
||||
|
|
|
@ -24,10 +24,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to LTS
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: lts/*
|
||||
node-version-file: '.node-version'
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
|
|
|
@ -26,10 +26,10 @@ jobs:
|
|||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node version to LTS
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: lts/*
|
||||
node-version-file: '.node-version'
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
20
|
39
CHANGELOG.md
39
CHANGELOG.md
|
@ -1,3 +1,42 @@
|
|||
## [3.3.5](https://github.com/vuejs/core/compare/v3.3.4...v3.3.5) (2023-10-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add isGloballyWhitelisted back, but deprecated ([#8556](https://github.com/vuejs/core/issues/8556)) ([63dfe8e](https://github.com/vuejs/core/commit/63dfe8eab499979bcc2f7829e82464e13899c895)), closes [#8416](https://github.com/vuejs/core/issues/8416)
|
||||
* **build:** disable useDefineForClassFields in esbuild ([#9252](https://github.com/vuejs/core/issues/9252)) ([6d14fa8](https://github.com/vuejs/core/commit/6d14fa88e85d4c9e264be394ddb37a54ca6738a8))
|
||||
* **compat:** return value of vue compat set() ([#9377](https://github.com/vuejs/core/issues/9377)) ([e3c2d69](https://github.com/vuejs/core/commit/e3c2d699f694d9500ddee78571172a24f0e3b17a))
|
||||
* **compiler-sfc:** don't hoist props and emit ([#8535](https://github.com/vuejs/core/issues/8535)) ([24db951](https://github.com/vuejs/core/commit/24db9516d8b4857182ec1a3af86cb7346691679b)), closes [#7805](https://github.com/vuejs/core/issues/7805) [#7812](https://github.com/vuejs/core/issues/7812)
|
||||
* **compiler-sfc:** don't registerTS when bundling for browsers ([#8582](https://github.com/vuejs/core/issues/8582)) ([6f45f76](https://github.com/vuejs/core/commit/6f45f76df2c43796b35067ef8f8b9a7bca454040))
|
||||
* **compiler-sfc:** fix using imported ref as template ref during dev ([#7593](https://github.com/vuejs/core/issues/7593)) ([776ebf2](https://github.com/vuejs/core/commit/776ebf25b2e7570e78ac1c148fc45c823c21a542)), closes [#7567](https://github.com/vuejs/core/issues/7567)
|
||||
* **compiler-sfc:** handle dynamic directive arguments in template usage check ([#8538](https://github.com/vuejs/core/issues/8538)) ([e404a69](https://github.com/vuejs/core/commit/e404a699f48ae5c5a5da947f42679343192158c7)), closes [#8537](https://github.com/vuejs/core/issues/8537)
|
||||
* **compiler-sfc:** ignore style v-bind in double slash comments ([#5409](https://github.com/vuejs/core/issues/5409)) ([381b497](https://github.com/vuejs/core/commit/381b4977af25ba5392704f72ec6b3f2394d87ae7))
|
||||
* **compiler-sfc:** pass options directly to stylus ([#3848](https://github.com/vuejs/core/issues/3848)) ([d6446a6](https://github.com/vuejs/core/commit/d6446a6d40774b79045a9ddba7b5fd5201d51450))
|
||||
* **compiler-sfc:** support resolve multiple re-export /w same source type name ([#8365](https://github.com/vuejs/core/issues/8365)) ([4fa8da8](https://github.com/vuejs/core/commit/4fa8da8576717c619e1e8c04d19038488c75fbea)), closes [#8364](https://github.com/vuejs/core/issues/8364)
|
||||
* **compiler-sfc:** typo in experimental feature warnings ([#8513](https://github.com/vuejs/core/issues/8513)) ([fd1a3f9](https://github.com/vuejs/core/commit/fd1a3f95990d7c372fa1c0c40c55caca761a33a4))
|
||||
* **deps:** update dependency monaco-editor to ^0.44.0 ([#9237](https://github.com/vuejs/core/issues/9237)) ([8611874](https://github.com/vuejs/core/commit/8611874e09a827b6491173836c8942284d5de22c))
|
||||
* **deps:** update playground ([#9154](https://github.com/vuejs/core/issues/9154)) ([c8566a2](https://github.com/vuejs/core/commit/c8566a22b7cf37e6aefab7bad7b97ce2db9fae4c))
|
||||
* **playground:** fix github button style ([#7722](https://github.com/vuejs/core/issues/7722)) ([5ee992c](https://github.com/vuejs/core/commit/5ee992cfeabc6c4b871980c6057d0ac7140ad2fa))
|
||||
* **runtime-core:** swap client/server debug labels ([#9089](https://github.com/vuejs/core/issues/9089)) ([8f311c6](https://github.com/vuejs/core/commit/8f311c6f823f6776ca1c49bfbbbf8c7d9dea9cf1))
|
||||
* **ssr:** render correct initial selected state for select with v-model ([#7432](https://github.com/vuejs/core/issues/7432)) ([201c46d](https://github.com/vuejs/core/commit/201c46df07a38f3c2b73f384e8e6846dc62f224e)), closes [#7392](https://github.com/vuejs/core/issues/7392)
|
||||
* **ssr:** reset current instance if setting up options component errors ([#7743](https://github.com/vuejs/core/issues/7743)) ([020851e](https://github.com/vuejs/core/commit/020851e57d9a9f727c6ea07e9c1575430af02b73)), closes [#7733](https://github.com/vuejs/core/issues/7733)
|
||||
* **teleport:** handle target change while disabled ([#7837](https://github.com/vuejs/core/issues/7837)) ([140a89b](https://github.com/vuejs/core/commit/140a89b833bceed60838182b875d2953c70af114)), closes [#7835](https://github.com/vuejs/core/issues/7835)
|
||||
* **transition:** handle possible auto value for transition/animation durations ([96c76fa](https://github.com/vuejs/core/commit/96c76facb7de37fc241ccd55e121fd60a49a1452)), closes [#8409](https://github.com/vuejs/core/issues/8409)
|
||||
* **types/jsx:** add `inert` attribute and missing `hidden` values ([#8090](https://github.com/vuejs/core/issues/8090)) ([ceb0732](https://github.com/vuejs/core/commit/ceb0732e0b1bb4c8c505d80e97ff6fc89035fa90))
|
||||
* **types/jsx:** add missing loading attr for img element ([#6160](https://github.com/vuejs/core/issues/6160)) ([68d6b43](https://github.com/vuejs/core/commit/68d6b43f7e29b76aab2c6c1882885380a43fa3e3))
|
||||
* **types:** correct withDefaults return type for boolean prop with undefined default value ([#8602](https://github.com/vuejs/core/issues/8602)) ([f07cb18](https://github.com/vuejs/core/commit/f07cb18fedf9a446545aadf76bcdfb957c7ebcbd))
|
||||
* **types:** ensure nextTick return type reflect correct Promise value ([#8406](https://github.com/vuejs/core/issues/8406)) ([6a22b1f](https://github.com/vuejs/core/commit/6a22b1f6c287b60eda385df8a514335af8e040ea))
|
||||
* **types:** support correct types for style on svg elements ([#6322](https://github.com/vuejs/core/issues/6322)) ([364dc53](https://github.com/vuejs/core/commit/364dc53c7cc6f97d812ad175199c698faa92538e))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **compiler-sfc:** lazy require typescript ([d2c3d8b](https://github.com/vuejs/core/commit/d2c3d8b70b2df6e16f053a7ac58e6b04e7b2078f))
|
||||
* **custom-element:** cancel `MutationObserver` listener when disconnected ([#8666](https://github.com/vuejs/core/issues/8666)) ([24d98f0](https://github.com/vuejs/core/commit/24d98f03276de5b0fbced5a4c9d61b24e7d9d084))
|
||||
* mark `defineComponent` as side-effects-free ([#8512](https://github.com/vuejs/core/issues/8512)) ([438027c](https://github.com/vuejs/core/commit/438027cf9ecb63260f59d3027e0b188717694795))
|
||||
|
||||
|
||||
|
||||
## [3.3.4](https://github.com/vuejs/core/compare/v3.3.3...v3.3.4) (2023-05-18)
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"private": true,
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"packageManager": "pnpm@8.9.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/compiler-core",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/compiler-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-core.esm-bundler.js",
|
||||
|
@ -33,7 +33,7 @@
|
|||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.0",
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/shared": "3.3.5",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/compiler-dom",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/compiler-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-dom.esm-bundler.js",
|
||||
|
@ -37,7 +37,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-core": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/compiler-core": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,4 +166,34 @@ describe('compiler sfc: transform asset url', () => {
|
|||
expect(code).toMatch(`_createStaticVNode`)
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('transform with stringify with space in absolute filename', () => {
|
||||
const { code } = compileWithAssetUrls(
|
||||
`<div><img src="/foo bar.png"/></div>`,
|
||||
{
|
||||
includeAbsolute: true
|
||||
},
|
||||
{
|
||||
hoistStatic: true,
|
||||
transformHoist: stringifyStatic
|
||||
}
|
||||
)
|
||||
expect(code).toMatch(`_createElementVNode`)
|
||||
expect(code).toContain(`import _imports_0 from '/foo bar.png'`)
|
||||
})
|
||||
|
||||
test('transform with stringify with space in relative filename', () => {
|
||||
const { code } = compileWithAssetUrls(
|
||||
`<div><img src="./foo bar.png"/></div>`,
|
||||
{
|
||||
includeAbsolute: true
|
||||
},
|
||||
{
|
||||
hoistStatic: true,
|
||||
transformHoist: stringifyStatic
|
||||
}
|
||||
)
|
||||
expect(code).toMatch(`_createElementVNode`)
|
||||
expect(code).toContain(`import _imports_0 from './foo bar.png'`)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/compiler-sfc",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/compiler-sfc",
|
||||
"main": "dist/compiler-sfc.cjs.js",
|
||||
"module": "dist/compiler-sfc.esm-browser.js",
|
||||
|
@ -33,11 +33,11 @@
|
|||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.0",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/compiler-ssr": "3.3.4",
|
||||
"@vue/reactivity-transform": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-core": "3.3.5",
|
||||
"@vue/compiler-dom": "3.3.5",
|
||||
"@vue/compiler-ssr": "3.3.5",
|
||||
"@vue/reactivity-transform": "3.3.5",
|
||||
"@vue/shared": "3.3.5",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.5",
|
||||
"postcss": "^8.4.31",
|
||||
|
@ -45,7 +45,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.23.0",
|
||||
"@types/estree": "^0.0.52",
|
||||
"@vue/consolidate": "^0.17.3",
|
||||
"hash-sum": "^2.0.0",
|
||||
"lru-cache": "^10.0.1",
|
||||
|
|
|
@ -168,7 +168,13 @@ function getImportsExpressionExp(
|
|||
loc,
|
||||
ConstantTypes.CAN_STRINGIFY
|
||||
)
|
||||
context.imports.push({ exp, path })
|
||||
|
||||
// We need to ensure the path is not encoded (to %2F),
|
||||
// so we decode it back in case it is encoded
|
||||
context.imports.push({
|
||||
exp,
|
||||
path: decodeURIComponent(path)
|
||||
})
|
||||
}
|
||||
|
||||
if (!hash) {
|
||||
|
|
|
@ -124,4 +124,48 @@ describe('ssr: scopeId', () => {
|
|||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
// #7554
|
||||
test('scopeId is correctly transform to scope attribute of transition-group ', () => {
|
||||
expect(
|
||||
compile(
|
||||
`<transition-group tag="div" class="red"><span>hello</span></transition-group>`,
|
||||
{
|
||||
scopeId,
|
||||
mode: 'module'
|
||||
}
|
||||
).code
|
||||
).toMatchInlineSnapshot(`
|
||||
"import { mergeProps as _mergeProps } from \\"vue\\"
|
||||
import { ssrRenderAttrs as _ssrRenderAttrs } from \\"vue/server-renderer\\"
|
||||
|
||||
export function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_push(\`<div\${_ssrRenderAttrs(_mergeProps({ class: \\"red\\" }, _attrs))} data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></div>\`)
|
||||
}"
|
||||
`)
|
||||
|
||||
// with dynamic tag
|
||||
expect(
|
||||
compile(
|
||||
`<transition-group :tag="someTag" class="red"><span>hello</span></transition-group>`,
|
||||
{
|
||||
scopeId,
|
||||
mode: 'module'
|
||||
}
|
||||
).code
|
||||
).toMatchInlineSnapshot(`
|
||||
"import { mergeProps as _mergeProps } from \\"vue\\"
|
||||
import { ssrRenderAttrs as _ssrRenderAttrs } from \\"vue/server-renderer\\"
|
||||
|
||||
export function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_push(\`<\${
|
||||
_ctx.someTag
|
||||
}\${
|
||||
_ssrRenderAttrs(_mergeProps({ class: \\"red\\" }, _attrs))
|
||||
} data-v-xxxxxxx><span data-v-xxxxxxx>hello</span></\${
|
||||
_ctx.someTag
|
||||
}>\`)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/compiler-ssr",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/compiler-ssr",
|
||||
"main": "dist/compiler-ssr.cjs.js",
|
||||
"types": "dist/compiler-ssr.d.ts",
|
||||
|
@ -28,7 +28,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-dom": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/compiler-dom": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ const wipMap = new WeakMap<ComponentNode, WIPEntry>()
|
|||
interface WIPEntry {
|
||||
tag: AttributeNode | DirectiveNode
|
||||
propsExp: string | JSChildNode | null
|
||||
scopeId: string | null
|
||||
}
|
||||
|
||||
// phase 1: build props
|
||||
|
@ -45,7 +46,8 @@ export function ssrTransformTransitionGroup(
|
|||
}
|
||||
wipMap.set(node, {
|
||||
tag,
|
||||
propsExp
|
||||
propsExp,
|
||||
scopeId: context.scopeId || null
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +60,7 @@ export function ssrProcessTransitionGroup(
|
|||
) {
|
||||
const entry = wipMap.get(node)
|
||||
if (entry) {
|
||||
const { tag, propsExp } = entry
|
||||
const { tag, propsExp, scopeId } = entry
|
||||
if (tag.type === NodeTypes.DIRECTIVE) {
|
||||
// dynamic :tag
|
||||
context.pushStringPart(`<`)
|
||||
|
@ -66,6 +68,9 @@ export function ssrProcessTransitionGroup(
|
|||
if (propsExp) {
|
||||
context.pushStringPart(propsExp)
|
||||
}
|
||||
if (scopeId) {
|
||||
context.pushStringPart(` ${scopeId}`)
|
||||
}
|
||||
context.pushStringPart(`>`)
|
||||
|
||||
processChildren(
|
||||
|
@ -89,6 +94,9 @@ export function ssrProcessTransitionGroup(
|
|||
if (propsExp) {
|
||||
context.pushStringPart(propsExp)
|
||||
}
|
||||
if (scopeId) {
|
||||
context.pushStringPart(` ${scopeId}`)
|
||||
}
|
||||
context.pushStringPart(`>`)
|
||||
processChildren(node, context, false, true)
|
||||
context.pushStringPart(`</${tag.value!.content}>`)
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
"dependencies": {
|
||||
"vue": "workspace:*"
|
||||
},
|
||||
"version": "3.3.4"
|
||||
"version": "3.3.5"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/reactivity-transform",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/reactivity-transform",
|
||||
"main": "dist/reactivity-transform.cjs.js",
|
||||
"files": [
|
||||
|
@ -29,8 +29,8 @@
|
|||
"homepage": "https://github.com/vuejs/core/tree/dev/packages/reactivity-transform#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.0",
|
||||
"@vue/compiler-core": "3.3.4",
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-core": "3.3.5",
|
||||
"@vue/shared": "3.3.5",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.5"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/reactivity",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/reactivity",
|
||||
"main": "index.js",
|
||||
"module": "dist/reactivity.esm-bundler.js",
|
||||
|
@ -36,6 +36,6 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4"
|
||||
"@vue/shared": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,9 +134,11 @@ describe('component: slots', () => {
|
|||
}
|
||||
|
||||
const oldSlots = {
|
||||
header: 'header'
|
||||
header: 'header',
|
||||
footer: undefined
|
||||
}
|
||||
const newSlots = {
|
||||
header: undefined,
|
||||
footer: 'footer'
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,31 @@ describe('renderer: teleport', () => {
|
|||
expect(serializeInner(target)).toBe('')
|
||||
})
|
||||
|
||||
// #6347
|
||||
test('descendent component should be unmounted when teleport is disabled and unmounted', () => {
|
||||
const root = nodeOps.createElement('div')
|
||||
|
||||
const CompWithHook = {
|
||||
render() {
|
||||
return [h('p'), h('p')]
|
||||
},
|
||||
beforeUnmount: vi.fn(),
|
||||
unmounted: vi.fn()
|
||||
}
|
||||
|
||||
render(
|
||||
h(() => [h(Teleport, { to: null, disabled: true }, h(CompWithHook))]),
|
||||
root
|
||||
)
|
||||
expect(CompWithHook.beforeUnmount).toBeCalledTimes(0)
|
||||
expect(CompWithHook.unmounted).toBeCalledTimes(0)
|
||||
|
||||
render(null, root)
|
||||
|
||||
expect(CompWithHook.beforeUnmount).toBeCalledTimes(1)
|
||||
expect(CompWithHook.unmounted).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
test('multiple teleport with same target', () => {
|
||||
const target = nodeOps.createElement('div')
|
||||
const root = nodeOps.createElement('div')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/runtime-core",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/runtime-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-core.esm-bundler.js",
|
||||
|
@ -32,7 +32,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/reactivity": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/reactivity": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ export const updateSlots = (
|
|||
// delete stale slots
|
||||
if (needDeletionCheck) {
|
||||
for (const key in slots) {
|
||||
if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
|
||||
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
||||
delete slots[key]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ export const TeleportImpl = {
|
|||
parentSuspense: SuspenseBoundary | null,
|
||||
optimized: boolean,
|
||||
{ um: unmount, o: { remove: hostRemove } }: RendererInternals,
|
||||
doRemove: Boolean
|
||||
doRemove: boolean
|
||||
) {
|
||||
const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode
|
||||
|
||||
|
@ -247,20 +247,19 @@ export const TeleportImpl = {
|
|||
hostRemove(targetAnchor!)
|
||||
}
|
||||
|
||||
// an unmounted teleport should always remove its children if not disabled
|
||||
if (doRemove || !isTeleportDisabled(props)) {
|
||||
hostRemove(anchor!)
|
||||
if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
||||
for (let i = 0; i < (children as VNode[]).length; i++) {
|
||||
const child = (children as VNode[])[i]
|
||||
unmount(
|
||||
child,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
true,
|
||||
!!child.dynamicChildren
|
||||
)
|
||||
}
|
||||
// an unmounted teleport should always unmount its children whether it's disabled or not
|
||||
doRemove && hostRemove(anchor!)
|
||||
if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
||||
const shouldRemove = doRemove || !isTeleportDisabled(props)
|
||||
for (let i = 0; i < (children as VNode[]).length; i++) {
|
||||
const child = (children as VNode[])[i]
|
||||
unmount(
|
||||
child,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
shouldRemove,
|
||||
!!child.dynamicChildren
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -414,7 +413,7 @@ function updateCssVars(vnode: VNode) {
|
|||
const ctx = vnode.ctx
|
||||
if (ctx && ctx.ut) {
|
||||
let node = (vnode.children as VNode[])[0].el!
|
||||
while (node !== vnode.targetAnchor) {
|
||||
while (node && node !== vnode.targetAnchor) {
|
||||
if (node.nodeType === 1) node.setAttribute('data-v-owner', ctx.uid)
|
||||
node = node.nextSibling
|
||||
}
|
||||
|
|
|
@ -275,4 +275,22 @@ describe('useCssVars', () => {
|
|||
expect((c as HTMLElement).style.getPropertyValue(`--color`)).toBe('red')
|
||||
}
|
||||
})
|
||||
|
||||
test('with teleport(disabled)', async () => {
|
||||
document.body.innerHTML = ''
|
||||
const state = reactive({ color: 'red' })
|
||||
const root = document.createElement('div')
|
||||
const target = document.body
|
||||
|
||||
const App = {
|
||||
setup() {
|
||||
useCssVars(() => state)
|
||||
return () => [h(Teleport, { to: target, disabled: true }, [h('div')])]
|
||||
}
|
||||
}
|
||||
|
||||
expect(() => render(h(App), root)).not.toThrow(TypeError)
|
||||
await nextTick()
|
||||
expect(target.children.length).toBe(0)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/runtime-dom",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/runtime-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-dom.esm-bundler.js",
|
||||
|
@ -35,8 +35,8 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/runtime-core": "3.3.4",
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/runtime-core": "3.3.5",
|
||||
"csstype": "^3.1.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/runtime-test",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/runtime-test",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
|
@ -25,7 +25,7 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-test#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/runtime-core": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/runtime-core": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/server-renderer",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "@vue/server-renderer",
|
||||
"main": "index.js",
|
||||
"module": "dist/server-renderer.esm-bundler.js",
|
||||
|
@ -32,10 +32,10 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.3.4"
|
||||
"vue": "3.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-ssr": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/compiler-ssr": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/sfc-playground",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/shared",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "internal utils shared across @vue packages",
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.esm-bundler.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/template-explorer",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"private": true,
|
||||
"buildOptions": {
|
||||
"formats": [
|
||||
|
|
|
@ -76,8 +76,8 @@ window.init = () => {
|
|||
const compileFn = ssrMode.value ? ssrCompile : compile
|
||||
const start = performance.now()
|
||||
const { code, ast, map } = compileFn(source, {
|
||||
filename: 'ExampleTemplate.vue',
|
||||
...compilerOptions,
|
||||
filename: 'ExampleTemplate.vue',
|
||||
sourceMap: true,
|
||||
onError: err => {
|
||||
errors.push(err)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@vue/compat",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "Vue 3 compatibility build for Vue 2",
|
||||
"main": "index.js",
|
||||
"module": "dist/vue.runtime.esm-bundler.js",
|
||||
|
@ -43,6 +43,6 @@
|
|||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.3.4"
|
||||
"vue": "3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vue",
|
||||
"version": "3.3.4",
|
||||
"version": "3.3.5",
|
||||
"description": "The progressive JavaScript framework for building modern web UI.",
|
||||
"main": "index.js",
|
||||
"module": "dist/vue.runtime.esm-bundler.js",
|
||||
|
@ -96,11 +96,11 @@
|
|||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.3.4",
|
||||
"@vue/compiler-dom": "3.3.4",
|
||||
"@vue/runtime-dom": "3.3.4",
|
||||
"@vue/compiler-sfc": "3.3.4",
|
||||
"@vue/server-renderer": "3.3.4"
|
||||
"@vue/shared": "3.3.5",
|
||||
"@vue/compiler-dom": "3.3.5",
|
||||
"@vue/runtime-dom": "3.3.5",
|
||||
"@vue/compiler-sfc": "3.3.5",
|
||||
"@vue/server-renderer": "3.3.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
|
|
|
@ -162,7 +162,7 @@ importers:
|
|||
specifier: ^7.23.0
|
||||
version: 7.23.0
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
estree-walker:
|
||||
specifier: ^2.0.2
|
||||
|
@ -178,10 +178,10 @@ importers:
|
|||
packages/compiler-dom:
|
||||
dependencies:
|
||||
'@vue/compiler-core':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-core
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
|
||||
packages/compiler-sfc:
|
||||
|
@ -190,19 +190,19 @@ importers:
|
|||
specifier: ^7.23.0
|
||||
version: 7.23.0
|
||||
'@vue/compiler-core':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-core
|
||||
'@vue/compiler-dom':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-dom
|
||||
'@vue/compiler-ssr':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-ssr
|
||||
'@vue/reactivity-transform':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../reactivity-transform
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
estree-walker:
|
||||
specifier: ^2.0.2
|
||||
|
@ -220,9 +220,6 @@ importers:
|
|||
'@babel/types':
|
||||
specifier: ^7.23.0
|
||||
version: 7.23.0
|
||||
'@types/estree':
|
||||
specifier: ^0.0.52
|
||||
version: 0.0.52
|
||||
'@vue/consolidate':
|
||||
specifier: ^0.17.3
|
||||
version: 0.17.3
|
||||
|
@ -254,10 +251,10 @@ importers:
|
|||
packages/compiler-ssr:
|
||||
dependencies:
|
||||
'@vue/compiler-dom':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-dom
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
|
||||
packages/dts-test:
|
||||
|
@ -269,7 +266,7 @@ importers:
|
|||
packages/reactivity:
|
||||
dependencies:
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
|
||||
packages/reactivity-transform:
|
||||
|
@ -278,10 +275,10 @@ importers:
|
|||
specifier: ^7.23.0
|
||||
version: 7.23.0
|
||||
'@vue/compiler-core':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-core
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
estree-walker:
|
||||
specifier: ^2.0.2
|
||||
|
@ -300,19 +297,19 @@ importers:
|
|||
packages/runtime-core:
|
||||
dependencies:
|
||||
'@vue/reactivity':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../reactivity
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
|
||||
packages/runtime-dom:
|
||||
dependencies:
|
||||
'@vue/runtime-core':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../runtime-core
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
csstype:
|
||||
specifier: ^3.1.2
|
||||
|
@ -321,22 +318,22 @@ importers:
|
|||
packages/runtime-test:
|
||||
dependencies:
|
||||
'@vue/runtime-core':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../runtime-core
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
|
||||
packages/server-renderer:
|
||||
dependencies:
|
||||
'@vue/compiler-ssr':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-ssr
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
vue:
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../vue
|
||||
|
||||
packages/sfc-playground:
|
||||
|
@ -375,19 +372,19 @@ importers:
|
|||
packages/vue:
|
||||
dependencies:
|
||||
'@vue/compiler-dom':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-dom
|
||||
'@vue/compiler-sfc':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../compiler-sfc
|
||||
'@vue/runtime-dom':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../runtime-dom
|
||||
'@vue/server-renderer':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../server-renderer
|
||||
'@vue/shared':
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../shared
|
||||
typescript:
|
||||
specifier: '*'
|
||||
|
@ -405,7 +402,7 @@ importers:
|
|||
specifier: ^1.0.2
|
||||
version: 1.0.2
|
||||
vue:
|
||||
specifier: 3.3.4
|
||||
specifier: 3.3.5
|
||||
version: link:../vue
|
||||
|
||||
packages:
|
||||
|
|
Loading…
Reference in New Issue