3 ms·
As discussed on a recent thread (https://news.ycombinator.com/item?id=23137324 https://news.ycombinator.com/item?id=23137324), there are a variety of nice front
by snazz 6y ago
As discussed on a recent thread (https://news.ycombinator.com/item?id=23137324 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 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.
- filleduchaos 6y agoYes - 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.
- hombre_fatal 6y agoFunnily 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.
- danjac 6y agoI 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.
- sknzl 6y agoI have also thought about adding Turbolinks and Stimulus to a Django project. Can tell more about the changes to the middleware and webpack?
- danjac 6y agohttps://gitlab.com/danjac/localhub/-/blob/master/social_bfg/common/middleware/turbolinks.py 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.
- basch 6y agoAnother 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/derby https://github.com/derbyjs/racer https://github.com/derbyjs/racer https://github.com/share/sharedb https://github.com/share/sharedb https://derbyjs.com/ https://derbyjs.com/
- enahs-sf 6y agomakes me harken for the good old days of backbone.js. everything you need, nothing that you don't.
- basch 6y agoI 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.
- juped 6y agoLiveView 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.
- the_jeremy 6y agoinstant.page looks super cool. It seems so simple after-the-fact, but I never thought about it. Thanks for sharing!