question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New routing DX can still be improved re REST, there should be one default routing which does it all (with repo)

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:43 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Sep 26, 2022

That works.

export async function load({url, fetch}) {
  const response = await fetch(url); // <- reruns when the URL changes, this includes the query string
  return response.json();
}
0reactions
dummdidummcommented, Oct 9, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Static and Default Routes [Cisco Secure Firewall Management ...
Generally, you must configure at least one static route: a default route for all traffic that is not routed by other means to...
Read more >
Static Routing and Default Routing Explained - Pluralsight
Learn how you can set up static and default routing on your Cisco routers and how you can use Administrative Distances in your...
Read more >
The Web's Next Transition | Epic Web Dev by Kent C. Dodds
Our routing logic will call a function to mutate the data which communicates with the persistence code to make database updates. Then it...
Read more >
Spring boot clear session - - Convittiadi Campobasso
Before going further in this tutorial we will take a look at the common ... There are two ways to set session timeout...
Read more >
How to eliminate the default route for greater security
The default route is not needed when you are creating a layered security approach. Your most trusted applications should be sealed away in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found