DEV Community

What No Meta-Framework Does: Part 2

Thomas Reggi on December 22, 2022

I've complained about meta-frameworks in the past, specifically in regards to file-system routing. But I want to explore another use case specific ...
Collapse
 
cyco130 profile image
Fatih Aygün

Rakkas has 2 and 3 if I understand correctly, data fetching is component based, not route based (useServerSideQuery). 1 is technically possible now but it will be usable once we have a way to set a custom URL path for useSSQ.

Collapse
 
reggi profile image
Thomas Reggi

Hey @cyco130 coincidentally I was looking deeper into Rakkas and comparing it with Remix a bunch. I think I need a bit of a rosetta stone as to the differences you see with Rakkas compared to the rest of the landscape.

Collapse
 
cyco130 profile image
Fatih Aygün

Thank you for the blog post idea :)

The summary is: In Next and Remix, data fetching is tied to routes. Only routes can have getServerSideProps or loader.

In Rakkas, any component can have one or more useServerSideQuery. The callback function you pass to it always runs on the server. For the client build, it's compiled into a fetch call. Apart from that, the API is similar to react-query. There's also useServerSideMutation and useFormMutation (not yet documented). This way, a component can contain its own backend. True "fullstack components", not fullstack routes.

So you can have, say, a LoginForm component (not a route, just a component) that contains all the backend logic and view logic pertaining to logging the user in in one place. And you can use it in as many places as you want in your app.