React on the server is not PHP
The article highlights the evolution from PHP to full-stack JavaScript frameworks, emphasizing improved collaboration, product cohesion, and developer efficiency through modern tools like Next.js and Remix in web development.
Read original articleThe article discusses the evolution of web development, particularly the transition from PHP to modern full-stack JavaScript frameworks. It addresses the misconception that server-side JavaScript is merely a return to PHP, emphasizing that the current landscape is a significant advancement. The author reflects on the limitations of early web development practices, where PHP was used for simpler applications, and highlights the challenges faced when integrating JavaScript for interactivity. As applications grew more complex, the need for a more cohesive approach became apparent, leading to the rise of single-page applications (SPAs) and the challenges they introduced, such as performance issues and a divide between front-end and back-end developers. The emergence of frameworks like Next.js and Remix is presented as a solution, allowing developers to utilize JavaScript throughout the stack, thereby bridging the gap between front-end and back-end development. This shift is seen as a way to enhance collaboration and create more cohesive products, ultimately empowering developers to manage both server and client-side logic effectively. The author encourages developers to embrace these modern tools and the full-stack development paradigm.
- The transition from PHP to full-stack JavaScript frameworks represents a significant advancement in web development.
- Modern frameworks like Next.js and Remix allow for a unified approach to server and client-side development.
- The evolution of web development has led to improved collaboration between front-end and back-end developers.
- Embracing full-stack JavaScript can enhance product cohesion and developer efficiency.
- The current landscape builds on years of UI development principles, moving beyond the limitations of earlier practices.
> we've developed solid principles for building UIs
There's not really any substance to this statement or the paragraph it's in. I would skip this article entirely, and I think a much more profound view of this concept is "Mind the Gap" talk by Ryan Florence about dissolving the concept of the network and explicit code needed to manage that: https://www.youtube.com/watch?v=zqhE-CepH2g
I am also miffed that the criticizers of React = PHP are often Rails developers who completely overlook that Rails is PHP on cocaine, it is implicit, untraceable database calls sprinkled across templates, and the more use the worse it gets and it quickly becomes un-optimizable. At least with React API calls are explicit, not magic!
This is a blog btw, so a static should do! I do domain management, animations and implement stats from logs on the fly. And i even have a markdown blog! ;)
My page loads in under 1 second with a hard refresh.
Backend for a combined full page controller or partials does 1ms rendering with logged in user. ofc stuff is cached, but the user should never notice. All system related calls are fast as f... and intended this way. DB with PDO takes most of this millisecond.
I do vanilla TS with fetch on the frontend which is responsive as a GUI and that's great, i can modify the DOM and do frontend stuff - and not more. Why would i? One call to the ldap-client in nodejs, even with bun, is already slower than my whole page.
One tool for one job!
If you can beat this wake me up for js on the backend.
There are certainly reasons to use JS on the server but efficiency is definitely not a big one. Even less when using React which is probably the slowest of the modern framework/libs doing SSR.
Actually it would sort of be nice if these frameworks could be coded such that if I have JavaScript shut off, it just runs the code elsewhere and sends me the site.
Or better yet, just write HTML and CSS and be done with it. But that’s too hopeful.
React was originally designed as the PHP on the browser side. Facebook was a php powerhouse, Jordan Walke invented React based on XHP, HHVM, etc.
I'm sure there are valid uses for server-side React, but at the end of the day, using server-side languages such as PHP or Rails (or even rendering pages in Node.JS if you like JavaScript) can be much faster and simpler.
I say this having been involved in an app rewrite that used Remix. The project has taken 2 years (and still isn't quite out), and the engineering leaders who made the decision have agreed that we probably could have rendered most of the pages in Rails and used JavaScript for a limited number of things. With that said. I am hopeful that the project will work well when all is said and done, but there were a lot of tradeoffs associated with going to a server-side rendering framework.
As traffic increases, the server's ability to handle requests diminishes, especially under high loads with complex rendering. This is exacerbated by the fact that each request often requires repeatedly rendering the same React components from scratch, rather than reusing client-side resources.
I spent the last year transitioning from data science to learning full stack web dev and it was pretty wild. There isn't exactly an obvious entry point into learning all of this stuff and there are so many layers of abstraction now.
As hilarious as it sounds, I actually first tried to learn web development by building my first website with Next js on Vercel without even knowing basic html, css, js or what a webserver was. Needless to say, I hit a hard wall and decided to learn web dev from the ground up with html, css, js and flask.
Are you tired yet?
I took this headline to be a dig against React on the server, but I guess the author intended the opposite.
Flavour book: https://frequal.com/Flavour/book.html
Jquery wasn't pretty but it did smooth over browser differences (as someone who had to target a blackberry browser, I still respect it.)
Vue/ React and company are pretty amazing. But sometimes I wonder if they're too much for a lot of the use cases they're used with. I find a fair number of sites that don't quite work.. that could have used a simple form. The "javascript form check" before submission seems to be quite frequent. Webpack is a pain frankly.
modern php is pretty amazing. Though the trend of getting on the upgrade hamster wheel and frameworks use of the latest/greatest makes it harder to like. When I run into a perl script at work, there is some relief that it will probably work, as perl just isn't changing (warts and all).
Now I'm doing the same thing, and decided to go with Deno because I wanted to learn JavaScript.
Does something like Next replace something like Deno, or does it work with it?
On that note, I’m a happy PHP developer, PHP doesn’t suck anymore (https://youtube.com/watch?v=ZRV3pBuPxEQ), and there is no way to say JavaScript doesn’t have at least as many footguns now. (Personally, I think JavaScript’s footguns - like the ludicrous dependency trees and framework churn - are actually worse.)
We're moving to PHP++!