From ca9920c7d708c9da48ef0bd116610f1ecb6b56a9 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 19 Feb 2024 16:41:21 +0800
Subject: [PATCH 01/36] chore(deps): update dependency @vue/consolidate to v1
(#10359)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 9 ++-------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 9f894fa57..26aa74f39 100644
--- a/package.json
+++ b/package.json
@@ -75,7 +75,7 @@
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-istanbul": "^1.2.2",
- "@vue/consolidate": "0.17.3",
+ "@vue/consolidate": "1.0.0",
"conventional-changelog-cli": "^4.1.0",
"enquirer": "^2.4.1",
"esbuild": "^0.20.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 22d55e7c5..011ffb266 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -57,8 +57,8 @@ importers:
specifier: ^1.2.2
version: 1.2.2(vitest@1.2.2)
'@vue/consolidate':
- specifier: 0.17.3
- version: 0.17.3
+ specifier: 1.0.0
+ version: 1.0.0
conventional-changelog-cli:
specifier: ^4.1.0
version: 4.1.0
@@ -1769,11 +1769,6 @@ packages:
pretty-format: 29.7.0
dev: true
- /@vue/consolidate@0.17.3:
- resolution: {integrity: sha512-nl0SWcTMzaaTnJ5G6V8VlMDA1CVVrNnaQKF1aBZU3kXtjgU9jtHMsEAsgjoRUx+T0EVJk9TgbmxGhK3pOk22zw==}
- engines: {node: '>= 0.12.0'}
- dev: true
-
/@vue/consolidate@1.0.0:
resolution: {integrity: sha512-oTyUE+QHIzLw2PpV14GD/c7EohDyP64xCniWTcqcEmTd699eFqTIwOmtDYjcO1j3QgdXoJEoWv1/cCdLrRoOfg==}
engines: {node: '>= 0.12.0'}
From 31991899017db5b8ca2db9a3962ab94a2fd0caf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=9F=E4=B8=96=E5=8D=9A?= <897205285@qq.com>
Date: Tue, 20 Feb 2024 21:43:45 +0800
Subject: [PATCH 02/36] chore: standardize the spelling of TypeScript (#10186)
[ci skip]
---
changelogs/CHANGELOG-3.0.md | 2 +-
packages/compiler-core/__tests__/transforms/vOn.spec.ts | 2 +-
packages/dts-test/README.md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/changelogs/CHANGELOG-3.0.md b/changelogs/CHANGELOG-3.0.md
index 50b152dc2..16483767f 100644
--- a/changelogs/CHANGELOG-3.0.md
+++ b/changelogs/CHANGELOG-3.0.md
@@ -773,7 +773,7 @@ may cause build issues in projects still using TS 3.x.
- **types:** adjust type exports for manual render function and tooling usage ([e4dc03a](https://github.com/vuejs/core/commit/e4dc03a8b17d5e9f167de6a62a645878ac7ef3e2)), closes [#1329](https://github.com/vuejs/core/issues/1329)
- **types:** mixins/extends support in TypeScript ([#626](https://github.com/vuejs/core/issues/626)) ([d3c436a](https://github.com/vuejs/core/commit/d3c436ae2e66b75b7f2ed574dadda3f0e1fdce73))
- **types:** support typing directive value via generic argument ([#1007](https://github.com/vuejs/core/issues/1007)) ([419b86d](https://github.com/vuejs/core/commit/419b86d1908f2a0521e6a7eafcbee764e9ee59a0)), closes [#998](https://github.com/vuejs/core/issues/998)
-- **types:** update to Typescript 3.9 ([#1106](https://github.com/vuejs/core/issues/1106)) ([97dedeb](https://github.com/vuejs/core/commit/97dedebd8097116a16209664a1ca38392b964da3))
+- **types:** update to TypeScript 3.9 ([#1106](https://github.com/vuejs/core/issues/1106)) ([97dedeb](https://github.com/vuejs/core/commit/97dedebd8097116a16209664a1ca38392b964da3))
### Performance Improvements
diff --git a/packages/compiler-core/__tests__/transforms/vOn.spec.ts b/packages/compiler-core/__tests__/transforms/vOn.spec.ts
index 9f5e00948..568fa0b5a 100644
--- a/packages/compiler-core/__tests__/transforms/vOn.spec.ts
+++ b/packages/compiler-core/__tests__/transforms/vOn.spec.ts
@@ -271,7 +271,7 @@ describe('compiler: transform v-on', () => {
})
})
- test('should NOT wrap as function if expression is already function expression (with Typescript)', () => {
+ test('should NOT wrap as function if expression is already function expression (with TypeScript)', () => {
const { node } = parseWithVOn(`
foo(e)"/>`)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
diff --git a/packages/dts-test/README.md b/packages/dts-test/README.md
index 197005a56..6f1b1da1d 100644
--- a/packages/dts-test/README.md
+++ b/packages/dts-test/README.md
@@ -1,6 +1,6 @@
# dts-test
-Tests Typescript types to ensure the types remain as expected.
+Tests TypeScript types to ensure the types remain as expected.
- This directory is included in the root `tsconfig.json`, where package imports are aliased to `src` directories, so in IDEs and the `pnpm check` script the types are validated against source code.
From fe5d919b0f1b235a918a720ef10a9fcbd80ae78e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?=
Date: Tue, 20 Feb 2024 21:47:09 +0800
Subject: [PATCH 03/36] refactor(sfc-playground): upgrade `@vue/repl` (#10310)
---
packages/sfc-playground/index.html | 2 -
packages/sfc-playground/package.json | 2 +-
packages/sfc-playground/src/App.vue | 113 +++++++++++--------------
packages/sfc-playground/src/Header.vue | 25 +++---
pnpm-lock.yaml | 8 +-
5 files changed, 67 insertions(+), 83 deletions(-)
diff --git a/packages/sfc-playground/index.html b/packages/sfc-playground/index.html
index 29e8d6e97..2319a9187 100644
--- a/packages/sfc-playground/index.html
+++ b/packages/sfc-playground/index.html
@@ -7,8 +7,6 @@
Vue SFC Playground
{
@reload-page="reloadPage"
/>
+import { computed } from 'vue'
+import type { ReplStore } from '@vue/repl'
import { downloadProject } from './download/download'
-import { ref } from 'vue'
import Sun from './icons/Sun.vue'
import Moon from './icons/Moon.vue'
import Share from './icons/Share.vue'
import Download from './icons/Download.vue'
import GitHub from './icons/GitHub.vue'
import Reload from './icons/Reload.vue'
-import type { ReplStore } from '@vue/repl'
import VersionSelect from './VersionSelect.vue'
const props = defineProps<{
@@ -25,23 +25,20 @@ const emit = defineEmits([
const { store } = props
const currentCommit = __COMMIT__
-const vueVersion = ref(`@${currentCommit}`)
-const vueURL = store.getImportMap().imports.vue
-if (vueURL && !vueURL.startsWith(location.origin)) {
- const versionMatch = vueURL.match(/runtime-dom@([^/]+)/)
- if (versionMatch) vueVersion.value = versionMatch[1]
-}
+const vueVersion = computed(() => {
+ if (store.loading) {
+ return 'loading...'
+ }
+ return store.vueVersion || `@${__COMMIT__}`
+})
async function setVueVersion(v: string) {
- vueVersion.value = `loading...`
- await store.setVueVersion(v)
- vueVersion.value = v
+ store.vueVersion = v
}
function resetVueVersion() {
- store.resetVueVersion()
- vueVersion.value = `@${currentCommit}`
+ store.vueVersion = null
}
async function copyLink(e: MouseEvent) {
@@ -73,7 +70,7 @@ function toggleDark() {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 011ffb266..a12747fb0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -347,8 +347,8 @@ importers:
packages/sfc-playground:
dependencies:
'@vue/repl':
- specifier: ^3.1.1
- version: 3.1.1
+ specifier: ^4.1.0
+ version: 4.1.0
file-saver:
specifier: ^2.0.5
version: 2.0.5
@@ -1774,8 +1774,8 @@ packages:
engines: {node: '>= 0.12.0'}
dev: true
- /@vue/repl@3.1.1:
- resolution: {integrity: sha512-9nJImsUeywU2MTqvzf4ueqWC49UC3LVXVPk1HmoNnLVumfWXv+w5ytuSA//fxb/N/O5vCqE0UV63/dYvnCZpwQ==}
+ /@vue/repl@4.1.0:
+ resolution: {integrity: sha512-4ZNEQWlLjl1Sq+WFiACm5siMdwUAmmqOES4XDgZRRFYeeW/BfabO9I6fpU+Y0zO9HFzKb8dwUUH0e0LK7mIYeg==}
dev: false
/@zeit/schemas@2.29.0:
From 6bef15f094c874a4dcf56f97513c852e81314ea4 Mon Sep 17 00:00:00 2001
From: Evan You
Date: Sun, 25 Feb 2024 17:29:04 +0800
Subject: [PATCH 04/36] chore: remove unused argument
---
packages/runtime-dom/src/directives/vModel.ts | 23 +++++++------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/packages/runtime-dom/src/directives/vModel.ts b/packages/runtime-dom/src/directives/vModel.ts
index b2450b3cf..9e94810d8 100644
--- a/packages/runtime-dom/src/directives/vModel.ts
+++ b/packages/runtime-dom/src/directives/vModel.ts
@@ -209,25 +209,20 @@ export const vModelSelect: ModelDirective = {
},
// set value in mounted & updated because
`)
- expect((container.firstChild as any)[vShowOldKey]).toBe('')
+ expect((container.firstChild as any)[vShowOriginalDisplay]).toBe('')
expect(vnode.el).toBe(container.firstChild)
expect(`mismatch`).not.toHaveBeenWarned()
})
diff --git a/packages/runtime-dom/src/directives/vShow.ts b/packages/runtime-dom/src/directives/vShow.ts
index 4bf6779ed..5bf48b277 100644
--- a/packages/runtime-dom/src/directives/vShow.ts
+++ b/packages/runtime-dom/src/directives/vShow.ts
@@ -1,15 +1,16 @@
import type { ObjectDirective } from '@vue/runtime-core'
-export const vShowOldKey = Symbol('_vod')
+export const vShowOriginalDisplay = Symbol('_vod')
interface VShowElement extends HTMLElement {
// _vod = vue original display
- [vShowOldKey]: string
+ [vShowOriginalDisplay]: string
}
export const vShow: ObjectDirective & { name?: 'show' } = {
beforeMount(el, { value }, { transition }) {
- el[vShowOldKey] = el.style.display === 'none' ? '' : el.style.display
+ el[vShowOriginalDisplay] =
+ el.style.display === 'none' ? '' : el.style.display
if (transition && value) {
transition.beforeEnter(el)
} else {
@@ -24,7 +25,7 @@ export const vShow: ObjectDirective & { name?: 'show' } = {
updated(el, { value, oldValue }, { transition }) {
if (
!value === !oldValue &&
- (el.style.display === el[vShowOldKey] || !value)
+ (el.style.display === el[vShowOriginalDisplay] || !value)
)
return
if (transition) {
@@ -51,7 +52,7 @@ if (__DEV__) {
}
function setDisplay(el: VShowElement, value: unknown): void {
- el.style.display = value ? el[vShowOldKey] : 'none'
+ el.style.display = value ? el[vShowOriginalDisplay] : 'none'
}
// SSR vnode transforms, only used when user includes client-oriented render
diff --git a/packages/runtime-dom/src/modules/style.ts b/packages/runtime-dom/src/modules/style.ts
index 11f7ce1c0..1f45966c3 100644
--- a/packages/runtime-dom/src/modules/style.ts
+++ b/packages/runtime-dom/src/modules/style.ts
@@ -1,6 +1,6 @@
import { capitalize, hyphenate, isArray, isString } from '@vue/shared'
import { camelize, warn } from '@vue/runtime-core'
-import { vShowOldKey } from '../directives/vShow'
+import { vShowOriginalDisplay } from '../directives/vShow'
import { CSS_VAR_TEXT } from '../helpers/useCssVars'
type Style = string | Record | null
@@ -53,8 +53,8 @@ export function patchStyle(el: Element, prev: Style, next: Style) {
// indicates that the `display` of the element is controlled by `v-show`,
// so we always keep the current `display` value regardless of the `style`
// value, thus handing over control to `v-show`.
- if (vShowOldKey in el) {
- el[vShowOldKey] = hasControlledDisplay ? style.display : ''
+ if (vShowOriginalDisplay in el) {
+ el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ''
style.display = currentDisplay
}
}
From e0e02535cdea1aeb1cfaff0d61d4b2555e555c36 Mon Sep 17 00:00:00 2001
From: Evan You
Date: Sun, 25 Feb 2024 23:04:26 +0800
Subject: [PATCH 19/36] fix(parser): should not treat uppercase components as
special tags
close #10395
---
packages/compiler-core/src/tokenizer.ts | 15 ++++++---------
packages/compiler-dom/__tests__/parse.spec.ts | 16 +++++++++++++++-
2 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/packages/compiler-core/src/tokenizer.ts b/packages/compiler-core/src/tokenizer.ts
index c63ec6bfb..561a84b5f 100644
--- a/packages/compiler-core/src/tokenizer.ts
+++ b/packages/compiler-core/src/tokenizer.ts
@@ -553,12 +553,11 @@ export default class Tokenizer {
// HTML mode
// -