This commit is contained in:
theluyuan 2022-09-13 11:03:40 +08:00
commit 88be3a2749
23 changed files with 150 additions and 140 deletions

View File

@ -1,3 +1,15 @@
## [3.2.39](https://github.com/vuejs/core/compare/v3.2.38...v3.2.39) (2022-09-08)
### Bug Fixes
* **runtime-core:** avoid double firing when mounting inside a watcher callback ([6aaf8ef](https://github.com/vuejs/core/commit/6aaf8efefffdb0d4b93f178b2bb36cd3c6bc31b8)), closes [#6614](https://github.com/vuejs/core/issues/6614)
* **runtime-core:** support extends template for runtime compiler ([#6250](https://github.com/vuejs/core/issues/6250)) ([9875ecd](https://github.com/vuejs/core/commit/9875ecd762155732008e397d450edb0f8c01b05c)), closes [#6249](https://github.com/vuejs/core/issues/6249)
* **ssr:** reset current instance ([#6184](https://github.com/vuejs/core/issues/6184)) ([6493da5](https://github.com/vuejs/core/commit/6493da5bfa4624267248deb3d31dca2a4fb22aee)), closes [#6110](https://github.com/vuejs/core/issues/6110)
* **types:** support TypeScript 4.8 ([5381abc](https://github.com/vuejs/core/commit/5381abc0571e58a9be6cf482dc50c8db8300f86c)), closes [#6554](https://github.com/vuejs/core/issues/6554)
## [3.2.38](https://github.com/vuejs/core/compare/v3.2.37...v3.2.38) (2022-08-30)

View File

@ -1,6 +1,6 @@
{
"private": true,
"version": "3.2.38",
"version": "3.2.39",
"packageManager": "pnpm@7.1.0",
"scripts": {
"dev": "node scripts/dev.js",

View File

@ -1,6 +1,6 @@
{
"name": "@vue/compiler-core",
"version": "3.2.38",
"version": "3.2.39",
"description": "@vue/compiler-core",
"main": "index.js",
"module": "dist/compiler-core.esm-bundler.js",
@ -32,7 +32,7 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
"dependencies": {
"@vue/shared": "3.2.38",
"@vue/shared": "3.2.39",
"@babel/parser": "^7.16.4",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"

View File

@ -1,6 +1,6 @@
{
"name": "@vue/compiler-dom",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38",
"@vue/compiler-core": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/compiler-core": "3.2.39"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@vue/compiler-sfc",
"version": "3.2.38",
"version": "3.2.39",
"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.16.4",
"@vue/compiler-core": "3.2.38",
"@vue/compiler-dom": "3.2.38",
"@vue/compiler-ssr": "3.2.38",
"@vue/reactivity-transform": "3.2.38",
"@vue/shared": "3.2.38",
"@vue/compiler-core": "3.2.39",
"@vue/compiler-dom": "3.2.39",
"@vue/compiler-ssr": "3.2.39",
"@vue/reactivity-transform": "3.2.39",
"@vue/shared": "3.2.39",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7",
"source-map": "^0.6.1",

View File

@ -1,6 +1,6 @@
{
"name": "@vue/compiler-ssr",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38",
"@vue/compiler-dom": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/compiler-dom": "3.2.39"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@vue/reactivity-transform",
"version": "3.2.38",
"version": "3.2.39",
"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.16.4",
"@vue/compiler-core": "3.2.38",
"@vue/shared": "3.2.38",
"@vue/compiler-core": "3.2.39",
"@vue/shared": "3.2.39",
"estree-walker": "^2.0.2",
"magic-string": "^0.25.7"
},

View File

@ -1,6 +1,6 @@
{
"name": "@vue/reactivity",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38"
"@vue/shared": "3.2.39"
}
}

View File

@ -534,4 +534,16 @@ describe('scheduler', () => {
// should not be called
expect(spy).toHaveBeenCalledTimes(0)
})
it('flushPreFlushCbs inside a pre job', async () => {
const spy = jest.fn()
const job = () => {
spy()
flushPreFlushCbs()
}
job.pre = true
queueJob(job)
await nextTick()
expect(spy).toHaveBeenCalledTimes(1)
})
})

View File

@ -1,6 +1,6 @@
{
"name": "@vue/runtime-core",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38",
"@vue/reactivity": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/reactivity": "3.2.39"
}
}

View File

@ -133,7 +133,11 @@ export function queuePostFlushCb(cb: SchedulerJobs) {
queueFlush()
}
export function flushPreFlushCbs(seen?: CountMap, i = flushIndex) {
export function flushPreFlushCbs(
seen?: CountMap,
// if currently flushing, skip the current job itself
i = isFlushing ? flushIndex + 1 : 0
) {
if (__DEV__) {
seen = seen || new Map()
}

View File

@ -1,6 +1,6 @@
{
"name": "@vue/runtime-dom",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38",
"@vue/runtime-core": "3.2.38",
"@vue/shared": "3.2.39",
"@vue/runtime-core": "3.2.39",
"csstype": "^2.6.8"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@vue/runtime-test",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38",
"@vue/runtime-core": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/runtime-core": "3.2.39"
}
}

View File

@ -20,7 +20,8 @@ import {
resolveDynamicComponent,
renderSlot,
onErrorCaptured,
onServerPrefetch
onServerPrefetch,
getCurrentInstance
} from 'vue'
import { escapeHtml } from '@vue/shared'
import { renderToString } from '../src/renderToString'
@ -779,6 +780,23 @@ function testRender(type: string, render: typeof renderToString) {
).toHaveBeenWarned()
expect(`Element is missing end tag`).toHaveBeenWarned()
})
// #6110
test('reset current instance after rendering error', async () => {
const prev = getCurrentInstance()
expect(prev).toBe(null)
try {
await render(
createApp({
data() {
return { msg: null }
},
template: `<div>{{ msg.text }}</div>`
})
)
} catch {}
expect(getCurrentInstance()).toBe(prev)
})
})
test('serverPrefetch', async () => {

View File

@ -1,6 +1,6 @@
{
"name": "@vue/server-renderer",
"version": "3.2.38",
"version": "3.2.39",
"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.2.38"
"vue": "3.2.39"
},
"dependencies": {
"@vue/shared": "3.2.38",
"@vue/compiler-ssr": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/compiler-ssr": "3.2.39"
}
}

View File

@ -174,18 +174,21 @@ function renderComponentSubTree(
// set current rendering instance for asset resolution
const prev = setCurrentRenderingInstance(instance)
ssrRender(
instance.proxy,
push,
instance,
attrs,
// compiler-optimized bindings
instance.props,
instance.setupState,
instance.data,
instance.ctx
)
setCurrentRenderingInstance(prev)
try {
ssrRender(
instance.proxy,
push,
instance,
attrs,
// compiler-optimized bindings
instance.props,
instance.setupState,
instance.data,
instance.ctx
)
} finally {
setCurrentRenderingInstance(prev)
}
} else if (instance.render && instance.render !== NOOP) {
renderVNode(
push,

View File

@ -1,6 +1,6 @@
{
"name": "@vue/sfc-playground",
"version": "3.2.38",
"version": "3.2.39",
"private": true,
"scripts": {
"dev": "vite",
@ -8,11 +8,11 @@
"serve": "vite preview"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.10.2",
"vite": "^2.9.8"
"@vitejs/plugin-vue": "^3.0.0",
"vite": "^3.0.0"
},
"dependencies": {
"vue": "3.2.38",
"vue": "3.2.39",
"@vue/repl": "^1.3.0",
"file-saver": "^2.0.5",
"jszip": "^3.6.0"

View File

@ -1,6 +1,6 @@
{
"name": "@vue/shared",
"version": "3.2.38",
"version": "3.2.39",
"description": "internal utils shared across @vue packages",
"main": "index.js",
"module": "dist/shared.esm-bundler.js",

View File

@ -1,6 +1,6 @@
{
"name": "@vue/size-check",
"version": "3.2.38",
"version": "3.2.39",
"private": true,
"scripts": {
"build": "vite build"

View File

@ -1,6 +1,6 @@
{
"name": "@vue/template-explorer",
"version": "3.2.38",
"version": "3.2.39",
"private": true,
"buildOptions": {
"formats": [

View File

@ -1,6 +1,6 @@
{
"name": "@vue/compat",
"version": "3.2.38",
"version": "3.2.39",
"description": "Vue 3 compatibility build for Vue 2",
"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
@ -38,6 +38,6 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue-compat#readme",
"peerDependencies": {
"vue": "3.2.38"
"vue": "3.2.39"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "vue",
"version": "3.2.38",
"version": "3.2.39",
"description": "The progressive JavaScript framework for building modern web UI.",
"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
@ -68,10 +68,10 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/vue#readme",
"dependencies": {
"@vue/shared": "3.2.38",
"@vue/compiler-dom": "3.2.38",
"@vue/runtime-dom": "3.2.38",
"@vue/compiler-sfc": "3.2.38",
"@vue/server-renderer": "3.2.38"
"@vue/shared": "3.2.39",
"@vue/compiler-dom": "3.2.39",
"@vue/runtime-dom": "3.2.39",
"@vue/compiler-sfc": "3.2.39",
"@vue/server-renderer": "3.2.39"
}
}

View File

@ -106,7 +106,7 @@ importers:
specifiers:
'@babel/parser': ^7.16.4
'@babel/types': ^7.16.0
'@vue/shared': 3.2.38
'@vue/shared': 3.2.39
estree-walker: ^2.0.2
source-map: ^0.6.1
dependencies:
@ -119,8 +119,8 @@ importers:
packages/compiler-dom:
specifiers:
'@vue/compiler-core': 3.2.38
'@vue/shared': 3.2.38
'@vue/compiler-core': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/compiler-core': link:../compiler-core
'@vue/shared': link:../shared
@ -131,12 +131,12 @@ importers:
'@babel/types': ^7.16.0
'@types/estree': ^0.0.48
'@types/lru-cache': ^5.1.0
'@vue/compiler-core': 3.2.38
'@vue/compiler-dom': 3.2.38
'@vue/compiler-ssr': 3.2.38
'@vue/compiler-core': 3.2.39
'@vue/compiler-dom': 3.2.39
'@vue/compiler-ssr': 3.2.39
'@vue/consolidate': ^0.17.3
'@vue/reactivity-transform': 3.2.38
'@vue/shared': 3.2.38
'@vue/reactivity-transform': 3.2.39
'@vue/shared': 3.2.39
estree-walker: ^2.0.2
hash-sum: ^2.0.0
lru-cache: ^5.1.1
@ -174,15 +174,15 @@ importers:
packages/compiler-ssr:
specifiers:
'@vue/compiler-dom': 3.2.38
'@vue/shared': 3.2.38
'@vue/compiler-dom': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/compiler-dom': link:../compiler-dom
'@vue/shared': link:../shared
packages/reactivity:
specifiers:
'@vue/shared': 3.2.38
'@vue/shared': 3.2.39
dependencies:
'@vue/shared': link:../shared
@ -191,8 +191,8 @@ importers:
'@babel/core': ^7.16.0
'@babel/parser': ^7.16.4
'@babel/types': ^7.16.0
'@vue/compiler-core': 3.2.38
'@vue/shared': 3.2.38
'@vue/compiler-core': 3.2.39
'@vue/shared': 3.2.39
estree-walker: ^2.0.2
magic-string: ^0.25.7
dependencies:
@ -207,16 +207,16 @@ importers:
packages/runtime-core:
specifiers:
'@vue/reactivity': 3.2.38
'@vue/shared': 3.2.38
'@vue/reactivity': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/reactivity': link:../reactivity
'@vue/shared': link:../shared
packages/runtime-dom:
specifiers:
'@vue/runtime-core': 3.2.38
'@vue/shared': 3.2.38
'@vue/runtime-core': 3.2.39
'@vue/shared': 3.2.39
csstype: ^2.6.8
dependencies:
'@vue/runtime-core': link:../runtime-core
@ -225,36 +225,36 @@ importers:
packages/runtime-test:
specifiers:
'@vue/runtime-core': 3.2.38
'@vue/shared': 3.2.38
'@vue/runtime-core': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/runtime-core': link:../runtime-core
'@vue/shared': link:../shared
packages/server-renderer:
specifiers:
'@vue/compiler-ssr': 3.2.38
'@vue/shared': 3.2.38
'@vue/compiler-ssr': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/compiler-ssr': link:../compiler-ssr
'@vue/shared': link:../shared
packages/sfc-playground:
specifiers:
'@vitejs/plugin-vue': ^1.10.2
'@vitejs/plugin-vue': ^3.0.0
'@vue/repl': ^1.3.0
file-saver: ^2.0.5
jszip: ^3.6.0
vite: ^2.9.8
vue: 3.2.38
vite: ^3.0.0
vue: 3.2.39
dependencies:
'@vue/repl': 1.3.0_vue@packages+vue
file-saver: 2.0.5
jszip: 3.7.1
vue: link:../vue
devDependencies:
'@vitejs/plugin-vue': 1.10.2_vite@2.9.8
vite: 2.9.8
'@vitejs/plugin-vue': 3.1.0_yvvbnwjsosvjg6n7dkt3ewqphy
vite: 3.0.9
packages/shared:
specifiers: {}
@ -272,11 +272,11 @@ importers:
packages/vue:
specifiers:
'@vue/compiler-dom': 3.2.38
'@vue/compiler-sfc': 3.2.38
'@vue/runtime-dom': 3.2.38
'@vue/server-renderer': 3.2.38
'@vue/shared': 3.2.38
'@vue/compiler-dom': 3.2.39
'@vue/compiler-sfc': 3.2.39
'@vue/runtime-dom': 3.2.39
'@vue/server-renderer': 3.2.39
'@vue/shared': 3.2.39
dependencies:
'@vue/compiler-dom': link:../compiler-dom
'@vue/compiler-sfc': link:../compiler-sfc
@ -1344,13 +1344,15 @@ packages:
eslint-visitor-keys: 3.3.0
dev: true
/@vitejs/plugin-vue/1.10.2_vite@2.9.8:
resolution: {integrity: sha512-/QJ0Z9qfhAFtKRY+r57ziY4BSbGUTGsPRMpB/Ron3QPwBZM4OZAZHdTa4a8PafCwU5DTatXG8TMDoP8z+oDqJw==}
engines: {node: '>=12.0.0'}
/@vitejs/plugin-vue/3.1.0_yvvbnwjsosvjg6n7dkt3ewqphy:
resolution: {integrity: sha512-fmxtHPjSOEIRg6vHYDaem+97iwCUg/uSIaTzp98lhELt2ISOQuDo2hbkBdXod0g15IhfPMQmAxh4heUks2zvDA==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^2.5.10
vite: ^3.0.0
vue: ^3.2.25
dependencies:
vite: 2.9.8
vite: 3.0.9
vue: link:packages/vue
dev: true
/@vue/consolidate/0.17.3:
@ -5805,15 +5807,6 @@ packages:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
dev: true
/postcss/8.4.13:
resolution: {integrity: sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.4
picocolors: 1.0.0
source-map-js: 1.0.2
dev: true
/postcss/8.4.16:
resolution: {integrity: sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==}
engines: {node: ^10 || ^12 || >=14}
@ -6259,7 +6252,7 @@ packages:
resolution: {integrity: sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==}
hasBin: true
dependencies:
is-core-module: 2.8.1
is-core-module: 2.10.0
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
dev: true
@ -6389,14 +6382,6 @@ packages:
fsevents: 2.3.2
dev: true
/rollup/2.61.1:
resolution: {integrity: sha512-BbTXlEvB8d+XFbK/7E5doIcRtxWPRiqr0eb5vQ0+2paMM04Ye4PZY5nHOQef2ix24l/L0SpLd5hwcH15QHPdvA==}
engines: {node: '>=10.0.0'}
hasBin: true
optionalDependencies:
fsevents: 2.3.2
dev: true
/rollup/2.77.3:
resolution: {integrity: sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==}
engines: {node: '>=10.0.0'}
@ -7222,30 +7207,6 @@ packages:
engines: {node: '>= 0.8'}
dev: true
/vite/2.9.8:
resolution: {integrity: sha512-zsBGwn5UT3YS0NLSJ7hnR54+vUKfgzMUh/Z9CxF1YKEBVIe213+63jrFLmZphgGI5zXwQCSmqIdbPuE8NJywPw==}
engines: {node: '>=12.2.0'}
hasBin: true
peerDependencies:
less: '*'
sass: '*'
stylus: '*'
peerDependenciesMeta:
less:
optional: true
sass:
optional: true
stylus:
optional: true
dependencies:
esbuild: 0.14.35
postcss: 8.4.13
resolve: 1.22.0
rollup: 2.61.1
optionalDependencies:
fsevents: 2.3.2
dev: true
/vite/3.0.9:
resolution: {integrity: sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==}
engines: {node: ^14.18.0 || >=16.0.0}