-
-
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
LoadInput and LoadOutput should be public shapes #4461
Comments
I'm on board with making these public, though I think we should probably take the opportunity to tidy things up. Instead of having separate |
Thanks for the feedback, @Rich-Harris. I took a quick look into the source and this doesn't look like a super complicated change. I was able to identify the following:
I'm sure there's more around the second bullet point, but I'm on mobile, so I can't do a full search yet. I'd be happy to make a fork and take a crack at this change if you guys are okay with a community contribution on this. Just let me know -- and if you would like me to look at it, I welcome your feedback on where any "gotchas" I wouldn't easily find might be. Thanks! |
I realized this is simple enough that I don't really care if my work gets thrown out. 😃 I pushed changes to this branch: https://github.com/tcc-sejohnson/kit/tree/sejohnson-make-public-typings I have not opened a pull request yet, because I haven't generated changeset or updated the documentation. I had a few questions around the changes. As requested by @Rich-Harris, this was an opportunity to clean up the typing surface by merging
Interestingly, there's no actual behavior change here -- prior to the typing change, the Then again, the Other than the above question, everything else looks great -- I created a sandbox and linked my local kit to it and the typings came through just as expected. Once this discussion point is wrapped up, I can open a pull request complete with documentation updates and a changeset. |
Thanks! There should be no need for the The errors that are surfaced here are intended to be the errors that are used for rendering an error page, i.e. they're already meant to be public and there's no problem exposing them (or rather, keeping them exposed — as you say, there's no behaviour change here, |
Thanks Rich. The reason for the Let me play with it for a few and I'll see if there's a better way to do it. Given that the |
@Rich-Harris, not sure what kind of PR monitoring you guys do -- so just tagging you to let you know I opened #4515 for this. 🙂 |
I second the request for a solution based on whatever approach you all decide is best. I'm also using the types, but currently have to hack the import from a private file.
Appreciate the ongoing dedication to providing types. |
There's currently a pull request open to fix the issue altogether! You can read the few comments here and check out the change there for a complete picture -- but the tl;dr is that the ErrorLoad function signature has been combined with the Load function signature and LoadInput and LoadOutput have been made public. 🙂 |
closed via #4515 |
Describe the problem
Related to #4138
At some point in the past few months, the
LoadInput
andLoadOutput
interfaces became private. IMO, if these interfaces make up the public contract forLoad
, they themselves should be public. The specific issue this caused when I upgraded to the newest version of SvelteKit? This function became unusable with TypeScript:This was a super useful function which I now have to completely rework or abandon typing on.
Describe the proposed solution
Make the
LoadInput
andLoadOutput
interfaces public again.Alternatives considered
Abandon typing, refactor anything referencing these types, or mock the interface locally and type cast the input to the local interface.
Option 1 is a no-go for obvious reasons.
Option 2 is feasible, but annoying.
Option 3 is dangerous, as the interface could change on SvelteKit's end.
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: