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: update to vue v3.2.43 #1853

Merged
merged 1 commit into from Nov 10, 2022
Merged

Conversation

cexbrayat
Copy link
Member

No description provided.

@netlify
Copy link

netlify bot commented Nov 9, 2022

Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit c2c3fa3
🔍 Latest deploy log https://app.netlify.com/sites/vue-test-utils-docs/deploys/636d115094d8f10008e26d2b
😎 Deploy Preview https://deploy-preview-1853--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@cexbrayat
Copy link
Member Author

This is currently failing because this commit in core vuejs/core@506a42a is breaking our type-checking.

Our codebase includes a testing.d.ts file that defines:

import type { Router } from 'vue-router'

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $router: Router
  }
}

As the change in core makes the type of globalProperties ComponentCustomProperties & Record<string, any> (when it used to be only Record<string, any>), we now have type-checking errors for example in config.spec.ts where a test uses:

config.global.config.globalProperties = {
  myProp: 1
}

which produces:

tests/config.spec.ts:27:7 - error TS2322: Type '{ myProp: number; }' is not assignable to type 'ComponentCustomProperties & Record<string, any>'.
  Type '{ myProp: number; }' is missing the following properties from type 'ComponentCustomProperties': $route, $router

27       config.global.config.globalProperties = {

I'm not sure how this should be fixed. @pikax maybe you have an idea?

@pikax
Copy link
Member

pikax commented Nov 10, 2022

The issue there is the return type of mergeAppConfig is not correct, because both configGlobalConfig and mountGlobalConfig are optional, but we are returning the Required version of it, meaning most likely we don't have all the correct types in as expected.

I would say this error can be "ignored" by adding

return {
  ...configGlobalConfig,
  ...mountGlobalConfig,
  globalProperties: {
    ...configGlobalConfig?.globalProperties,
    ...mountGlobalConfig?.globalProperties
  } as Required<GlobalMountOptions>['config']['globalProperties']
}

Just to have the globalProperties with the expected type

Also adds some cast for global properties, as we are impacted by vuejs/core@506a42a
@cexbrayat cexbrayat merged commit 2693839 into vuejs:main Nov 10, 2022
@cexbrayat cexbrayat deleted the chore/vue-3.2.43 branch November 10, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants