Top
Best
New

Posted by bundie 16 hours ago

We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2(blog.railway.com)
147 points | 138 commentspage 3
huksley 14 hours ago|
Anyone tried to use vinext from Cloudflare in production? Might be faster.

But seriously, not sure why NextJS builds take so much, we are using stable and functional pages router in DollarDeploy and it is still takes too much time to build.

mellosouls 14 hours ago||
Reminder, as its not mentioned:

Next.js is produced by Vercel, a competitor to Railway.

debarshri 14 hours ago||
Moving to vite + tanstack builds faster is also a fact.
pjmlp 12 hours ago||
Only if they weren't using Turbopack.
lukasholzer 4 hours ago||
does turbopack make such a difference on next.js sites?
pjmlp 4 hours ago||
Yes, because it is yet another Typescript and Webpack like compiler written in Rust.

Note how many HNers are making the same remark.

cryptonym 13 hours ago|||
True. That framework is owned by a cloud company and the way they host Next.js apps in a secure and scalable way remains secret sauce.

Now it doesn't really impact build time and Railway offers Next.js hosting.

abustamam 13 hours ago||
It's not mentioned because it's not relevant.
mellosouls 13 hours ago|||
Of course it should be mentioned, it's a basic disclaimer.
norman784 13 hours ago|||
I don't know the situation now, but a while ago there were a lot of pushback using Next.js because it was not easy to use all features if not hosted on Vercel.
abustamam 9 hours ago||
We used NextJS on a project hosted on AWS a while ago. We learned quickly it wasn't the best tool for what we wanted to do which is why we stopped using it. But it's an open source project whose purpose is to drive devs to Vercel. It doesn't surprise me that there are some features that work best with Vercel (but it does surprise me that only recently other providers started to need adapters).

Anyway, my point is that no one is forced to use NextJS and if they like NextJS but not Vercel they can always fork it or, apparently write an adapter.

pjmlp 3 hours ago||
Besides the way it maps server side code into serverless, it has a custom runtime, functions that expose cloud infrastructure, integration with multiple language runtimes for the backend.

You get to pick Vercel + headless CMS + assets managed + eshop, and you're done in terms of big corporations.

Might seem a lot in licenses, however it allows for smaller dev teams, which is what management floor cares about, all those salaries.

mememememememo 13 hours ago||
Wait till you use HTMX!
SilverSlash 13 hours ago||
As in, htmx is better? I haven't used it but last I looked into it I was extremely confused as to whether it was a meme, an actual framework, or both.
0x457 3 hours ago|||
HTMX is great when your web interface is just a representation of a server state.

If web interface is an application backed by a remote state HTMX falls apart.

nchmy 1 hour ago||
can you give an example?
mememememememo 12 hours ago|||
None of the above. It is a utility (I guess framework maybe) for a feature that was cool in ASP.NET back in 2005. But that is it's charm. It is just JS swapping out the dom for you.
recursive 5 hours ago||
Not sure what you're thinking of, but the first release of HTMX was 2020. Its predecessor, intercooler, was first released in 2013.
nchmy 1 hour ago||
Wait till you use Datastar!
maccard 14 hours ago||
It’s absolutely mind boggling to me that we have gotten to a point that building a web frontend takes longer than compiling the Linux kernel..
nicoburns 2 hours ago||
It's mostly because a lot of the web tooling is written in JavaScript. The build times for the "next generation" tools written in Rust/Go are dramatically faster.
Hamuko 14 hours ago|||
As a non-frontend developer mainly observing and touching something here and there, a lot of the things that frontend developers do seem vastly over-engineered.
ramon156 14 hours ago|||
I'm not insanely deep into frontend, I mostly just pick up React and call it a day, but it seems like this is also over-engineered?

I've seen vanilla JS before, and I just know I wouldn't want to do the housekeeping that comes with it. People claim it's less work because it' simpler, but I fully expect myself to rewrite the thing at least twice, only to give up because I have no actual mental model anymore of how it works.

selfmodruntime 13 hours ago||
I have never in my career encountered a Vanilla JS project of at least medium size that I would have called simple. They all feature brittle selfmade frameworks whose developers have since left the company years ago.
maccard 12 hours ago||
I write C++ and C# all day - I think it’s fair to say the same about a project in any programming language!
thibran 14 hours ago||||
Isn't the main problem that the building blocks the modern web is based on are not a good fit for what we do with it?

