News for hackers. Stuff that matters.
Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Monday November 22, 2021 @05:53PM (#29312587)
That can be done on NextJS as well using getInitialProps, getServerSideProps, or getStaticProps

Some of the notable differences between NextJS and Remix are the following:

- While both support file-based routing, Remix is baked with React Router -- giving developers the capability to declare custom routes without sticking to file structure conventions

- NextJS banks on its static site generation to generate "cache-able" websites whereas Remix utilizes cache headers for its server-rendered pages

- NextJS has no baked-in support for handling session and cookies; Remix has

Re:Remix – A framework focused on web fundamentals and moder... by andrewingram on Monday November 22, 2021 @06:48PM (#29312993)
It doesn't really promote its use, but it's exceedingly easy to use cache headers with Next.js if you're using getInitialProps or getServerSideProps.

My issue with Next.js (alongside lack of nested routes) is that it has a handful of weird light abstractions which make things marginally easier for developers for the most common cases, but completely tie the hands of people who know what they're doing. To that end, Remix is a little more appealing.

Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Monday November 22, 2021 @07:58PM (#29313453)
While it is easy to use cache headers with NextJS -- as you said -- you have to know what you're doing.

It still boils down to use case, implementation, and quite possibly preference.

Personally, I'd still pick NextJS any time for any enterprise-level projects. Remix would be a fun little new framework to toy with for personal projects.

Re:Remix – A framework focused on web fundamentals and moder... by brundolf on Monday November 22, 2021 @07:48PM (#29313398)
> NextJS banks on its static site generation to generate "cache-able" websites

Does it? You can still do traditional SSR in Next

Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Monday November 22, 2021 @07:55PM (#29313439)
You can. I'm stating SSG in the context of caching and in comparison with Remix's approach.
Re:Remix – A framework focused on web fundamentals and moder... by chrisweekly on Monday November 22, 2021 @09:21PM (#29313943)
NextJS ships with both the built-in fs router AND a traditional imperative router.

Also, there's a lot more to caching with NextJS than SSG.

Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Monday November 22, 2021 @11:29PM (#29314599)
Yes, NextJS does ship with an imperative router, but you cannot construct a custom route on the client-side without adhering to the core concept of building your routes based on the pages directory.

I also agree that there's more to caching and SSG with NextJS. I'm simply stating some notable differences between NextJS and Remix, answering the top-most parent comment.

Re:Remix – A framework focused on web fundamentals and moder... by chrisweekly on Tuesday November 23, 2021 @07:43PM (#29325620)
> "you cannot construct a custom route on the client-side without adhering to the core concept of building your routes based on the pages directory."

Actually, that's not true. You can opt out of the fs-based routing altogether.

Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Wednesday November 24, 2021 @12:35AM (#29327203)
I'm not aware of said functionality on the client-side. Out of curiosity, do you mind linking me to said documentation or article on how to circumvent routing on the client-side without using fs-based routing?
Re:Remix – A framework focused on web fundamentals and moder... by chrisweekly on Wednesday November 24, 2021 @05:12PM (#29335782)
https://nextjs.org/docs/advanced-features/custom-server#disa...

> "You may also wish to configure the client-side router to disallow client-side redirects to filename routes; for that refer to router.beforePopState."

https://nextjs.org/docs/api-reference/next/router#routerbefo...

Re:Remix – A framework focused on web fundamentals and moder... by micahbule on Wednesday November 24, 2021 @07:30PM (#29336914)
That is through using a custom server -- which is a whole other topic. I'm comparing apples-to-apples between NextJS's built-in router and Remix's usage of React Router as far as client-side routing is concerned.