Re:Web Development Simplified with Svelte
by epse on Friday September 27, 2019 @03:16PM
(#21095366)
Do you need a framework to handle data fetching? We have `fetch()` after all so I'm honestly curious why you wouldn't just use it
[ Parent
| on HN ]
Re:Web Development Simplified with Svelte
by lhorie on Friday September 27, 2019 @03:44PM
(#21095600)
"Needing" is relative. I could make an app making nothing but raw XMLHttpRequest calls, but that only speaks to the capability of talking to a server. In that sense, sure `fetch` is "enough". But from a perspective of a complex application or a complex org, you may want specific properties to be true: for example, you may want that a request to a certain endpoint follows a predetermined schema, or that one can control the granularity of the response data, or maybe you want to abstract over things like streaming, retries or caching to name a few things.
Something that most frameworks struggle with, IMHO, is that they don't consider how coupled network is to the system and when you need to do something like bundle-specific translations in an SSR context, it's very hard to do it in a generic way without touching half a dozen unrelated parts of an app (meaning librarizing concerns that cross-cut across network boundaries is difficult).