New routing DX can still be improved re REST, there should be one default routing which does it all (with repo)
See original GitHub issueDescribe the problem
Having many REST routing options is great but can be also overwhelming at the same time. There should be one default option which does it all.
__Before continuing reading, please check following repo’s README’s comparison table for all the options including code: https://github.com/newsve/sveltekit-routing-options__
There, you see that “Comfy” should be the default option because it’s minimal, offers SSR and preserves types. Only if you need your endpoints to work as dedicated JSON ones you should consider “Flexy” and if you need max. one serialization run paired with special types, you should consider “Basic”. But again, in an ideal world all users, in particular new ones, shouldn’t bother with any other than “Comfy” and just forget that the other options exist.
Describe the proposed solution
“Comfy” would be feature-complete if its +page.server.ts
could also work as ded. JSON endpoint. Having only one serialization run would be a nice-to-have but isn’t crucial since devalue is fast. But again, offering latter option too would make all other options obsolete and improve the general DX. Then, we wouldn’t even need to document the other options anymore making onboarding much easier.
Alternatives considered
none yet
Importance
would make my life easier
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:43 (22 by maintainers)
That works.
Actions are bound to a page because they can’t exist without one. Calling them from other pages doesn’t change that. load is different because all load functions leading up to a page make up the data for that page, not just the last load in the chain. Reloading that data is supported without navigation through invalidate.