5 ms·
The article kindly phrases the alternative as “use a framework” and links to a page that has only one actual framework: NextJS. I don’t support React pushing a
by mmoustafa 2y ago
The article kindly phrases the alternative as “use a framework” and links to a page that has only one actual framework: NextJS.
I don’t support React pushing a wholesale shift to NextJS as a starting point for every project, given it’s mostly directed by a single private company (Vercel) that have positioned themselves as the default deployment platform for NextJS apps, publish the documentation, and do not shy away from claiming it as their own.
It has become extremely difficult to distinguish between NextJS features that are community-driven vs profit-driven e.g. api route functions (putting your backend in your React project, so now you will pay them for compute) and NextJS image optimization (famously expensive, and NextJS literally throws warnings if you don’t use it).
- gcau 2y agoVite is the replacement for CRA, I usually create new projects with their preact-ts template. Its very fast and just works. I would personally strongly advise against nextjs, but use whatever you prefer.
- kouroshp 2y agoThe article mentions React Router (v7) which is a framework, so it is not just Next.js.
- littlecranky67 2y agoOn top of that, NextJS doesn't even support the <Image/> component (and thus all their image optimization) when exporting to static output (unlike Gatsby). So you will be pushed even closer to pay them.
- leerob 2y agoThis is not accurate: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#image-optimization https://nextjs.org/docs/app/building-your-application/deploy...
- littlecranky67 2y agoIn your very link you can see that you can only add a handle to a third party loader. Their built in image optimization that works in vercel does not if you static export and host elsewhere.
- leerob 2y agoIf you do a static export, you don’t have a server to optimize images. It’s just a bunch of static files. The only way to optimize the image is to point to a service through the loader. Also, the image optimization on the default Next.js server, for example deployed to a $4 VPS, also works without Vercel.
- afloatboat 2y agoNext should have the same functionality that Gatsby had when doing a static export: pre-optimised images for different breakpoints that are created at build time. That would be a truly portable solution.
- littlecranky67 2y agothat is simply not true, there are static export, 3rd party image optimizers [0] (that re-use <Image />) - just vercel does not care about theirs for static export. Also, look at how gatsby does without cloud/server hosted images. [0]: https://www.npmjs.com/package/next-image-export-optimizer https://www.npmjs.com/package/next-image-export-optimizer
- littlecranky67 2y ago"leerob" - Lee Robinson who works at vercel [0]. It would have been nice to disclose your affiliation, especially when spreading misinformation. https://leerob.com/ https://leerob.com/
- zero_shift 2y agoThe close relationship between React (open source) and Vercel (VC funded hosting co) has made people uncomfortable for a while now.
- leerob 2y agoAll Next.js features work when self-hosting, including APIs and image optimization: https://nextjs.org/docs/app/building-your-application/deploying#self-hosting https://nextjs.org/docs/app/building-your-application/deploy...