Merge remote-tracking branch 'upstream/main'

This commit is contained in:
三咲智子 Kevin Deng 2024-02-23 13:45:07 +08:00
commit 7aae631d8c
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
8 changed files with 17 additions and 35 deletions

View File

@ -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

View File

@ -76,7 +76,7 @@
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-istanbul": "^1.2.2",
"@vitest/ui": "^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",

View File

@ -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(`<div @click="(e: any): any => foo(e)"/>`)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [

View File

@ -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.

View File

@ -7,8 +7,6 @@
<link rel="icon" type="image/svg" href="/logo.svg" />
<title>Vue SFC Playground</title>
<script>
// process shim for old versions of @vue/compiler-sfc dependency
window.process = { env: {} }
const savedPreferDark = localStorage.getItem('vue-sfc-playground-prefer-dark')
if (
savedPreferDark === 'true' ||

View File

@ -13,7 +13,7 @@
"vite": "^5.0.12"
},
"dependencies": {
"@vue/repl": "^4.0.0",
"@vue/repl": "^4.1.0",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"vue": "workspace:*"

View File

@ -10,23 +10,10 @@ import {
StoreState,
ImportMap,
} from '@vue/repl'
import type Monaco from '@vue/repl/monaco-editor'
import type CodeMirror from '@vue/repl/codemirror-editor'
import { ref, watchEffect, onMounted, computed, shallowRef, watch } from 'vue'
import Monaco from '@vue/repl/monaco-editor'
import { ref, watchEffect, onMounted, computed, watch } from 'vue'
import welcomeSFC from './welcome.vue?raw'
const EditorComponent = shallowRef<typeof Monaco | typeof CodeMirror>()
if (import.meta.env.DEV) {
import('@vue/repl/codemirror-editor').then(
mod => (EditorComponent.value = mod.default),
)
} else {
import('@vue/repl/monaco-editor').then(
mod => (EditorComponent.value = mod.default),
)
}
const replRef = ref<InstanceType<typeof Repl>>()
const setVH = () => {
@ -186,6 +173,9 @@ function toggleTheme(isDark: boolean) {
onMounted(() => {
const cls = document.documentElement.classList
toggleTheme(cls.contains('dark'))
// @ts-expect-error process shim for old versions of @vue/compiler-sfc dependency
window.process = { env: {} }
})
</script>
@ -202,10 +192,9 @@ onMounted(() => {
@reload-page="reloadPage"
/>
<Repl
v-if="EditorComponent"
ref="replRef"
:theme="theme"
:editor="EditorComponent"
:editor="Monaco"
@keydown.ctrl.s.prevent
@keydown.meta.s.prevent
:ssr="useSSRMode"

View File

@ -60,8 +60,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
@ -374,8 +374,8 @@ importers:
packages/sfc-playground:
dependencies:
'@vue/repl':
specifier: ^4.0.0
version: 4.0.0
specifier: ^4.1.0
version: 4.1.0
file-saver:
specifier: ^2.0.5
version: 2.0.5
@ -1891,18 +1891,13 @@ packages:
vue: link:packages/vue
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'}
dev: true
/@vue/repl@4.0.0:
resolution: {integrity: sha512-/C4moGPnuc/t7JdBdEAOn/9MkdLH0KzY8zhZN33gfKY6E7ln0I2umsTjQAxvjTFuPS01oAOlATvaWz5cW8HLgQ==}
/@vue/repl@4.1.0:
resolution: {integrity: sha512-4ZNEQWlLjl1Sq+WFiACm5siMdwUAmmqOES4XDgZRRFYeeW/BfabO9I6fpU+Y0zO9HFzKb8dwUUH0e0LK7mIYeg==}
dev: false
/@vueuse/core@10.7.2(vue@packages+vue):