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

refactor: Removing __VLS_types.d.ts #3534

Closed
wants to merge 3 commits into from
Closed

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Sep 5, 2023

As part of the preparatory work for migrating to ts plugin in 2.0, we cannot use global virtual files because tsserver will crash if the files do not actually exist, and there is no way to bypass this problem.

The solution here is to attach the global types code to one of the virtual vue ts file instead of creating a __VLS_types.d.ts file.

  • When the attached file is deleted, it should be attached to another file instead.
  • Simplify implementation
  • Ensure global types are not emitted with vue-tsc --emit
  • Considering that VueFile is actually reused across multiple tsconfig projects, it is necessary to ensure that in this case a project does not have multiple VueFiles with global types attached.

@rchl
Copy link
Collaborator

rchl commented Sep 5, 2023

Does that mean that extending types through experimentalAdditionalLanguageModules like in https://github.com/rchl/volar-component-types/blob/5f10b2dd17f7c19490f528e966d8591f3d26dba6/src/volar/volar.ts#L31-L48 will also be rendered inoperable?

@johnsoncodehk
Copy link
Member Author

Yes, and we should have a new api via plugin for adding custom global types.

@johnsoncodehk
Copy link
Member Author

Closed as this implementation is obsolete and will open a new PR to do this.

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.

Volar breaks @types/react in monorepo when using takeover mode
2 participants