News for hackers. Stuff that matters.
Re:React has grown beyond its original promise and it's caus... by hilux on Thursday February 08, 2024 @07:46PM (#39309921)
> ... when you're deep in it, its hard to miss the forest for the trees.

That's very confusing. But so is the entire article.

While I have your attention, as a relative newbie to web dev (with limited time and focus), is Next.js my way to go?

Re:React has grown beyond its original promise and it's caus... by dabber on Thursday February 08, 2024 @08:12PM (#39310144)
> as a relative newbie to web dev (with limited time and focus), is Next.js my way to go?

Obviously "it depends (TM)" on a bunch of things but for most of those things, Next.js is a safe bet, sure.

It's a (the?) leader in the React framework space and the ecosystem reflects that (e.g. most problems or decisions a newbie would run into is likely to have a trove of docs/blogs/tutorials/ect. available to get past them quickly, plenty of options for hosting, marketable as a skill if that's what you're into, fine DevEx all things considered, it'll likely be around for quite some time even if vercel shuts down tomorrow.) The same is true for React.

I'd personally go with Remix though :)

Re:React has grown beyond its original promise and it's caus... by Aeolun on Thursday February 08, 2024 @08:18PM (#39310211)
I have both Next and Remix projects and I far prefer Next. While Remix is cool, and they were kind of the original, their build and dev process has become really bloated, so any change now means waiting a minute for the whole server to restart.
Re:React has grown beyond its original promise and it's caus... by 65 on Thursday February 08, 2024 @07:50PM (#39309957)
I hate Next.js because they make it extremely difficult to deploy an SSR app anywhere except Vercel. You basically have to use the Docker image to deploy your SSR Next.js app. I prefer https://remix.run or https://vike.dev

However, if you just want a static site, Next.js is great.

Re:React has grown beyond its original promise and it's caus... by Aeolun on Thursday February 08, 2024 @08:20PM (#39310230)
Ooh, looks like I need to check out Vike. It may address all concerns I have with Next :)
Re:React has grown beyond its original promise and it's caus... by 65 on Thursday February 08, 2024 @08:26PM (#39310269)
I use it on my personal site. It's great - easy to use and super robust. Hopefully more people use it.
Re:React has grown beyond its original promise and it's caus... by OccamsMirror on Thursday February 08, 2024 @09:00PM (#39310517)
There's also Astro: https://astro.build/ - which admittedly I haven't tried yet but am planning on checking out for my personal site.
Re:React has grown beyond its original promise and it's caus... by ringofchaos on Friday February 09, 2024 @01:21AM (#39311977)
Astro is great, using it for my blog site and. I have a mono repo setup React SPA and Astro For Blog. I can create a reusable component in React Repo and reuse in Astro blog.

You could also write native astro components which are very close to vanilla html css with added benifit of making reusable components and scoped css. And you can also use svelte or vue components.

Re:React has grown beyond its original promise and it's caus... by pcthrowaway on Friday February 09, 2024 @01:36AM (#39312076)
Another vote for Astro.

Honestly, you can use Astro and then still use React if you want. Doing so would be similar to next.js in some ways, though you need to hook up an adapter if you want server-side rendering

Re:React has grown beyond its original promise and it's caus... by jitl on Thursday February 08, 2024 @10:21PM (#39310987)
What is the challenge you’ve had deploying SSR Next, and how does it relate to docker? I’ve only used it in docker (I like docker), but I haven’t seen anything in about Next that seems docker oriented.
Re:React has grown beyond its original promise and it's caus... by 65 on Thursday February 08, 2024 @10:35PM (#39311074)
Because of how Next.JS builds, you can't just deploy it as-is to something like AWS Amplify or Elastic Beanstalk. For example, if you attempt to deploy to Amplify, you'll get a bunch of 503 errors on SSR pages because of Cloudfront permissions. The static pages work fine though. I'm not exactly sure as to why you can't just "npm run start" on a Next.js app on a deployment service like ELB or Amplify. Perhaps because of the extra SWC compiler Next uses for builds?

I believe Docker works because you're doing "npm run start" and containerizing Next.js, essentially proxying the server to then serve to the client. Basically running it on localhost. For example, you can run Next.js on EC2 if you want, but you have to proxy the connection to allow the client to connect to it.

Again, I'm not an expert as to why exactly it doesn't work - I just know that it doesn't work the same way a simple node app works, which therefore adds a ton of steps involved that don't make it worth it to me.

Re:React has grown beyond its original promise and it's caus... by Inviz on Thursday February 08, 2024 @10:47PM (#39311158)
What are frameworks that support async components on clientside?
Re:React has grown beyond its original promise and it's caus... by 0xblinq on Friday February 09, 2024 @08:56AM (#39314863)
Remix is so much better than Next.

We moved a project at work and it’s been night and day for us. Not going back.

Re:React has grown beyond its original promise and it's caus... by garspin on Thursday February 08, 2024 @09:53PM (#39310844)
Try Svelte - especially for personal projects. It's v. easy to get started.

Downside is that there are many jobs yet.

Re:React has grown beyond its original promise and it's caus... by coldtrait on Friday February 09, 2024 @02:19AM (#39312302)
As someone with just limited React knowledge I recently started with Next, got stuck with something and moved on to Svelte. It was really easy until I ran into some errors there and eventually came back to Next.

Svelte is certainly easy to pick up, compared to anything React oriented like Next IMO. That said, the issue I had with most of these frameworks were integrating other libraries into them and quite a few of them seemed to not match with whatever version either the framework was using, or the libraries themselves were outdated.

Then again, I'm a noob at this so it most likely could have been my lack of knowledge.

Re:React has grown beyond its original promise and it's caus... by hilux on Friday February 09, 2024 @01:37PM (#39318528)
This is very helpful. I wanted a perspective from a "noob," since your experience and goals probably more resemble my own.