-
-
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
Uppercase handler names (export function GET() {...}
etc)
#5367
Comments
I removed my previous comment because I thought I misread something, but I now think I didn't. How about making the names of handler functions not case sensitive, and allowing users to export any function from an endpoint and with that support any method? We could make exceptions for functions that start with a |
No, that's a bad idea. APIs should be as explicit and non-magical as possible — loosey-goosey things like accepting |
If you are talking about the APIs that users are building with SvelteKit, that should be left up to them and not SvelteKit. If you are talking about SvelteKit's api, I guess you're right. I'm not a fan of arbitrary limitations though and many others care about not having multiple naming conventions in their codebase. Maybe it is time to consider taking the same approach other file based routers have taken where you create Anyways, I do not have a big stake in this change at all. I can live with the changes. I'll survive for another day lol. Just throwing out some alternatives here. |
having I agree on named exports, the only thing is if it's better having awkward But I use |
I was just playing around with this and it turned out to be surprisingly easy to implement. I did the implementation and also updated all of the tests and documentation with the new method names. There's a PR here: #5513. I meant to mark that PR as a draft (since it's not clear whether this is settled on or not), but it looks like I can't change it now. |
GitHub permissions are highly mysterious. I've just marked that PR as draft, but for the record, I am in favor of this change. |
Describe the problem
Details in this discussion. Consensus seems to be that this is a positive change.
Describe the proposed solution
Replace this...
...with this:
Alternatives considered
Not doing this.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: