Hacker News new | ask | show | jobs
by nickosmark 1694 days ago
Next.js reinvents so many things that already exist in PHP (also Python, Ruby). Check out for example what is already possible with Symfony in their docs[0]. Next.js "biggest" release just introduced middleware and html rendering with zero client-side js !

What people like in tools like next.js is not the framework itself but the abstraction over infrastructure, using platforms like vercel. Imagine a platform as cheap, modern and easy to use as vercel but for PHP, basically shared hosting on steroids. Do you believe people would still care so much about Next.js in that scenario ?

[0] https://symfony.com/doc/current/index.html

4 comments

I think what is comforting for a lot of people is that they can write isomorphic code that mostly automatically works on the frontend and backend.

IMO React is also an amazing abstraction and I like writing components better than stitching together HTML or other template/DSL based systems.

Symphony itself brought quite a few concepts from Rails to the PHP community. You can call the flow of ideas across communities "reinvention" but I think it's super healthy.

The web platform has had been an oddity in asking you to entirely switch languages when moving between backend development and frontend development. I think one of the most appealing pieces of these Javascript frameworks is that you can build everything in one common language. (You can—but don't have to.)

Fine-grained developer control of when data is fetched, when components are rendered, how they are rendered, and where they are rendered (server vs client) becomes a really welcome advancement.

I think that people who like JavaScript are happy with getting the abstractions you mentioned.

If building a vercel for PHP was such an obvious idea, I imagine someone would jump on it.

People just like React and the idea of decoupling frontend and backend ( Pretty sure just a few percentage of users use Nextjs with api routes and just use it as Create-React-App with SSG and SSR capabilities ). I haven't used Vercel that much in production but what does it bring compared to Heroku or cheaper and open source self hosted alternatives like Dokku or even caprover with it's really good UI and can deploy any backend as long as it's Dockerizable ?
Fun fact, you can actually write PHP function on Vercel :)

https://github.com/juicyfx/vercel-php

Laravel Forge does exactly this and does it beautifully