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

chore: bump to vue v3.2.34 #1510

Merged
merged 5 commits into from May 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -34,9 +34,9 @@
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"@vue/babel-plugin-jsx": "^1.1.1",
"@vue/compat": "3.2.33",
"@vue/compiler-dom": "3.2.33",
"@vue/compiler-sfc": "3.2.33",
"@vue/compat": "3.2.34",
"@vue/compiler-dom": "3.2.34",
"@vue/compiler-sfc": "3.2.34",
"@vue/vue3-jest": "27.0.0-alpha.4",
"babel-jest": "27.5.1",
"babel-preset-jest": "28.0.2",
Expand All @@ -57,7 +57,7 @@
"tslib": "2.4.0",
"typescript": "4.6.4",
"vitepress": "^0.22.4",
"vue": "3.2.33",
"vue": "3.2.34",
"vue-class-component": "^8.0.0-rc.1",
"vue-jest": "^5.0.0-alpha.10",
"vue-router": "^4.0.15",
Expand Down
4 changes: 4 additions & 0 deletions src/baseWrapper.ts
@@ -1,6 +1,7 @@
import { textContent } from './utils'
import type { TriggerOptions } from './createDomEvent'
import {
Component,
ComponentInternalInstance,
ComponentPublicInstance,
FunctionalComponent,
Expand Down Expand Up @@ -115,6 +116,9 @@ export default abstract class BaseWrapper<ElementType extends Node>
findComponent<T extends ComponentPublicInstance>(
selector: T | FindComponentSelector
): VueWrapper<T>
// Find my CatchAll component
findComponent<T extends Component>(selector: T): DOMWrapper<Node>
findComponent<T extends Component>(selector: string): DOMWrapper<Element>
Copy link
Member

Choose a reason for hiding this comment

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

This is a more generic way to catch components, I've removed the other findComponent overloads and the tests still passed, still not sure if removing the other overloads would cause an issue

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't these methods return a VueWrapper<T>?

Copy link
Member

Choose a reason for hiding this comment

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

Yes 🤦

// catch all declaration
findComponent<T extends never>(selector: FindComponentSelector): WrapperLike

Expand Down
9 changes: 8 additions & 1 deletion src/mount.ts
Expand Up @@ -20,6 +20,7 @@ import {
EmitsOptions,
ComputedOptions,
ComponentPropsOptions,
ComponentProvideOptions,
ComponentOptions,
ConcreteComponent,
Prop
Expand Down Expand Up @@ -129,6 +130,8 @@ export function mount<
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
Provide extends ComponentProvideOptions = ComponentProvideOptions,
RawOptions extends {} = {},
PP = PublicProps,
Props = Readonly<ExtractPropTypes<PropsOrPropOptions>>,
Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>
Expand All @@ -143,6 +146,8 @@ export function mount<
Extends,
E,
EE,
Provide,
RawOptions,
PP,
Props,
Defaults
Expand All @@ -164,6 +169,8 @@ export function mount<
Extends,
E,
EE,
Provide,
RawOptions,
PP,
Props,
Defaults
Expand Down Expand Up @@ -273,7 +280,7 @@ export function mount(
inputComponent: any,
options?: MountingOptions<any> & Record<string, any>
): VueWrapper<any> {
// normalise the incoming component
// normalize the incoming component
const originalComponent = unwrapLegacyVueExtendComponent(inputComponent)
let component: ConcreteComponent
const instanceOptions = getInstanceOptions(options ?? {})
Expand Down
3 changes: 2 additions & 1 deletion tests/features/compat.spec.ts
Expand Up @@ -3,7 +3,8 @@ import { mount } from '../../src'

jest.mock('vue', () => mockVue)

const { configureCompat, extend, defineComponent, h } = mockVue as any

const { configureCompat, extend, defineComponent, h } = mockVue

describe('@vue/compat build', () => {
describe.each(['suppress-warning', false])(
Expand Down
4 changes: 2 additions & 2 deletions tests/mountingOptions/mocks.spec.ts
Expand Up @@ -38,10 +38,10 @@ describe('mocks', () => {
</div>
`,
computed: {
url() {
url(): string {
return `/posts/${this.$route.params.id}`
},
id() {
id(): string | string[] {
return this.$route.params.id
Comment on lines -41 to 45
Copy link
Member

Choose a reason for hiding this comment

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

Concerned about this change, not 100% sure what's happening here

Copy link
Member

Choose a reason for hiding this comment

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

route.params[key] is typed like this

image

What is your concern?

Copy link
Member Author

Choose a reason for hiding this comment

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

The concern is that we shouldn't have to explicitly specify the type: the inference is somehow broken with V3.2.34

Copy link
Member

Choose a reason for hiding this comment

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

Having to annotate the return type is something is there since V2, but this is not an issue with Vue test utils, is more a concern with Vue 3.2.34 release, all good on test utils IMO

}
},
Expand Down
5 changes: 5 additions & 0 deletions types/compat.d.ts
@@ -1,3 +1,8 @@
declare module '@vue/compat' {
export * from 'vue'
export function extend<T>(options: T): T

export function configureCompat(
option: Record<string, boolean | string | number>
): void
}
144 changes: 72 additions & 72 deletions yarn.lock
Expand Up @@ -1744,10 +1744,10 @@
html-tags "^3.1.0"
svg-tags "^1.0.0"

"@vue/compat@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/compat/-/compat-3.2.33.tgz#d7080bf24247e730fe9c33e9782ae4fba66ec347"
integrity sha512-8g2W2Na+vEKq9dhj/OkfesgSdr8kXx7ehC1tPCngGq1MD/Q6Q0ydnpcD0sNaGFP4R/8Zccp0LIpMSnj8qKGXBQ==
"@vue/compat@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/compat/-/compat-3.2.34.tgz#481e762948c788149ee97cf1dce38572e94f8ef1"
integrity sha512-FYPfdmZefzWoOO7wtNm9mxTHL3nZNAGNrac55BvEARZagphXGKXyvOHWDAWpdxWHCyGDLNaRGW5ZFAd0RO1XYQ==

"@vue/compiler-core@3.2.31", "@vue/compiler-core@^3.2.31":
version "3.2.31"
Expand All @@ -1759,13 +1759,13 @@
estree-walker "^2.0.2"
source-map "^0.6.1"

"@vue/compiler-core@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.33.tgz#e915d59cce85898f5c5cfebe4c09e539278c3d59"
integrity sha512-AAmr52ji3Zhk7IKIuigX2osWWsb2nQE5xsdFYjdnmtQ4gymmqXbjLvkSE174+fF3A3kstYrTgGkqgOEbsdLDpw==
"@vue/compiler-core@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.34.tgz#e28fe9d2b22dcb60274daea6df07e653d8a3ecbe"
integrity sha512-Y53lv04ZhDfqflhk4yEgBZrCL1RipbxqmqJFfl1PRkjOzt0bvJpf1sCNN81QNfXohVwFGf+Hng2ztwLwOZgbuA==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/shared" "3.2.33"
"@vue/shared" "3.2.34"
estree-walker "^2.0.2"
source-map "^0.6.1"

Expand All @@ -1777,25 +1777,25 @@
"@vue/compiler-core" "3.2.31"
"@vue/shared" "3.2.31"

"@vue/compiler-dom@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.33.tgz#6db84296f949f18e5d3e7fd5e80f943dbed7d5ec"
integrity sha512-GhiG1C8X98Xz9QUX/RlA6/kgPBWJkjq0Rq6//5XTAGSYrTMBgcLpP9+CnlUg1TFxnnCVughAG+KZl28XJqw8uQ==
"@vue/compiler-dom@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.34.tgz#3aadd83fd789c7feaa56f838e86c5c7146395579"
integrity sha512-MFLUYDgy0aES9x1goU/pgxpzgT9IZOndO8qwQVSyVfUvl/CywEBtfBi5+8fsiBDhoGIT7g8qcsUUF1NYViU2vQ==
dependencies:
"@vue/compiler-core" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-core" "3.2.34"
"@vue/shared" "3.2.34"

"@vue/compiler-sfc@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.33.tgz#7ce01dc947a8b76c099811dc6ca58494d4dc773d"
integrity sha512-H8D0WqagCr295pQjUYyO8P3IejM3vEzeCO1apzByAEaAR/WimhMYczHfZVvlCE/9yBaEu/eu9RdiWr0kF8b71Q==
"@vue/compiler-sfc@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.34.tgz#3c02b261e631f20587b31e2b9ddc5596cd36c9da"
integrity sha512-I+vT4soKJtdsoREBDYAcz56+yGpZ5T3GUigvBFgC2yTeTtBtREOPzYw8kZyMuD2ZlryPYBkbV8D9xxcvU0j/aw==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.33"
"@vue/compiler-dom" "3.2.33"
"@vue/compiler-ssr" "3.2.33"
"@vue/reactivity-transform" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-core" "3.2.34"
"@vue/compiler-dom" "3.2.34"
"@vue/compiler-ssr" "3.2.34"
"@vue/reactivity-transform" "3.2.34"
"@vue/shared" "3.2.34"
estree-walker "^2.0.2"
magic-string "^0.25.7"
postcss "^8.1.10"
Expand Down Expand Up @@ -1825,13 +1825,13 @@
"@vue/compiler-dom" "3.2.31"
"@vue/shared" "3.2.31"

"@vue/compiler-ssr@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.33.tgz#3e820267e4eea48fde9519f006dedca3f5e42e71"
integrity sha512-XQh1Xdk3VquDpXsnoCd7JnMoWec9CfAzQDQsaMcSU79OrrO2PNR0ErlIjm/mGq3GmBfkQjzZACV+7GhfRB8xMQ==
"@vue/compiler-ssr@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.34.tgz#5e2acc9c051cf877e6a5da20ffd4ff0257d9f4c5"
integrity sha512-zyaMdGJhxoA34ibWsXF7VH1PO5yrNB1MZg/ByRfXGM8JefGQaz+PpHvBy/5OI0ehEyhAyCb7279JdhYHacMZbw==
dependencies:
"@vue/compiler-dom" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-dom" "3.2.34"
"@vue/shared" "3.2.34"

"@vue/devtools-api@^6.0.0", "@vue/devtools-api@^6.0.0-beta.11":
version "6.0.12"
Expand All @@ -1849,23 +1849,23 @@
estree-walker "^2.0.2"
magic-string "^0.25.7"

"@vue/reactivity-transform@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.33.tgz#286063f44ca56150ae9b52f8346a26e5913fa699"
integrity sha512-4UL5KOIvSQb254aqenW4q34qMXbfZcmEsV/yVidLUgvwYQQ/D21bGX3DlgPUGI3c4C+iOnNmDCkIxkILoX/Pyw==
"@vue/reactivity-transform@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.34.tgz#852894181ce70a09a2a4c7605d31ad8b8d068d87"
integrity sha512-OtsrL4/i6Md279pMhZ8wRijeDhPSdnXrH9wmqAcKDhVcp1L2kSWlgVVLa1jGIyyFYE806YiJNJiGBvXPGXMzxw==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-core" "3.2.34"
"@vue/shared" "3.2.34"
estree-walker "^2.0.2"
magic-string "^0.25.7"

"@vue/reactivity@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.33.tgz#c84eedb5225138dbfc2472864c151d3efbb4b673"
integrity sha512-62Sq0mp9/0bLmDuxuLD5CIaMG2susFAGARLuZ/5jkU1FCf9EDbwUuF+BO8Ub3Rbodx0ziIecM/NsmyjardBxfQ==
"@vue/reactivity@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.34.tgz#660e7217a529d788326d22ff89473cdd101ce1ad"
integrity sha512-xbRIOPqxdNOr0zS47moRS6zf4BKd0z+55R85UJlo4r5ezqCktk6fYy1atY4tGzo7Maqh6QoKw3LtIKvpz8d7WA==
dependencies:
"@vue/shared" "3.2.33"
"@vue/shared" "3.2.34"

"@vue/reactivity@^3.2.31":
version "3.2.31"
Expand All @@ -1874,40 +1874,40 @@
dependencies:
"@vue/shared" "3.2.31"

"@vue/runtime-core@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.33.tgz#2df8907c85c37c3419fbd1bdf1a2df097fa40df2"
integrity sha512-N2D2vfaXsBPhzCV3JsXQa2NECjxP3eXgZlFqKh4tgakp3iX6LCGv76DLlc+IfFZq+TW10Y8QUfeihXOupJ1dGw==
"@vue/runtime-core@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.34.tgz#98cb706de9762485a81561329f70b740386f9f7b"
integrity sha512-GtaHqYiuEb56OA0cbMh20UPpDiXGRX+NS1buKif4OL341JJ3NtmNOIchCzknaN76oN6KqrLiO82/+TEZXl2Xtw==
dependencies:
"@vue/reactivity" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/reactivity" "3.2.34"
"@vue/shared" "3.2.34"

"@vue/runtime-dom@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.33.tgz#123b8969247029ea0d9c1983676d4706a962d848"
integrity sha512-LSrJ6W7CZTSUygX5s8aFkraDWlO6K4geOwA3quFF2O+hC3QuAMZt/0Xb7JKE3C4JD4pFwCSO7oCrZmZ0BIJUnw==
"@vue/runtime-dom@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.34.tgz#747acc8a41410f59ecff97ef01cd2a665e6b1101"
integrity sha512-uqizbaJqmNH3O4TRr+8cM1tid5ODWHyQYZ3CLWcjn3dLkf0N7wvNuhUELQUZU/wQLvVMhJUQNrmOqckHLm6Xpw==
dependencies:
"@vue/runtime-core" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/runtime-core" "3.2.34"
"@vue/shared" "3.2.34"
csstype "^2.6.8"

"@vue/server-renderer@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.33.tgz#4b45d6d2ae10ea4e3d2cf8e676804cf60f331979"
integrity sha512-4jpJHRD4ORv8PlbYi+/MfP8ec1okz6rybe36MdpkDrGIdEItHEUyaHSKvz+ptNEyQpALmmVfRteHkU9F8vxOew==
"@vue/server-renderer@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.34.tgz#3efac854311cf13754734b3bae2829946f665f60"
integrity sha512-PMnBAq1BexPFXBxuLngp4lQvc0XQD1CBDIHtEsG0pRusGWVJddBUKlR/EnnSvGaJ34YmKkAl9kdvczOz0kddew==
dependencies:
"@vue/compiler-ssr" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-ssr" "3.2.34"
"@vue/shared" "3.2.34"

"@vue/shared@3.2.31", "@vue/shared@^3.2.31":
version "3.2.31"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.31.tgz#c90de7126d833dcd3a4c7534d534be2fb41faa4e"
integrity sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==

"@vue/shared@3.2.33":
version "3.2.33"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.33.tgz#69a8c99ceb37c1b031d5cc4aec2ff1dc77e1161e"
integrity sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==
"@vue/shared@3.2.34":
version "3.2.34"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.34.tgz#b71750d05120feb644102088a09be64518cd3a86"
integrity sha512-zhEeB8TrFmTXmTXmu/wcjEhgrjO4xqdDQrCdPhjX7NxfoLqoBVKguOm8qyihWNLbP+41svYY4za9mqXyqFLzNg==

"@vue/vue3-jest@27.0.0-alpha.4":
version "27.0.0-alpha.4"
Expand Down Expand Up @@ -5384,16 +5384,16 @@ vue-tsc@0.34.15:
dependencies:
"@volar/vue-typescript" "0.34.15"

vue@3.2.33, vue@^3.2.33:
version "3.2.33"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.33.tgz#7867eb16a3293a28c4d190a837bc447878bd64c2"
integrity sha512-si1ExAlDUrLSIg/V7D/GgA4twJwfsfgG+t9w10z38HhL/HA07132pUQ2KuwAo8qbCyMJ9e6OqrmWrOCr+jW7ZQ==
vue@3.2.34, vue@^3.2.33:
version "3.2.34"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.34.tgz#4d42a929398a8a2e1dff25ceddd4451b3add841c"
integrity sha512-gXRg5v8OSmGT4ZiQ/X/Pcz6Fr2igHQx/wvRH/pLnt0VvjfGGqrwhnwjYZilLP4HBcO211rMD9PpU6lfWfIv3wg==
dependencies:
"@vue/compiler-dom" "3.2.33"
"@vue/compiler-sfc" "3.2.33"
"@vue/runtime-dom" "3.2.33"
"@vue/server-renderer" "3.2.33"
"@vue/shared" "3.2.33"
"@vue/compiler-dom" "3.2.34"
"@vue/compiler-sfc" "3.2.34"
"@vue/runtime-dom" "3.2.34"
"@vue/server-renderer" "3.2.34"
"@vue/shared" "3.2.34"

vuex@^4.0.2:
version "4.0.2"
Expand Down