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

fix: only augment vue, not sub-packages #1

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

BobbieGoede
Copy link
Contributor

Based on your description of type issues in nuxt-modules/i18n#2629 (comment) I took a quick look.

There's a weird type augmentation behavior when modules mix augmenting vue and @vue/runtime-core resulting in broken types (see nuxt/nuxt#28542). This may not be the fix for the plugin type definitions, I wasn't able to run npm scripts to test it myself, probably due to some local package manager issues.

@s00d s00d merged commit 0d4746f into s00d:main Aug 19, 2024
@s00d
Copy link
Owner

s00d commented Aug 19, 2024

Yes, thank you, these are the remnants of my experiments with typing. I’ll try to remove them and see what happens

@azhirov
Copy link
Collaborator

azhirov commented Aug 20, 2024

@BobbieGoede Thank you for pointing that out, but the issue you mentioned regarding type augmentation when mixing vue and @vue/runtime-core is actually related to how the IDE (like WebStorm / PHPStorm) resolves types within .vue files. The problem isn't with the type definitions themselves but with how the IDE prioritizes @vue/runtime-core over the augmented vue module. If the types are correctly extended in the vue module, there shouldn't be any conflict or need for additional fixes in the plugin definitions.
However, if we don't extend the @vue/runtime-core type, the IDE fails to recognize types like $localeRoute, $t, $tc, and others.

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.

4 participants