-
Notifications
You must be signed in to change notification settings - Fork 28
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: RuntimeModuleHooks
should be ModuleRuntimeHooks
#194
fix: RuntimeModuleHooks
should be ModuleRuntimeHooks
#194
Conversation
That's why I get weird types.d.ts, check last pr from Daniel and the test snapshots. |
src/commands/build.ts
Outdated
moduleImports.push('RuntimeModuleHooks') | ||
appShims.push(' interface RuntimeNuxtHooks extends RuntimeModuleHooks {}') | ||
} | ||
if (hasTypeExport('ModuleRuntimeHooks')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't throw an error when RuntimeModuleHooks
also present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After testing locally the types seem to work fine with two extends as seen below 🤷♂️ it feels like it shouldn't.. Might test it again in the morning just to be sure 😅
declare module '#app' {
interface RuntimeNuxtHooks extends RuntimeModuleHooks {}
interface RuntimeNuxtHooks extends ModuleRuntimeHooks {}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it so that if multiple interfaces are used it's extended like so:
declare module '#app' {
interface RuntimeNuxtHooks extends RuntimeModuleHooks, ModuleRuntimeHooks {}
}
ba6a530
to
1c18f45
Compare
Co-authored-by: Sasha Sorokin <10401817+brawaru@users.noreply.github.com>
1c18f45
to
ebcf9e4
Compare
Can't believe I wrote
RuntimeModuleHooks
instead ofModuleRuntimeHooks
in #183 😭 I added a deprecation warning, and kept the previous way working, let me know if this should be different or removed!The previous code was not broken, but I feel like the code looks off
vs