Developer happiness is not a catch-phrase. We are actively working to improve the quality of life for the more than 12,000 people downloading StimulusReflex every week, because happy developers enjoy a great surplus.
As with all major StimulusReflex releases, v3.4 is packed full of new features from 52 contributors that are directly inspired by the questions, requests and grievances of the 800+ people on the SR Discord:
we completely overhauled the client-side Reflex logging with per-Morph granularity
a brand new and shockingly customizable server-side Reflex colorized logging module
finalize life-cycle stage that occurs after all DOM mutations are complete
support for lazily evaluated signed and unsigned Global ID to model instances
cable_ready method that automatically broadcasts to the current user
speaking of CableReady, the new v4.4 means operation and broadcast method chaining as well as customizable should/did morph callbacks
an optional (but recommended) "tab isolation" mode to restrict Reflexes to the current tab
major improvements behind the scenes to better handle (many) concurrent Reflex actions
render is now automatically delegated to the current page's controller
StimulusReflex library configuration courtesy of our new initializer system
opt-in Rack middleware support for Page Morphs
automatic support for mirroring DOM events with jQuery events, if jQuery is present
drop-in Stimulus 2 support
warnings to alert you if your caching is off or your gem+npm versions don't match
JS bundle size drops from 43kb to 11.4kb - including CableReady, morphdom and ActionCable
More than anything, StimulusReflex v3.4 feels fast and incredibly solid. We didn't take any shortcuts when it came to killing bugs and doing things right. We owe that to our users as we use our surplus to build the world we want to live in, together. 🌲
make sure that you update
stimulus_reflex in both your Gemfile and package.json
it's very important to remove any
include CableReady::Broadcaster statements from your Reflex classes
OPTIONAL: enable isolation mode by adding
isolate: true to the initialize options
OPTIONAL: generate an initializer with
rails g stimulus_reflex:config
bundle remove cable_ready && yarn remove cable_ready
v3.3 introduced the concept of Morphs to StimulusReflex.
Page Morphs provide a full-page morphdom refresh with controller processing as an intelligent default.
Selector Morphs allow you to intelligently update target elements in your DOM, provided by regenerated partials or ViewComponents.
Nothing Morphs provide a lightning-fast RPC mechanism to launch ActiveJobs, initiate CableReady broadcasts, call APIs and emit signals to external processes.
There's a handy chart showing how the different Morphs work. Find all of the documentation and examples behind the link below.