-
Notifications
You must be signed in to change notification settings - Fork 110
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 TypeScript errors in ssr.ts & when using vue-tsc #87
Conversation
Create AppPageProps that contain all shared props. This avoids having to import SharedProps whenever PageProps are being used
…add template macro types
Use the correct method overload for the route properties during SSR and add type for page file imports
Fixes various issues that would prevent typescript from compiling when vue-tsc is being used.
@@ -41,7 +41,7 @@ | |||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ | |||
"types": [ | |||
"vite/client", | |||
"vue/tsx", | |||
"node", |
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.
Can you explain to me what this is doing here?
Everything else is looking really good. Thanks for the PR.
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 could not find any source for the vue/tsx
types within the installed packages, nor any reference in the official Vue docs recommending setting this as a value See TS docs for Vue. I assume this value was set by mistake or might be a remnant from an outdated Vue version.
The addition of the node
types is simply there to make the compiler aware of the global object in ssr.ts
.
Hey, @TimKunze96. We currently have this PR https://github.com/laravel/vue-starter-kit/pull/52/files that accomplishes a similar thing here. It's also going to add the typescript check inside of the CI. And in this PR, we are clearing out the types array here. This PR and the other one will have many merge conflicts. We will be merging that other PR here soon, so it would be great if you could re-open it with any other changes you see that need to be implemented after that gets merged in. Thank you! |
This pull request addresses various issues with the current implementation of the ssr.ts, global d.ts and various template files.
route
,$inertia
,$page
and$headManager
vue-tsc
into their build step