(2018-07-05) Escaping The Spa Rabbit Hole With Modern Rails Jorge Manrubia Medium
Escaping the SPA rabbit hole with modern Rails – Jorge Manrubia – Medium
*There are three pieces included in modern Ruby on Rails that might rewire your mind when it comes to designing modern web applications:
One is Turbolinks, and I think it’s mind-blowing.
The other is an old friend that is often overlooked these days: SJR responses and plain AJAX-rendering calls.
And the last one is a recent addition: Stimulus
Turbolinks is not a problem-free silver bullet. The biggest complaint is that it can break existing Javascript code:
AJAX rendering and SJR responses
A similar resource that Rails has included for years are Server-generated JavaScript Responses (SJR). They let you respond to Ajax requests (typically form submissions) with javascript that gets evaluated in the client
Stimulus (see Stimulus10AModestJavascriptFrameworkForTheHtmlYouAlreadyHave)
you embrace the Rails way, your Javascript will focus on augmenting server-side-generated HTML and enhancing interactions (what Rails calls Javascript sprinkles)
Edited: | Tweet this! | Search Twitter for discussion
No backlinks!
No twinpages!