3 ms·
React and the tools used to build React applications (mainly webpack) strongly incentivize engineers to create single page applications, but don't provide good
by hoorayimhelping 6y ago
React and the tools used to build React applications (mainly webpack) strongly incentivize engineers to create single page applications, but don't provide good routing and back-button support out of the box. To make a React SPA behave like a traditional web page, you need to add a third party routing library, and that has traditionally been a dumpster fire in React.
That's a quick example of the way the React monoculture is bad for users of the web from a structural, not content point of view.
I say this as someone who has been using React professionally for 5+ years, and who was initially incredibly excited about React's potential. I'm less convinced it's actually good, after seeing how it's used in day to day work with regular engineers working on regular software that isn't Facebook scale.
- ulisesrmzroche 6y agoBut then as soon you click the back button you lose all the state and have to do a lot of craziness to keep it in sync with the server. That’s the problem you’re trying to solve, trying to keep the server-client data reliably in sync. And no one wants to wait around for all that state to load, that’s why those websites were so slow. Plus, then there’s the challenge of scale and traffic It’s just not about the back button. It’s not about fashion, there are real problems that an SPA fixes. Sure it’s more complex, but the problem is more complex It looks like you and a lot of people in HN work on super small websites that don’t require React or any SPA but yall don’t have to shit all over it and people who choose an SPA to build their web apps. In fact, more often than not, it’s the right choice
- ramraj07 6y agoI come from the never-react side, but I see the benefits as well. However, the issue is that an SPA is fundamentally something that doesn't fully integrate with what browsers were designed to do, which is show independent webpages. An SPA makes sense if your site is exactly that, an app in the form of a site. Gmail can be an SPA, Google Docs can be _another_ SPA, they shouldn't be in the same SPA. The question is if your particular problem is fully encapsulated as one app or not, and whether you even need any real interactivity in it at all. The other issue is that practically react tends to make people think they understand what they're doing but they do not really. This happened in the php days as well, but at least the sphagetti code was still interpretable without fully breaking your head, it was much more linear. With react, if the code is written by someone who doesn't share the same ideas of state and data flow as you, it's a huge headache to figure out what they have done.
- ulisesrmzroche 6y agoBut it’s been such a long since browsers were first invented and they have changed to accommodate for web apps. Chrome, safari, Firefox et al today are far more capable than the browsers of old, and they do so because the overwhelming majority of users, virtually all of them want web applications. As for the spaghetti code yes, it can be, but it doesn’t have to. I’m not gonna say it’s beginner friendly, but the software React is meant to be used for it’s not for beginners either