6 ms·
He has some great points. For 5 or so years I've been the guy who immediately started a SPA and I've turned 180 degrees. I now think SPAs are basically a cance
by pier25 7y ago
He has some great points.
For 5 or so years I've been the guy who immediately started a SPA and I've turned 180 degrees. I now think SPAs are basically a cancer, with some exceptions where an app-like website is justified (Gmail, etc) or a hybrid app. SPAs introduce unnecessary complexity and bloat for the vast majority of use cases.
- nop3 7y agoJavaScript should be used like a condiment instead of a whole meal. It's led to the bastardization of the web in my opinion.
- pan69 7y agoLike, all we have for dinner is tomato ketchup.
- steve_adams_86 7y agoI'm with you. It occurred to me that what I love about things like react or vue has nothing to do with SPA capabilities. It's just developer ease in building reusable, composable, testable components. I've had similar experiences with scaling too early into microservices for example. I need a seriously compelling reason to consider building around these paradigms now. The overhead is unreal. Both great ways to solve a problem, but not really a problem I've yet encountered - ever. I'm still glad I've had great opportunities to learn this, at least.
- pjmlp 7y agoThing is, building reusable components was always a feature of SSR Web frameworks since early 2000's, so there is no need for react or vue for bundle the HTML/CSS/JS that makes a fancy calendar widget. And with WebComponents being supported across the board, even less so.
- TomMarius 7y agoWeb components are useless, you can't pass values around without converting them to string or employing a non-native mechanism, and of course you need to do all DOM updating by hand - which is both way worse than just using React from various perspectives.
- pjmlp 7y agoOnly from the point of view of React devs with their anti-WebComponents agenda. Everyone else is just embracing them.
- TomMarius 7y agoThere are no tools to embrace them, there is no way to make an universal web component like you can do with a React component without severely limiting what you can do and how you can develop it and how it performs. It's very sad, I'd love to use native Web Components but it's so bad it hurts (or you end up reimplementing incompatible React).
- pjmlp 7y agoYep, again the anti-WebComponents message. Angular, Vue, Polymer, Svelte and a couple of Web based RAD editors look like tooling to embrace them to me. Since I don't have any plans to ever use React, how does your magical component work with my tooling?
- TomMarius 7y agoMy component is "magical" thanks to the React ecosystem and because it uses the tools the React platform provides to greatly integrate with said ecosystem. The tools you suggested are not comparable to React - React Hooks and Contexts are the part I'm most interested in. If you use different tooling, then it doesn't work, and that's okay. You don't need to care about React and I don't need to care about Web Components. It was suggested that React is useless and should be replaced with Web Components, and I'm simply saying that Web Components are not sufficient to replace React, not that you should switch.
- SomeOldThrow 7y agoThe html version of gmail still works great! It also loads in under 30 seconds (near instantly for me) and is incredibly snappy. It also doesn’t look like a PM vomited google product integrations over the screen.
- kchoudhu 7y ago> It also loads in under 30 seconds Jesus Christ what is going on with the web.
- otakucode 7y agoI have a theory. Search is a Killer Feature. And I mean that in the most extreme and broadest way possible. The user interface paradigm of "type a bit of what you want, hit enter, click and immediately be using what you want" was, in hindsight, what users wanted/needed. It was so completely successful that nothing else mattered. It didn't matter that web apps are fundamentally flawed, introducing ridiculous latency on all the other simpler interactions (would you tolerate 200ms latency for a clientside application to respond to you clicking a button?), throwing away all of the work done to create and present unified user interface elements, enabled every click and action to be surveiled, profiled, and datamined, added points of failure completely outside of the users control, locking user data away in someone else's systems, etc. None of that could outweigh the gargantuan power and usability of search. Desktop OS' still aren't treating search as a first-class citizen. You still can't just search and be using a new application nearly immediately. Mobile gets close with their app stores, but there's still friction there. Even though the W3C adamantly refused to acknowledge the web as a platform for interactive applications for 2 decades, it just kept growing and more was shoehorned into their static document presentation system no matter what they did. It amazes me how difficult it still is to find an application that does what you need, download it, install it, then launch it. Unsurprisingly, even that relies upon the web to accomplish the first searching portion. I like to dream that perhaps we are approaching a sort of convergence, though. The web makes sandboxing less and less relevant as users data is all migrated into remote services (protecting your data is what sandboxing was FOR, right?) while desktop OS are making clientside sandboxing and containers easier and easier. Technology never fails to be interesting to watch while it develops alongside us.
- cryptica 7y agoIf you use the right tools, SPAs reduce complexity. The problem is that most of the popular frameworks today add unnecessary complexity. I still can't believe that we live in a world were most developers are OK to coding with a 5 to 15 second build delay and source mapping during development. I find is extremely frustrating. It slows me down and breaks my train of thought.
- tluyben2 7y ago> If you use the right tools, SPAs reduce complexity Like? I am curious: built a few SPAs (quite complex ones) and it sucked; I got the tools/frameworks from HN. If you use the right tools ‘tradional’ websites are not complex either.
- cryptica 7y agoI do think that sometimes you just need a simple static website and then don't need an SPA. I think SPAs are good when you have to handle a lot of dynamic data. Especially realtime data. I built a sample SPA with VueJS, Asyngular and RethinkDB to demo how easy it is. It's a relatively complex app where all the views update in realtime but all the server code is less than 300 lines. The framework does most of the work; on the back end, all you need to do is define the data schema and access control rules on the server side. See https://github.com/SocketCluster/ag-crud-sample/blob/6805499f5e8b241632a703dd1f26eb99b2120872/server.js#L80-L148 https://github.com/SocketCluster/ag-crud-sample/blob/6805499... For the front end, I use VueJS in the simplest possible way without any build step during development. I just define my main app component and setup a component for each page: https://github.com/SocketCluster/ag-crud-sample/blob/master/public/app-inventory.js https://github.com/SocketCluster/ag-crud-sample/blob/master/... For data, I just use my own model and collection components to bind to the server data in real-time: https://github.com/SocketCluster/ag-crud-sample/blob/master/public/pages/page-category-details.js#L17-L26 https://github.com/SocketCluster/ag-crud-sample/blob/master/... The collection component lets you bind to a 'view' which is declared in the schema on the server. It's just CRUD with realtime subscriptions built into the model and collection objects, nothing special. You can achieve a lot more if you just keep things simple (at least conceptually) and use the right tools.
- quickthrower2 7y agoThere is so much entertainment in SPA vs HTML and similarly Vim vs Visual Studio, static vs. dynamic types etc. debates. But to be boring (sorry!) it all comes down to the most approriate tool for the job. At work it's a SPA because it's an application delivered via the web. Delivering via not the web wouldn't work as well, and delivering it as not an application is a non starter. My current side project is a HTML sprinkled with JS, turn off JS and you can use most of the site kind of thing. Why? Because ... well mainly SEO to be honest. But there you go ... reasons!
- samcday 7y agoBah, to hell with your boring moderate stance! I would much rather have endless debates with others about why MY hammer is better than their hammer, and ignore the fact that maybe not everything is a nail ;)
- azdacha 7y agoGoogle recently updated their crawlers to understand "full Javascript websites" ; I don't like the term spa as one could build one with pure css and html and still have a single page. Now onto the js frameworks, it depends on which one is used. One could build a website watching web.dev and use a budget to make sure it's app is lightweight. There are numerous tools to make sure an app is properly made. But tbh, I like my js framework because the community is so great, I know the framework is good even tough there are arguments there and there. I guess it all depends on the tool you choose and how you build your end product. Now having a website that loads in 30s is a joke I haven't experienced in the modern web, and my js framework actually provides a powerful caching system that makes the website available even tough I could bring down my dns. To this point I presume we are just in a odd point in web evolution where we have discovered a new paradigm and rushed into it's usage without maturity. These things will change but I think it is important to know that some JS front framework are not incompatible with a lightweight web.
- TeMPOraL 7y ago> But to be boring (sorry!) it all comes down to the most approriate tool for the job. It does. But, depending on how you look at it, either most web companies absolutely suck at picking right tool for the job, or the job isn't really what you'd think it is. Taking your typical plain webpage done as an SPA, you could either say (as I would) that the authors picked wrong tool for the job, introducing completely unnecessary complexity both on their end and customer end - or, you could tell that the job of that website isn't to be useful to and considerate of the visitor, but to be e.g. CV-fodder for web developers, a way for the team to show off their sophisticated infrastructure, or for the marketing to play their A/B testing shenanigans, or for the company to show off to the investors, etc. Once you account for all the "parts of the job" that are orthogonal or even opposite to delivering value to users, suddenly a proliferation of frontend complexity makes perfect sense.
- javajosh 7y ago"SPA" is a fine, if difficult, architectural pattern. One needs to make a distinction between the processes and tools, and the pattern itself. SPAs are bad because of how they are built; personally, I blame the rise of front-end build tools for this. When it's easy to add dependency after dependency, then you get a bloated nightmare. Transpilers don't help, either, since they just remove you even further from "bare metal" of the browser, which is itself already at a dizzy height from the bottom. You might say that modern javascript programmers are too high, so to speak.