Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump vue to 3.3 #1327

Merged
merged 3 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
__VUE_HMR_RUNTIME__: 'readonly',
__VUE_OPTIONS_API__: 'readonly',
__VUE_PROD_DEVTOOLS__: 'readonly',
// workaround for vue3.3 slots, should be removed once eslint-plugin-vue supports this
defineSlots: 'readonly',
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@vuepress/utils": "workspace:*",
"anywhere": "^1.6.0",
"sass-loader": "^13.2.2",
"vue": "^3.2.47"
"vue": "^3.3.1"
}
}
4 changes: 2 additions & 2 deletions ecosystem/plugin-active-header-links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@vuepress/core": "workspace:*",
"@vuepress/utils": "workspace:*",
"ts-debounce": "^4.0.0",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-back-to-top/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@vuepress/core": "workspace:*",
"@vuepress/utils": "workspace:*",
"ts-debounce": "^4.0.0",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions ecosystem/plugin-docsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@vuepress/utils": "workspace:*",
"@vueuse/core": "^10.1.2",
"ts-debounce": "^4.0.0",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-external-link-icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@vuepress/markdown": "workspace:*",
"@vuepress/shared": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-medium-zoom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@vuepress/core": "workspace:*",
"@vuepress/utils": "workspace:*",
"medium-zoom": "^1.0.8",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions ecosystem/plugin-nprogress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@vuepress/client": "workspace:*",
"@vuepress/core": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-pwa-popup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@vuepress/plugin-pwa": "workspace:*",
"@vuepress/shared": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@vuepress/utils": "workspace:*",
"mitt": "^3.0.0",
"register-service-worker": "^1.7.2",
"vue": "^3.2.47",
"vue": "^3.3.1",
"workbox-build": "^6.5.4"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions ecosystem/plugin-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@vuepress/shared": "workspace:*",
"@vuepress/utils": "workspace:*",
"chokidar": "^3.5.3",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/plugin-theme-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@vuepress/core": "workspace:*",
"@vuepress/shared": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions ecosystem/plugin-toc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@vuepress/client": "workspace:*",
"@vuepress/core": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions ecosystem/theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
"@vuepress/utils": "workspace:*",
"@vueuse/core": "^10.1.2",
"sass": "^1.62.1",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"sass-loader": "^13.2.2",
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"peerDependencies": {
"sass-loader": "^13.2.1"
Expand Down
5 changes: 5 additions & 0 deletions ecosystem/theme-default/src/client/components/AutoLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ const props = defineProps({
},
})

defineSlots<{
before?: (props: Record<never, never>) => any
after?: (props: Record<never, never>) => any
}>()

const route = useRoute()
const site = useSiteData()
const { item } = toRefs(props)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script setup lang="ts">
defineSlots<{
default?: (props: Record<never, never>) => any
}>()

const setHeight = (items): void => {
// explicitly set height so that it can be transitioned
items.style.height = items.scrollHeight + 'px'
Expand Down
9 changes: 8 additions & 1 deletion ecosystem/theme-default/src/client/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import {
useUpdateDeviceStatus,
} from '../composables/index.js'

defineEmits(['toggle-sidebar'])
defineEmits<{
(e: 'toggle-sidebar'): void
}>()

defineSlots<{
Mister-Hope marked this conversation as resolved.
Show resolved Hide resolved
before?: (props: Record<never, never>) => any
after?: (props: Record<never, never>) => any
}>()

const themeLocale = useThemeLocaleData()

Expand Down
7 changes: 7 additions & 0 deletions ecosystem/theme-default/src/client/components/Page.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<script setup lang="ts">
import PageMeta from '@theme/PageMeta.vue'
import PageNav from '@theme/PageNav.vue'

defineSlots<{
'top'?: (props: Record<never, never>) => any
Copy link
Member

@meteorlxy meteorlxy May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to avoid/simplify those verbose Record<never, never> and any ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently volar complains if props are not provided, the any is expected.

See https://blog.vuejs.org/posts/vue-3-3#typed-slots-with-defineslots and vuejs/core#7982

'bottom'?: (props: Record<never, never>) => any
'content-top'?: (props: Record<never, never>) => any
'content-bottom'?: (props: Record<never, never>) => any
}>()
</script>

<template>
Expand Down
5 changes: 5 additions & 0 deletions ecosystem/theme-default/src/client/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<script setup lang="ts">
import NavbarItems from '@theme/NavbarItems.vue'
import SidebarItems from '@theme/SidebarItems.vue'

defineSlots<{
top?: (props: Record<never, never>) => any
bottom?: (props: Record<never, never>) => any
}>()
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { useThemeLocaleData } from '../composables/index.js'

defineEmits(['toggle'])
defineEmits<{
(e: 'toggle'): void
}>()

const themeLocale = useThemeLocaleData()
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ defineProps({
default: undefined,
},
})

