News for hackers. Stuff that matters.
Re:In Defense of the Modern Web by snazz on Friday May 15, 2020 @10:43AM (#23192739)
As discussed on a recent thread (https://news.ycombinator.com/item?id=23137324), there are a variety of nice frontend tricks to make a server-rendered site feel nicer (LiveView, TurboLinks, Livewire, instant.page).

I'm a fan of these kinds of solutions. For my 100% static website, https://instant.page does make it feel instant. TurboLinks feels a little "heavier" and has a more complex interaction with other frontend code, but it works very well.

Re:In Defense of the Modern Web by basch on Friday May 15, 2020 @11:14AM (#23193082)
Another is: DerbyJS, Racer, and ShareDB who have been fighting for this future for what feels like forever, but meteorjs just torched it from a popularity perspective, in the the event-driven server-side rendering realm. Despite giving a much worse end user experience, it was more popular with developers. Is Lever really the only company using Derby?

https://github.com/derbyjs/derby

https://github.com/derbyjs/racer

https://github.com/share/sharedb

https://derbyjs.com/

Re:In Defense of the Modern Web by enahs-sf on Friday May 15, 2020 @11:39AM (#23193433)
makes me harken for the good old days of backbone.js. everything you need, nothing that you don't.
Re:In Defense of the Modern Web by basch on Friday May 15, 2020 @11:44AM (#23193505)
I think its kinda great that you can just use ShareDB with whatever else you use, or also use racer, or go full blown framework. The way its abstracted gives you the power to choose more or less.
Re:In Defense of the Modern Web by filleduchaos on Friday May 15, 2020 @11:01AM (#23192949)
Yes - those were the exact technologies I had in mind when reading that paragraph. We've been pre-fetching/loading HTML in place for ages! If all you need is faster/less jarring transitions between static pages, it's incredible to me that anyone would immediately reach for an SPA.
Re:In Defense of the Modern Web by hombre_fatal on Friday May 15, 2020 @11:55AM (#23193654)
Funnily enough, the TFA is on a Ruby on Rails blogging platform that uses these tricks to feel incredibly fast. Just look at your network log as you hover links.
Re:In Defense of the Modern Web by juped on Friday May 15, 2020 @01:03PM (#23194501)
LiveView may not be "the future", everyone loves their Javascript too much, but it is the future for me. AJAX with the server is what I feel I was promised back in the Web 2.0 days, not tons of Javascript running in the browser.
Re:In Defense of the Modern Web by danjac on Friday May 15, 2020 @11:10AM (#23193047)
I recently used Turbolinks + Stimulus for a Django side project. While these projects originated in Rails, it was quite easy to add to Django with some middleware and webpack tweaking. Stimulus provides some good structure and constraints for adding JS "sprinkles" to the site and overall it's worked very well. It feels more like I'm building with the browser and HTML rather than against or around them. That said, I don't think this approach would fly at work and would probably be frowned upon as maybe inefficient or out of date compared to the pure SPA+API architecture.
Re:In Defense of the Modern Web by sknzl on Friday May 15, 2020 @01:26PM (#23194786)
I have also thought about adding Turbolinks and Stimulus to a Django project. Can tell more about the changes to the middleware and webpack?
Re:In Defense of the Modern Web by danjac on Friday May 15, 2020 @01:53PM (#23195140)
https://gitlab.com/danjac/localhub/-/blob/master/social_bfg/...

IIRC there were some old packages but these were unmaintained and didn't work with later versions of Turbolinks, so I ended up looking at Rails source and other examples. Basically making sure to handle redirects and headers correctly. You can see the webpack config in the same project, pretty much just standard setup with some tweaks for loading Stimulus controllers.

Re:In Defense of the Modern Web by the_jeremy on Friday May 15, 2020 @01:38PM (#23194938)
instant.page looks super cool. It seems so simple after-the-fact, but I never thought about it. Thanks for sharing!