rails generate channel testin your Rails project folder. This will ensure that your ActionCable setup has been initialized, although you should verify that in your
ActionCable is connectedin your browser's Console Inspector and
Client is livein your server's STDOUT log stream.
StimulusReflex.initialize()and share one ActionCable connection.
debug: trueto the initialize options like this:
↑ stimulus ↑) shows the target "Pagy#paginate" (name of the Reflex class and the Reflex action being called) as well as an object containing the reflexId, any
args(arguments) being passed to
stimulate(), the Stimulus
controllerthat invoked the Reflex, and the
elementthat the Stimulus controller instance was placed on.
↓ reflex ↓and their job is to report on exactly how things went down.
morphoperations are always used for Page Morphs.
data-reflex-rootattribute is used to specify one or more CSS selectors, as seen in the example above.
morphoperation. They tend to be extremely fast because they do not need to go through the ActionDispatch controller stack. There could be a blend of
inner_htmlCableReady operations in one Reflex.
CLONEDinstead of showing a duration, because non-active tabs have no way of knowing when the Reflex was started.
warnlog level, as is common in development environments:
session_id- the first 8 characters of the current user's session id
session_id_full- the current user's session id
reflex_info- the Reflex Class # the Reflex action
operation- the CableReady operation used to execute the current Morph
reflex_id_full- the unique UUIDv4 identifying the Reflex
mode- whether the current Morph is Page, Selector or Nothing
selector- the destination CSS selector for the content to be updated
operation_counter- shows the current and total Morph count for this Reflex
connection_id- the first 8 characters of the ActionCable Connection identifier
connection_id_full- the ActionCable Connection identifier
identified_byresources defined, the logger will look into each one of them in the order they are defined, looking for the first match.
beforeReflexclient-side callback that wants to re-parent an element. Perhaps you use
CableReady#removeto destroy the element that holds the
stimulus-reflexcontroller element which initiated the Reflex.
stimulus-reflexcontroller in the same position in your DOM hierarchy so that it can finish the transaction.
finalizeReflexcallback to perform any desired DOM manipulations client-side after the Reflex has fully completed running all operations.
push_statemethod allows you to drive the page the user sees from your server-side code.
loadevent, a Turbo Drive visit event or your own pageshow event handler, we recommend that you don't attempt to immediate call a Reflex operation as soon as the page loads. This advice is especially important in the context of Page Morphs.
data-avengerattributes instead of
data-reflex-permanentwill not work.
span. morphdom just doesn't care.