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 TypeScript errors in ssr.ts & when using vue-tsc #87

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

TimKunze96
Copy link

This pull request addresses various issues with the current implementation of the ssr.ts, global d.ts and various template files.

  • Moved the vite module declaration into d.ts file
  • Fixed type errors within ssr.ts
  • Refactors SharedProps to AppPageProps, removing the need to import them whenever the page object is being used
  • Added type declarations for route, $inertia, $page and $headManager
  • Fixed all errors that would occur if the user wants to include vue-tsc into their build step

Create AppPageProps that contain all shared props. This avoids having to import SharedProps whenever PageProps are being used
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",
Copy link
Contributor

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.

Copy link
Author

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.

@tnylea tnylea added the Awaiting User Response Waiting for developers response label Mar 19, 2025
@TimKunze96 TimKunze96 requested a review from tnylea March 26, 2025 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting User Response Waiting for developers response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants