S
SolidJS10mo ago
iNdra

JS Full stack framework designed web vs API fetch use web

I would like to know what are new features available in JS Full stack web DreamWorks than API data fetching system. API fetch use web means frontend use solidjs and backend use other languages like PHP, rust etc. Use API endpoint to get data. API endpoint or web socket. JS Full stack framework designed web means website design with solidstart, remix or react + nextjs. JS full stack frameworks have any new features?
3 Replies
Alex Lohr
Alex Lohr10mo ago
solid-js is a front-end framework, so you need to provide your own API endpoints for it... unless you use @solidjs/start, then you have full control over front- and back-end even within the same source files.
peerreynders
peerreynders10mo ago
Remix/SolidStart leveraging isomorphic/universal JavaScript across client and server goes beyond replacing explicitly implemented fetch API end points. For example a server implemented action can carry additional “instructions” to the client in the form of specialized headers like which cache values (and their dependents) need to be invalidated client side. Data APIs implemented in traditional server languages either aim to serve all possible types of clients in general or simply provide just the requested data (and perhaps some “freshness” information). The data API's of these “fullstack JavaScript frameworks” are an extreme variant of data APIs within a Backend For Frontend i.e. they are highly specialized towards one particular type of client. So while it is entirely possible to build such a back end in a traditional server language, in most cases it would be deemed too tedious, error prone and too much effort for the return. “Reuse” of the exposed data APIs is neither a goal nor an option. I guess one way of describing it is that “fullstack JavaScript solutions” can make it easier to create richer and more client-specific client-server APIs. https://hackmd.io/@0u1u3zEAQAO0iYWVAStEvw/rkRVTcTWp
HackMD
Router Data APIs - HackMD
Potential Router APIs for data
GitHub
solid-router/src/data/action.ts at e773947b85ac78281816e86621a2cdb6...
A universal router for Solid inspired by Ember and React Router - solidjs/solid-router
peerreynders
peerreynders10mo ago
Another improvement are single-flight mutations. In a traditional redirect the browser has to make two requests; the first one that will respond with a Location header and the second one that requests the content from that location. Mutation requests will often result in a redirect, the location of which can vary based on the outcome of the mutation. With the traditional protocol the location has to be accessed with a second request to access the outcome. With single flight mutations the client router receives the location which is needed for the client side route change but also the response body that it would get if it requested that location—so the second request is no longer necessary. This again illustrates the highly client-specific nature of the resulting server API. Also: 1. With a traditional MPA the burden of routing rests entirely with the server 2. With a CSR SPA routing is entirely the responsibility of the client side router. 4. With these “fullstack JavaScript frameworks” the routing logic has a server part which supports the client portion in a fine grained fashion, i.e. with server side information that can make the client side decisions and operations a lot more efficient.
MDN Web Docs
Redirections in HTTP - HTTP | MDN
URL redirection, also known as URL forwarding, is a technique to give more than one URL address to a page, a form, a whole website, or a web application. HTTP has a special kind of response, called a HTTP redirect, for this operation.
Want results from more Discord servers?
Add your server