CSS is a total mess. HTML is a mess. JS is okay, but is not a high quality language.

We would save so much time and money if we would have a modern base to build on. Sadly this will probably never happen, because company interests will try to corrupt the process and therefore destroy it.

selfmodruntime 13 hours ago||
How are CSS and HTML a mess? Combined, they're an incredibly powerful layout engine that works almost the same across all environments and devices while also featuring easy accessibility.
thibran 12 hours ago|||
When taking a bird eyes view on CSS it will be hard to oversee that CSS is a mixture of different concepts that evolved over time with a lot of inconsistentsies. It is possible to make it work, but it's not pretty.

Same for HTML. If the web would be reimagined today, there is a very low chance that we would create HTML as is.

rk06 13 hours ago|||
the biggest problem with html/css is that they are tightly coupled. you can't meaningfully modify a layout with css alone.

second biggest problem is "no stricter mode". so even wrong or useless html/css code goes unflagged and is treated as it is normal.

CSS is way too powerful.

manuelmoreale 7 hours ago|||
> you can't meaningfully modify a layout with css alone.

https://csszengarden.com/pages/alldesigns/

That statement wasn't true ages ago, and it's even less true now.

rho138 12 hours ago|||
> you can’t meaningfully modify a layout with css alone Wut?
maccard 12 hours ago||||
This is my understanding too - tools like react are like microservices - they’re a technical solution to an organisational problem. HTML/css/JavaScript is an imperfect abstraction, so we got bootstrap. Then we got client side frameworks which introduced a build step, and then we got asset bundles, optimisers, linters, validators, tree shakers, package managers, validators for your package managers. All of these monkey patched around the actual problem with more abstractions, and the end result is what we have now.
mmarian 7 hours ago||||
Not that backend is any better - microservices everywhere, must scale to Facebook traffic even if we only have 10 customers, etc. Saying this as a backend dev
pjmlp 12 hours ago||||
Like using SPAs for classical Web development, and then they rediscover PHP.
itopaloglu83 13 hours ago||||
It’s mind blowing when you check the generated code, because it goes over 50 elements deep for a simple looking website.

Makes me think that there’s no way this is computationally efficient either.

crooked-v 13 hours ago||
That particular issue is nothing to do with Next or React and everything to do with how HTML/CSS is a really shitty layout engine.
maccard 13 hours ago||
Hard disagree. This is JavaScript frameworks building a hierarchy for themselves and ignoring any sort of complexity on the generated DOM. There’s 0 reason for these 8-10 nested divs other than that’s what the framework spits out.
nixpulvis 13 hours ago||||
Same reason why 90% of websites have serious UX issues and constant bugs. This and ad frameworks.
rafaelmn 7 hours ago|||
And underenginered at the same time !
selfmodruntime 13 hours ago||
C is infinitely less complex to parse and validate than Typescript. C is compiled in a single pass, the `tsc` type checking algorithm has to check structural typing, conditional types and deep generics while also emulating JS' dynamic behaviour.
iptq 13 hours ago|||
I don't think any C compiler has been single pass for the last 20 years. Typescript's analyses are also not that complicated, it's just that the typescript type checker is written in js. Iirc the actual ts -> js part is pretty fast with some of the more recent compilers.
HeavyStorm 12 hours ago||||
That's not the point...
maccard 13 hours ago|||
I disagree - this is an excuse. Even the post we’re commenting in now shows that it’s a series of poor abstractions and bad tooling that takes way too long to do the basics, combined with a language and ecosystem that encourages this behaviour . They saw a 5x speed up by changing tools while still using a JavaScript framework so it’s clearly possible for it to not be complete nonsense.
Chepko932 12 hours ago||
[dead]
Paul20261 14 hours ago||
[dead]
sanghyunp 13 hours ago|
The two-PR strategy is smart — decouple from the framework first, then swap it. That's the kind of migration discipline most teams skip, and it's why they end up running two systems in parallel for months.

I run a Next.js App Router site in production (marketing + blog). Build times aren't painful yet, but I've noticed the same pattern: most of the build time is Next.js doing things I didn't ask for. For a mostly-static marketing site it's tolerable, but I can see how it becomes a dealbreaker for a rich client-side app like Railway's dashboard.

Curious — after the migration, did you see any measurable difference in runtime performance (TTFB, hydration) or was the win purely on the build/DX side?