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

Update typescript configs for better in-editor support #12888

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

rak-phillip
Copy link
Member

@rak-phillip rak-phillip commented Dec 13, 2024

Summary

This enhances in-editor typescript support by

  • ensuring that shell/types/vue-shim.d.ts is included in the typescript config
  • removing vue2 type augments from shell/types/vue-shim.d.ts
  • updating typescript to 5.6.3

Fixes #12893

Technical notes summary

I tested this change in Zed, Webstorm, and VS Code - typescript support appears to be improved across the board with regards to properly detecting aliased imports and detecting Vue augments.

VS Code allows for selecting the typescript version; developers can choose to use VS Code's version or the workspace version. Later versions of Typescript appear to better handle multiple tsconfigs, so updating typescript to 5.6.3 resolves the import issue nicely. This is also the default version that is currently used in VS Code as of writing.

NOTE: Make sure to run the Vue: restart Vue and TS servers VS Code action after checking out this change

Areas or cases that should be tested

In-editor typescript support. We want to ensure that aliased imports of components work across the board. We also want to ensure that this.$t() and this.$store() are properly detected in component scripts.

Areas which could experience regressions

This should enhance in-editor typescript support, but keep an eye out for new invalid typescript warnings that might not have been present before.

Screenshot/Video

Component imports no longer display errors

image

Store getters no longer display errors

image

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
flaeppe Petter Friberg
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
@rak-phillip rak-phillip added this to the v2.11.0 milestone Dec 14, 2024
@rak-phillip rak-phillip marked this pull request as ready for review December 16, 2024 18:05
@rak-phillip rak-phillip changed the title Chore/typescript enhancement Update typescript configs for better in-editor support Dec 16, 2024
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Copy link
Member

@mantis-toboggan-md mantis-toboggan-md left a comment

Choose a reason for hiding this comment

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

LGTM - I've looked through typescript vue components and .ts files, I didn't see new invalid errors introduced, and old invalid errors about $store and $t have been resolved.

@rak-phillip rak-phillip merged commit af63f80 into rancher:master Dec 18, 2024
31 checks passed
@rak-phillip rak-phillip deleted the chore/typescript-enhancement branch December 18, 2024 18:08
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.

Invalid typescript warnings in editor
4 participants