-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC simplifed JSON payload + named batches #142
Conversation
This is very exciting! A lot to love about this! Here are some additional thoughts which just came to mind:
|
Reading this, my feedback feels like a bunch of me saying "no". It's just a coincidence, I swear! |
|
|
{
"payload_version": "5",
"cable_ready": {
"package_version": "5.0.0"
},
"operations": [
{
"operation": "innerHtml",
"html": "HTML 1",
"selector": "#posts"
},
// {...},
// {...},
// {...}
]
} And similarly if it's then wrapped in StimulusReflex:
All the shown variants also include a
|
Marco, I really appreciate the energy that you've put into describing this... but this direction is a hard no for me. I believe that the simplicity of what this PR achieves is a huge leap forward as it is currently structured. The code required to parse and work with an array of objects is easy to read and understand, which is a major win. StimulusReflex 3.5 depends on CableReady 5, so there is no concern about JSON schema versioning. We have never made any claim or suggestion that the structure of the JSON itself is never going to change. The change proposed in this PR is 100% transparent to the developer without any version being passed. Supporting the previous JSON schema would mean SR would have to support the old version of CR, too. That's already not possible due to 3-4 merged SR features which rely on CR v5. Sorry, I just can't get behind this one. On the positive side of things... I might actually be able to simplify the SR implementation side even further. In 3.4 we do this awkward thing where the |
Change is transparent but incompatible with any stored v4 payloads.
Operations now fire in the order that they were created.
Mix and match multiple batches + non-batched operations in one broadcast.
Pass
batch: true
orbatch: "foo"
as an option.cable-ready:batch-complete
will be raised ondocument
, withbatch: 'foo'
in thedetails
object.TODO: @marcoroth proposed a potentialcable_ready.batch("foo") do..end
syntax.TODO: SR PR to followSee stimulusreflex/stimulus_reflex#536