DEV Community

Discussion on: Some Thoughts on Server State in Remix

Collapse
 
ryanflorence profile image
Ryan Florence

Yes, just like if there was no JavaScript on the page, default web behavior.

Routes can opt-out of being reloaded though with unstable_shouldReload so your unicorns won't be bothered if they don't need to be (unstable just because we're still learning what the inputs to this function need to be).

You can think of remix loaders like queries. Instead of actions needing to know which queries need to be invalidated, the queries themselves can decide if the action invalidates them or not.

Collapse
 
romeerez profile image
Roman K • Edited

Routes is very confusing term which has many meanings, so I suppose they may mean something different in Remix

I mean in React routes are sometimes confused with "screens" aka "pages", in node.js they are confused with "controllers"

In my understanding, route is a url path, this post has a route like /:authorId/:postId

So could you clarify, if I don't want unicorns to update on posting comment with Remix but they are displayed at the same post path /zachtylr21/some-thoughts... which is matching the route, what do you mean by

Routes can opt-out of being reloaded though with unstable_shouldReload

So unicorns have to be shown at a different route, but what does it mean that comments are in one route, unicorns are in different route, but they all are displayed on the same page

If I get all correctly and route means the string '/:authorId/:postId' then I have doubts on Remix to be adopted where optimizations matters.