Live data from Hacker News

How we rebuilt Next.js with AI in one week

blog.cloudflare.com

141–150 of 252 posts

Re: How we rebuilt Next.js with AI in one week

#141

Earlier quoted context omitted.

What is it you love about Next that isn’t tied to Vercel and isn’t available elsewhere? I love Next too but I find the value is inextricably linked to Vercel. I can’t imagine choosing to use Next if I’m not choosing it for Vercel’s fancy stuff.

React server components are dope. Server actions are dangerous but powerful. No one has a more mature implementation of either of these than Next.

I still just prefer having a more clear separation of concerns with API routes instead of using server components. I want my frameworks to be way less fancy than what Next is pushing out these days. I get the feeling we're dealing with the consequences of Vercel employees needing to justify their promotions.

Re: How we rebuilt Next.js with AI in one week

#142
Lots of hate for NextJS in here so im wondering what people use as an alternative framework...

Gatsby? I used to use that one until the updates basically ceased to exist.

Vite with - looks good, but at initial glance seems to favor just pure speed for any other feature support like MDX, advanced SEO, etc.

Roll your own with React and webpack? Good luck, and you'll probably end up with something that looks like the others I've mentioned above.

Just surprised many comments are just stating complaints about Next and not providing any counter examples, its very un-HN.

Re: How we rebuilt Next.js with AI in one week

#143
I love Cloudflare but not a big fan of Next, I love Remix though :) But getting to make things work on Cloudflare is a pain, hopefully they will make it easier with OpenNext. On the other hand , maybe they can do something better at infrastrucute level , rather than make it easier, like a lot easier to bring your own JS flavor.

Re: How we rebuilt Next.js with AI in one week

#144
post #25

I find it interesting that they bought Astro ( https://blog.cloudflare.com/astro-joins-cloudflare/ ), which from my definitely-not-a-frontend-person perspective seems to tackle a similar problem to Next. A month ago. If it is so cheap to make something that they recommend using (rather than a proof of concept), why buy Astro (presumably it was more expensive than the token cost of this clone?). One conclusion is that…

Astro isn’t solving the same surface as next. Astro is great for static sites with some dynamic behavior. The same could be said about next depending on how you write your code, but next can also be used for highly dynamic websites. Using Astro for highly dynamic websites is like jamming a square peg into a round hole. We use Astro for our internal dev documentation/design system and it’s awesome for that.

But presumably if you could do this for Next it would be at least as easy for Astro?

Re: How we rebuilt Next.js with AI in one week

#145

This is probably the most interesting AI experiment I've seen yet. Looking through the codebase has me wondering where all the code is. I don't know if anyone has had the displeasure of going through the next.js codebase, but I estimate it's at least two orders of magnitude more code than this reimplementation. Which makes me wonder, does it actually handle the edge cases or does it just pass the tests. Like compare…

I imagine offloading a lot of the heavy lifting to Vite helps cut down on the code size.

Re: How we rebuilt Next.js with AI in one week

#146
post #12

Here's what is buried a bit in the text: --- start quote --- Something like 95% of vinext is pure Vite. The routing, the module shims, the SSR pipeline, the RSC integration: none of it is Cloudflare-specific. --- end quote --- The real achievement is human-built Vite (and it is an amazing project). Since Next.js's API surface and capabilities are known, this is actually quite a good use of AI: re-implement some funct…

> The real achievement is human-built Vite (and it is an amazing project).

From TFA:

Vite is the build tool used by most of the front-end ecosystem outside of Next.js, powering frameworks like Astro, SvelteKit, Nuxt, and Remix

Are you saying those frameworks aren't impressive because they are also powered by Vite?

Also from TFA: A project like this would normally take a team of engineers months, if not years. Several teams at various companies have attempted it, and the scope is just enormous. We tried once at Cloudflare! Two routers, 33+ module shims, server rendering pipelines, RSC streaming, file-system routing, middleware, caching, static export. There's a reason nobody has pulled it off.

That's the most important result of this experiment. They achieved something that they'd wanted to do but couldn't pull it off. Do you think they are lying?

Re: How we rebuilt Next.js with AI in one week

#147

This is probably the most interesting AI experiment I've seen yet. Looking through the codebase has me wondering where all the code is. I don't know if anyone has had the displeasure of going through the next.js codebase, but I estimate it's at least two orders of magnitude more code than this reimplementation. Which makes me wonder, does it actually handle the edge cases or does it just pass the tests. Like compare…

(to be transparent - I'm a Cloudflare engineer)

The behavior isn't entirely the same and reaching 100% parity is a non-goal, but there are a few things to note.

This is still a very early implementation and there are undoubtedly issues with the implementation that weren't covered in next's original test suite (and thus not inherited) while not being obvious enough to pop up with all the apps we've tried so far.

As for why it's so much smaller, by building on top of Vite and their react + rsc plugins there is a whole lot of code that we don't need to write. That's where a significant portion of the LOC difference comes from.

Re: How we rebuilt Next.js with AI in one week

#148

[flagged]

> Surprised this didn't get a higher placement on the HN front page, only 34 points? Vercel may be bad, but they have been a net positive to the web landscape, so many projects are alive because of them. And I truly respect the hard work the next devs put into their code and test suites. I'm surprised any self respecting dev even votes this up.

Because it hurts feelings?

If someone reproduced the Linux kernel would you feel the same way?

Re: How we rebuilt Next.js with AI in one week

#149

This is probably the most interesting AI experiment I've seen yet. Looking through the codebase has me wondering where all the code is. I don't know if anyone has had the displeasure of going through the next.js codebase, but I estimate it's at least two orders of magnitude more code than this reimplementation. Which makes me wonder, does it actually handle the edge cases or does it just pass the tests. Like compare…

(to be transparent - I'm a Cloudflare engineer) The behavior isn't entirely the same and reaching 100% parity is a non-goal, but there are a few things to note. This is still a very early implementation and there are undoubtedly issues with the implementation that weren't covered in next's original test suite (and thus not inherited) while not being obvious enough to pop up with all the apps we've tried so far. As fo…

Yeah I'm curious about all the routing edge cases, form actions, server functions etc, since that is where most of the complexity of the app router comes from. Does it encrypt captured values inside closures sent to the client? Stuff like that.

Re: How we rebuilt Next.js with AI in one week

#150
post #128

Earlier quoted context omitted.

If Rails is considered a worse framework, then I'm pretty much speechless. Not everything has to be about performance. Security is a thing too.

Rails powers nearly 15 percent of the US e-commerce. I love it. Any time I have to use another framework it feels like a huge downgrade. Rails has so many things that make it nice to use

Agreed 100%. I shifted to Phoenix/Elixir years ago but I still love Rails for all the sensible defaults it provides.
Post reply on HN