4 ms·
Can you give some specific examples of this problem? Frontend developer curious what kind of trends/solutions you mean.
by ketzo 7y ago
Can you give some specific examples of this problem? Frontend developer curious what kind of trends/solutions you mean.
- chubot 7y agoHere's my take on it from a few months ago: ---- ... Claim: Most sites are mostly static content. For example, AirBNB or Grubhub. Those sites could be way faster than they are now if they were architected differently. Only when you check out do you need anything resembling an “app”. The browsing and searching is better done with a “document” model IMO. Ditto for YouTube... I think it used to be more a document model, but now it’s more like an app. And it’s gotten a lot slower, which I don’t think is a coincidence. Netflix is a more obvious example – it’s crazy slow. To address the OP: for Sourcehut/Github, I would say everything except the PR review system could use the document model. Navigating code and adding comments is arguably an app. On the other hand, there are things that are and should be apps: Google Maps, Docs, Sheets. edit: Yeah now that I check, YouTube does the infinite scroll thing, which is slow and annoying IMO (e.g. breaks bookmarking). Ditto for AirBNB. https://lobste.rs/s/jmmr3w/interview_with_drew_devault#c_wucxv3 https://lobste.rs/s/jmmr3w/interview_with_drew_devault#c_wuc... context: https://lobste.rs/s/jmmr3w/interview_with_drew_devault https://lobste.rs/s/jmmr3w/interview_with_drew_devault I haven't used sourcehut much but the UI is going in the right direction IMO. It looks nice and is functional, at 5% of the weight and 20x the speed of similar sites.
- noahtallen 7y agoIsn’t Github following the document model? At least, that’s my impression of how the UI works (I.e. none of the consistent UI elements stick around as you navigate)
- chubot 7y agoYes Github looks pretty close to the document model. I think that's why they were able to optimize it over time. It isn't exactly fast, but I think it's gotten faster over time. On the other hand there are lots of blogs that won't even render without JS turned on. Those are apps, but IMO they should be static content.
- btown 7y agoWhat about when you need an editing interface with an instant preview, though? You would want to reuse the component that renders the static content. So it’s simpler, and leads to happier devs, to treat both as an app from the beginning, and if you need to (for SEO or performance), server-side-render using the same codebase. Is this silly? Absolutely. Is it a global optimum? Possibly.
- chubot 7y agoI don't really see what you're saying. That doesn't appear to apply to any of the examples I gave: AirBNB, Grubhub, Github, YouTube, etc. Or if it does, it applies to a small part of the site. Again, the claim is: most sites are mostly static content.
- richajak 7y agoFor this specific example, I would use event listener to sync the content. All done manually in DOM, no shortcut, some codes duplicated. I think that's what SPA frameworks and its components try to promote, single point of update. Personally, I like the vannila JS approach, a bit tedious, but I know what I will get.
- bazza451 7y agoCould you expand on this? I’m interested in the opinion
- abatilo 7y agoI tend to agree with most of what you're saying, but one thing that leaves me conflicted is that with a document model, don't you lose the personalization of the content? One of the reasons Netflix or YouTube is so slow is because every time you load up the page, you're supposedly getting a page that's full of content targeted specifically for you. Would you say that you just don't want the personalization?
- chubot 7y agoWhy do you think you lose personalization? That's an independent issue. I don't mean the site is completely static. I mean the site is rendered on the server, like how 99% of websites worked before 2010 or so, including Google's. Those sites were personalized. A shorthand for the argument is jQuery vs. React. jQuery enhances a document; React "takes over" the page to give you an app. There are limitations of jQuery which is why I didn't say that specifically, but that's the general idea. ---- I'm finding in the last 5 years that people "forgot" how websites were made. It seems like the "default" mode of thinking switched to SPA. SPA makes some things more convenient and other things less convenient, but it's totally independent of functionality, like whether the site is personalized or not. Ironically SPA seems to be so slow that people now render it on the server, which is totally bizarre to me. ---- Update: This comment in the same thread goes into the issue of state management, and performance: https://lobste.rs/s/jmmr3w/interview_with_drew_devault#c_6ppu3t https://lobste.rs/s/jmmr3w/interview_with_drew_devault#c_6pp... There's a legitimate reason for the SPA architecture, but it comes with many downsides as well. Good article (which is ironically on Medium, a great example of a document turned into a terrible, slow app): https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4 https://medium.com/@addyosmani/the-cost-of-javascript-in-201... https://news.ycombinator.com/item?id=17682378 https://news.ycombinator.com/item?id=17682378