4 ms·
For CRUD apps, using Rails etc. with Turbolinks[1] is the best way to go IMO. It gives you the SPA feel without the headache. In all SPAs, we load JSON, with Tu
by asattarmd 8y ago
For CRUD apps, using Rails etc. with Turbolinks[1] is the best way to go IMO. It gives you the SPA feel without the headache. In all SPAs, we load JSON, with Turbolinks, we load HTML of that page alone (without the CSS, JS etc).
[1] https://github.com/turbolinks/turbolinks https://github.com/turbolinks/turbolinks
- victor106 8y agoCan you use Turbolinks with a Java backend?
- duncan-donuts 8y agoYes, you can use it with whatever. https://github.com/turbolinks/turbolinks/blob/master/README.md https://github.com/turbolinks/turbolinks/blob/master/README....
- polote 8y agoIt is the best way to do what ? because from what I understand turbolink is giving you nothing. The only thing you can have is activating a a loaderbar at the top of the page ... Turbolink is a crutch for people that are not able to server side render an html in a few milliseconds.
- rpeden 8y agoIt's giving you more than nothing. It's fetching and replacing the HTML that needs to be changed, but removes the need to do a full-page reload, so the browser doesn't have to re-load and re-parse all of the HTML, and JS, and CSS. Even though the browser will keep a lot of this stuff cached, Turbolinks can make a site feel a lot faster from a user's perspective. But regardless, it's more than just a loading bar at the top of the screen. Whether it's the right fit or not depends a lot on what you're trying to do.
- disiplus 8y agothis is not just one simple drop in replacement, well it is if you load only html, but pages are usually html + js, even for "old" mvc. so because there is no page relaod you have to rethink all your events, objects and so on. so if i have to rewrite my js with this just so i could fake SPA then benefits are so much smaller
- swanson 8y agoIf you are talking about events for $(document).ready type things -- there is a turbolinks event for page:load -- it's a copy/paste replacement.
- theonething 8y agoTake a look at Stimulus JS in conjunction with TurboLinks https://stimulusjs.org/handbook/origin https://stimulusjs.org/handbook/origin
- andrei_says_ 8y agoThe rewrite is often just replacing document ready with a different event. Compare this with rewriting your app as an SPA.