LongCut logo

Cloudflare Rebuilt NextJS… And it’s WAY Faster.

By Josef Bender

Summary

Topics Covered

  • Cloudflare Rebuilt Next.js in One Week
  • Tests Enable AI to Recreate Software
  • Open Test Suites Risk AI Cloning
  • Vite-Next Outperforms but Experimental

Full Transcript

So, Cloudflare literally just rebuilt Nex.js in one week. And I know it sounds crazy and to be honest, it really is.

This has a huge impact not only on the React ecosystem, but really on the whole developer community and especially open source. So, what did they build and why

source. So, what did they build and why is it so important? And just for context before we dive in, like if you just search for V-Next, which is the name of this framework, you're going to see on

Twitter that a lot of people have migrated to it already. Like the

official website of CIO, which is a government website from the US, already migrated and is using this library. And

apparently even the performance is way better in this new library than in Nex.js. So, how is it possible to

Nex.js. So, how is it possible to rebuild an entire library that took years and millions of VC invested money

in under a week? Well, this is what Cloudflare is sharing with us in this blog post. And the reason behind

blog post. And the reason behind creating V-Ex is literally just the deployment problem that you have with Nex.js. So if you have an app using

Nex.js. So if you have an app using NexJS then it's actually pretty tricky to get it deployed on Cloudflare because the output format on when you build the

library is simply incompatible with Cloudflare workers and there are some other solutions but they thought you know what let's just try to give it a shot and try to rebuild it with AI. So

the whole idea behind V-Nex is that you have the same API as in Nex.js, but it uses V under the hood to build your website. And you should simply replace

website. And you should simply replace Nex with V-Nex throughout your application. And that should be it. This

application. And that should be it. This

should allow you to build your application using Vit. And you're

probably wondering how could they actually pull this off. And for that, Daniel Seits wrote an article called tests are the new mode. And here he

explains how they were able to recreate a whole library using their open- source test files. And this is actually the

test files. And this is actually the key. And I would highly recommend

key. And I would highly recommend reading the whole article. I'm going to put a link to it in the description. But

here's the gist of it. So historically

speaking, it used to take years to create software. We're talking about

create software. We're talking about incremental changes. And of course,

incremental changes. And of course, because you have existing users and APIs, you have to be backwards compatible. And you had to always keep

compatible. And you had to always keep that in mind where you are expanding your software. And in order to do that,

your software. And in order to do that, the only way to be stable and make sure that your software keeps working the same way as before is to have tests. And

if you think about it, tests are just another form of requirements engineering or requirements. But now that we have

or requirements. But now that we have AI, imagine taking the tests of an existing system and feeding it to the AI and just asking it, hey, recreate the same system that matches all these

tests. And this is actually where the

tests. And this is actually where the magic happens because if you try to build a system where you have all the requirements at once and it's actually

really easy, especially for AI, you don't have all these design decisions that or these historical decisions that are dragging you down that you made years ago. You don't have to be

years ago. You don't have to be backwards compatible. You can literally

backwards compatible. You can literally start from scratch and also make better architectural choices. And this is

architectural choices. And this is exactly what happened here. Now one

thing that is really interesting is that apparently SQL light already saw this coming and they have also closed source their test suite which is really

interesting and this means that all the companies that are open source are right now starting to wonder is it actually problematic that not only our code is open source but our test suite is open

source and SQLite decided that actually maybe it is better to just keep the tests closed source while leaving the rest of the code basically openly available.

Apparently, the numbers are way better.

It's just way faster than Nex.js. But at

the end of the day, we are dealing with a very experimental library. So, this is not stable at all. I would not recommend actually making this switch at all. If

you want to go the Vit way, I would actually recommend just checking out task start which is another react library built from the ground up based on vest under the hood. It's really

developer friendly and if you want to make a switch I would actually recommending to go with tansaxart and I'm actually also working on a course for tansart. Check it out in

for tansart. Check it out in learntack.com and in the course we go through literally every feature of the library using real use cases. So, it's

going to be problem solution based. If

that sounds interesting to you, check it out. And if you don't want to miss this

out. And if you don't want to miss this kind of news, also check out my free newsletter tasakweekly.com where I share on a weekly basis everything that happened in JavaScript world, but with a strong focus on Tasak

start and the React world. Thanks again

for watching and see you in the next video.

Loading...

Loading video analysis...