Arianos11
Arianos11
TTCTheo's Typesafe Cult
Created by Arianos11 on 9/6/2024 in #questions
Proper technology stack for ecommerce
After learning more about Remix I see that the main communication goes through the server we use the loader() function for this. It is also recommended there to use the fetch function (remix boasts optimizations of this functionality so that there are no race conditions, for example)(https://remix.run/docs/en/main/guides/data-loading#external-apis). But it also allows you to do queries through clientLoader. (https://remix.run/docs/en/main/route/client-loader#clientloader). It can be used to baypass remix backend. In addition, if I understand the way the remix works (please correct me if I'm wrong) in the case if we would change, for example, the color of the product, it would change the entire path and ask the server which would render the page anew. And in the case of using clientLoader we can simply change this data as in SPA application. The problem I noticed is that it is not possible to use Providers (contexts) the only one available is OutletContext (https://remix.run/docs/en/main/hooks/use-outlet-context). So the data must be stored on the server or in cookis (https://remix.run/docs/en/main/discussion/state-management)
18 replies
TTCTheo's Typesafe Cult
Created by Arianos11 on 9/6/2024 in #questions
Proper technology stack for ecommerce
Okay, but if I choose remix should all api traffic go through the remix backend? In next js I had an idea that those things which should be cached e.g. products will be passed through next backend. And for example user data will be managed in the frontend part by fetch api and react query. Does this approach make sense in remix?
18 replies