4 ms·
None! Don't use these tools they massively complicate everything. Single Page Applications were the wrong direction for us. Tens of megabytes of massive js lib
by emilsedgh 6y ago
None! Don't use these tools they massively complicate everything.
Single Page Applications were the wrong direction for us. Tens of megabytes of massive js libraries built using bundlers and minifiers and shims and whatnot, only to render something on the screen that would've been rendered with pure html using ssr.
Honestly I enjoy coding with React a lot. Components are a really robust way of reasoning about UI logic. But it's not worth the problems it solved.
The usecase for SPA's is really small. Maybe Slack should use React sure. But not all the other apps out there. Look at Github and Heroku. Smooth, beautiful and fast experiences. So reliable.
I miss the old days of Smarty + jQuery UI. That was a better direction.
Had we invested this much effort into that approach, we would've had a much better performing web today.
- emilsedgh 6y agoJust to add a quick anecdote to this. We have a massive webapp done using React using all the fancy tools. One day I had to code a relatively complex email to send to clients, so I had to go back to template rendering. What a joy it was. I realized what a mental burden React and it's ecosystem have become.
- mrlala 6y agoYou should look from the perspective of developers who are not web developers. It's an insane fucking mess out there. SPAs (especially structured ones like angular) can give a developer a shot at creating a structurally sound interactive webpage without wanting to kill themselves.
- emilsedgh 6y ago1. Angular, React, Webpack, all these stuff add to the mess. They don't take away from it. A well organized framework can still provide a good developer experience. 2. The user experience really, really suffers from this toolchain.
- niceairport 6y agoThere's definitely an argument to be made about the second point. However many people accessing the SPAs have a fast enough internet connection that it's actually a better experience to download it all in one go. Also, "tens of megabytes" is a VAST exaggeration.
- emilsedgh 6y agoI'm looking at the application I'm responsible for. Downloads 3M Gzipped JS assets and takes > 250M "on initial load" and I feel sick to my stomach.
- niceairport 6y agoWhat does your build script look like?
- emilsedgh 6y agoPretty normal webpack config. We recently changed from babel to esbuild and are very happy btw.
- cultofmetatron 6y agonot sure why you're being downvoted. SPA's have their place but I agree with you that they are being heavily overused. I've seen plenty of applications that could have easily been a collection of server driven pages broken into an api and spa. I think it comes down to a few things where SPAs are great. 1. Programmers padding their resume. react looks more marketable that any server side templating technology 2. fomo, what if later we want to add something that needs it 3. seperate api/frontend teams, spas make seperating responsibility easier. two seperate codebases. of course it has its downsides 1. you're maintaining a communication bridege between two different applications. This entails a context switch if you're a developer hopping back and forth. 2. more failure modes to handle. Only so many things can go wrong loading a page. If an SPA breaks, it can render the entire page unusable. You also need to have error. handling code for inputs on both your frontend and backend. 3. large file sizes to download. This one has been beaten to death but it still holds true. Ive personally found a nice middleground with phoenix liveview. Its slightly more work than a tradtional page driven app while giving me teh ability to create all the features I was being asked for that before would have warrented an SPA. I hear livewire and stimulus reflex are great too.