kalil@rootstrap.com
github.com/kaozdl
bruno.vezoli@rootstrap.com
github.com/brunvez
In the early days, web pages were mostly static sites that displayed static content.
People coded HTML directly
and what they wrote was the final result that the user got to see when it enters the page
To allow more interactivity we switched the paradigm to server side rendering.
Now templates for websites were written with other languages embedded in HTML.
The server processed this and it showed the user the site.
JavaScript initially thought for adding some logic to styles, began the process of becoming what it is today.
JQuery introduced techniques like Ajax
Allowing to partially reload pages to create more interactive experiences
This caused an huge paradigm shift.
Sites switched from being multiple server generated pages, to a being a single page that consumed data from an API after years of competing frameworks today we have React.js, Vue.js, Angular and Ember as examples of this.
Most of these are a must today, but, how many do you need?
Stimulus is a JavaScript framework with modest ambitions. Unlike other front-end frameworks, Stimulus is designed to enhance static or server-rendered HTML—the “HTML you already have”—by connecting JavaScript objects to elements on the page using simple annotations.
These JavaScript objects are called controllers, and Stimulus continuously monitors the page waiting for HTML data-controller attributes to appear. For each attribute, Stimulus looks at the attribute’s value to find a corresponding controller class, creates a new instance of that class, and connects it to the element.
We extend the capabilities of both Rails and Stimulus by intercepting user interactions and passing them to Rails over real-time websockets. These interactions are processed by Reflex actions that change application state. The current page is quickly re-rendered and the changes are sent to the client using CableReady. The page is then morphed to reflect the new application state. This entire round-trip allows us to update the UI in 20-30ms without flicker or expensive page loads.
With StimulusReflex, small teams can do big things faster than ever before. We invite you to explore a fresh alternative to the Single Page App (SPA).