-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
types: organize into folder #1024
Conversation
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.
this looks very nice. thank you!
While we're at it: could we also restructure the types internally? Right now they reference each other recursively which signals to me that there's something wrong. Could we change this up so that internal only references public but not the other way round? Everything in public that references internal is public, too, after all. |
tried to break them up into each categories also added helper.d.ts to try avoid circular dependencies between each files imports
I tried my best to break it up even further. Also updated the paths used internally to import it explicitly (from Although Edit: There's a lot of |
I think these are good splits. I would suggest to revert the interface name changes though to not introduce a breaking change at the same time when we refactor the types, that should go into a different PR IMO. Edit: Just saw you rename them while reexporting them from |
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.
Thank you, but can we change types/server
to types/endpoint
and types/client
to types/page
? The current division isn't quite accurate, since pages are rendered on the server as well as in the client.
Done! I was following how it each types were imported from |
excellent, thank you so much! |
Organize types into its own folder, this will make it easier to develop and reference types in deeply nested files, as well as add more unrelated types if necessary. This PR actions consists of
types/index.d.ts
*note: there's still
runtime/client/types.d.ts
andruntime/server/page/types.d.ts
which uses types from the root folder, but this could now be placed in the roottypes
folder as well, it can (in theory) be referenced astypes/client
andtypes/server
.No tests or changeset should be needed as this should not change anything