defineSlots<{
default?: () => any
}>()
</script>

<template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { defineComponent, h, onBeforeUpdate, ref } from 'vue'
import type { Component, VNode } from 'vue'
import type { Component, SlotsType, VNode } from 'vue'

export const CodeGroup = defineComponent({
name: 'CodeGroup',

slots: Object as SlotsType<{
default: () => VNode[]
}>,

setup(_, { slots }) {
// index of current active item
const activeIndex = ref(-1)
Expand Down
14 changes: 14 additions & 0 deletions ecosystem/theme-default/src/client/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ import {
useThemeLocaleData,
} from '../composables/index.js'

defineSlots<{
'navbar'?: (props: Record<never, never>) => any
'navbar-before'?: (props: Record<never, never>) => any
'navbar-after'?: (props: Record<never, never>) => any
'sidebar'?: (props: Record<never, never>) => any
'sidebar-top'?: (props: Record<never, never>) => any
'sidebar-bottom'?: (props: Record<never, never>) => any
'page'?: (props: Record<never, never>) => any
'page-top'?: (props: Record<never, never>) => any
'page-bottom'?: (props: Record<never, never>) => any
'page-content-top'?: (props: Record<never, never>) => any
'page-content-bottom'?: (props: Record<never, never>) => any
}>()

const page = usePageData()
const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
const themeLocale = useThemeLocaleData()
Expand Down
5 changes: 3 additions & 2 deletions ecosystem/vuepress-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
"@vuepress/bundler-vite": "workspace:*",
"@vuepress/cli": "workspace:*",
"@vuepress/core": "workspace:*",
"@vuepress/theme-default": "workspace:*"
"@vuepress/theme-default": "workspace:*",
"vue": "^3.3.1"
},
"devDependencies": {
"@vuepress/client": "workspace:*"
},
"peerDependencies": {
"@vuepress/client": "workspace:*",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"engines": {
"node": ">=16.19.0"
Expand Down
5 changes: 3 additions & 2 deletions ecosystem/vuepress-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
"@vuepress/cli": "workspace:*",
"@vuepress/core": "workspace:*",
"@vuepress/theme-default": "workspace:*",
"sass-loader": "^13.2.2"
"sass-loader": "^13.2.2",
"vue": "^3.3.1"
},
"peerDependencies": {
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"engines": {
"node": ">=16.19.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/bundler-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"clean": "rimraf dist"
},
"dependencies": {
"@vitejs/plugin-vue": "^4.2.1",
"@vitejs/plugin-vue": "^4.2.2",
"@vuepress/client": "workspace:*",
"@vuepress/core": "workspace:*",
"@vuepress/shared": "workspace:*",
Expand All @@ -44,8 +44,8 @@
"postcss-load-config": "^4.0.1",
"rollup": "^3.21.6",
"vite": "~4.3.5",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions packages/bundler-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"postcss-csso": "^6.0.1",
"postcss-loader": "^7.3.0",
"style-loader": "^3.3.2",
"vue": "^3.2.47",
"vue-loader": "^17.1.0",
"vue-router": "^4.1.6",
"webpack": "^5.82.0",
"vue": "^3.3.1",
"vue-loader": "^17.1.1",
"vue-router": "^4.2.0",
"webpack": "^5.82.1",
"webpack-chain": "^6.5.1",
"webpack-dev-server": "^4.15.0",
"webpack-merge": "^5.8.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"dependencies": {
"@vue/devtools-api": "^6.5.0",
"@vuepress/shared": "workspace:*",
"vue": "^3.2.47",
"vue-router": "^4.1.6"
"vue": "^3.3.1",
"vue-router": "^4.2.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@vuepress/markdown": "workspace:*",
"@vuepress/shared": "workspace:*",
"@vuepress/utils": "workspace:*",
"vue": "^3.2.47"
"vue": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@mdit-vue/types": "^0.12.0",
"@vue/shared": "^3.2.47"
"@vue/shared": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
Loading