3 ms·
What 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 si
by btown 7y ago
What 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.