4 ms·
One of the promises of node.js (that I've not seen pan out really in practice since) that got me interested 4-5 years is the ability to render a web page on ser
by jsjohnst 11y ago
One of the promises of node.js (that I've not seen pan out really in practice since) that got me interested 4-5 years is the ability to render a web page on server or on browser using same codebase. Take as an example a heavy codebase like Yahoo! Mail or Gmail. Notice how slow Gmail especially is from login to "ready state"? Now imagine if the first page of your inbox was rendered server side and sent as normal HTML markup. If it was designed well, the JS would progressively load after that and if for example I click compose before that JS was loaded yet, the click would be treated as a normal click and it'd round trip to the server and then render the compose view and send me back the new page. If the JS had loaded, it'd just be rendered in browser like normal. Doing tricks like this can massively increase the perceived responsiveness of web apps. I've seen prototypes of Yahoo! Mail built like this and man they are so fast, but sadly doing this is well is very complicated and node.js never actually helped as much as it promised too. Don't get me wrong, what I described above I've seen done in production code, it's just it was a very manual and slow process and node.js never did that much to help, IMHO.
- b0p1x 11y agoYou might be interested in what is going on in Drupal 8 with regard to pre-caching and a newer (now in core I think) module called BigPipe. It does some of what you describe in PHP in a fairly generic way. AFAIK, you just enable this module and ensure caching is enabled. From that point on, slower assets load when ready so the rest of the site is already visible... like Facebook.
- jsjohnst 11y agoI'm more talking about fast start SPA, not partial content loading strategies. There's a number of utilities that does what Drupal is doing. Turbolinks has been doing what you describe for years (if memory serves) with Rails.
- matthijs_ 11y agoEmber FastBoot? And React also published something similar recently.
- jsjohnst 11y agoI've seen many attempts, but nothing has really taken hold as its really difficult to do right. Rather than pointing at libraries that can "help", I ask you to instead point at any places it's being done well in production, especially at scale.