You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a major version bump on the horizon, we can take a hard look at our payload sizes. IMO, much of the information that we're passing is redundant. I'm going to do a breakdown here so that we can discuss and share our approach with folks like @joshleblanc and @jonathan-s who write code that interfaces with our data structures.
Note that several points assume that #592 will be merged.
With the introduction of the Reflex class on the client, there is basically no need to send the stimulusReflex object back to the client. We are already tracking almost everything in the hash on the Reflex instance. In fact, so far as I can tell, the only thing that is new is the morph type. For page and selector morphs, html, permanent_attribute_name and children_only are passed as options to CableReady itself.
selector: propose defaulting to nil
payload: propose defaulting to {}
Note that we might even be able to default the permanent_attribute_name to data-reflex-permanent and save another 45 bytes for every Reflex operation.
If we capture the permanent flagged DOM elements during the Reflex init and store references, we can do permanent protection entirely on the client and not even need to send the permanentAttributeName at all.
With a major version bump on the horizon, we can take a hard look at our payload sizes. IMO, much of the information that we're passing is redundant. I'm going to do a breakdown here so that we can discuss and share our approach with folks like @joshleblanc and @jonathan-s who write code that interfaces with our data structures.
Note that several points assume that #592 will be merged.
Request
Today:
Details
attrs
: required, don't see how we can get around itdataset
: why do we send this as a separate list? why can't we get it from theattrs
?datasetAll
: propose that we omit this and default to{}
unless it is specifiedselectors
: propose that we omit this and default to[]
unless it is specifiedreflexId
: requiredresolveLate
: will be removed in SR 4suppressLogging
: propose that we omit this and default tofalse
xpathController
: will be removed in SR 4xpathElement
: will be removed in SR 4inner_html
: propose that we rename this toinnerHtml
and omit it and default to""
unless it is specifiedtext_content
: propose that we rename this totextContent
and omit it and default to""
unless it is specifiedreflexController
: propose that we omit this and default tostimulus-reflex
unless it is specifiedpermanentAttributeName
: propose that we omit this and default todata-reflex-permanent
unless it is specifiedtarget
: requiredargs
: propose that we omit this and default to[]
unless it is specifiedurl
: requiredtabId
: requiredversion
: requiredparams
: propose that we omit this and default to{}
unless it is specified or a form is serializedformData
: propose that we omit this and default to""
unless it is specifiedProposed:
Details
That has to look nicer, no?
Response
Today:
Details
With the introduction of the
Reflex
class on the client, there is basically no need to send thestimulusReflex
object back to the client. We are already tracking almost everything in the hash on theReflex
instance. In fact, so far as I can tell, the only thing that is new is themorph
type. Forpage
andselector
morphs,html
,permanent_attribute_name
andchildren_only
are passed as options to CableReady itself.selector
: propose defaulting tonil
payload
: propose defaulting to{}
Note that we might even be able to default the
permanent_attribute_name
todata-reflex-permanent
and save another 45 bytes for every Reflex operation.Proposed:
Details
Sign me up!
The text was updated successfully, but these errors were encountered: