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

Vue3: Fix TS 5.0 compat with vue-component-type-helpers #22814

Merged
merged 2 commits into from
May 26, 2023

Conversation

kasperpeulen
Copy link
Contributor

@kasperpeulen kasperpeulen commented May 26, 2023

What I did

Use type helpers of the official vue-component-type-helpers to extract prop types compatible with TS 5.0.

This fixes reported bugs in discord when using a recent version of vscode, or using vue-tsc together with TS 5.0.

This also adds missing default props to our args autocompletion! (Such as "class").

image

How to test

Use a recent version of VSCode, select TS 5.0 and then see the public type tests for vue working with this PR.

I haven't upgraded the monorepo to TS 5.0 yet, will do in a seperate PR.

What we really need to figure out is, how to run our type test in sandboxes, so that we are sure they don't regress with version bumps.

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@socket-security
Copy link

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script confusion ✅ 0 issues
Bin script shell injection ✅ 0 issues
Shell access ✅ 0 issues
Uses eval ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
GitHub dependency ✅ 0 issues
New author ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
vue-component-type-helpers@1.7.8 None +0 johnsoncodehk

@kasperpeulen kasperpeulen added patch:yes Bugfix & documentation PR that need to be picked to main branch and removed feature request labels May 26, 2023
@shilman shilman changed the title Vue3: Use type helpers of the official vue-component-type-helpers to extract prop types compatible with TS 5.0 Vue3: Fix TS 5.0 compat with vue-component-type-helpers May 26, 2023
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Great work @kasperpeulen !!! 🚀

@shilman shilman merged commit ead76eb into next May 26, 2023
@shilman shilman deleted the kasper/fix-vue-types-for-ts5 branch May 26, 2023 14:31
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 26, 2023
shilman added a commit that referenced this pull request May 26, 2023
Vue3: Fix TS 5.0 compat with vue-component-type-helpers
@shilman shilman mentioned this pull request May 26, 2023
Copy link
Contributor

chakAs3 commented May 26, 2023

nice @kasperpeulen, did you try "vue-component-type-helpers" it small but great for ComponentProps. ,ComponentSlots ...., i'm using in the new implementation for docs Argtypes table

Copy link
Contributor

chakAs3 commented May 26, 2023

what about my PR #22285 ? you checked it ? nobody did although i have written a documentation not only PR description 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch typescript vue3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants