4 ms·
The biggest advantage of using modern SPAs is that it forces the developer to build the backend as an API with which you can interact programmatically
by sword_smith 7y ago
The biggest advantage of using modern SPAs is that it forces the developer to build the backend as an API with which you can interact programmatically
- hedora 7y agoThe API between the SPA and the server is an internal implementation detail that doesn’t need to support interoperability or backwards compatibility. I see no reason to believe interacting with it directly is easier than scraping an HTML page. (In fact, I’d expect it to actually be much harder and more fragile than scraping html in practice)
- chc 7y agoIn my experience scraping both, APIs have tended to be more stable than the structure of HTML pages. I'd guess this is because there's an incentive to keep your API stable (a breaking change for my scraper is also a breaking change for the front-end), whereas there's basically no reason not to rewrite giant chunks of the HTML to accommodate a design change.
- amiga-workbench 7y agoI do agree with this bit, even though I hate the end product. I've seen exactly what happens when you have a server side application worked on by a lazy developer, you end up with tightly coupled code inside all your templates and controllers and it devolves into a maintenance nightmare.
- dehrmann 7y agoThis doesn't work as well as you think once you consider multiple endpoints and round trips. You're better off with something like GraphQL or server-side making the API ship views to clients.