renderContainer(diff, kind){
return this.liveSocket.time(`toString diff (${kind})`, () => {
let tag = this.el.tagName
// Don't skip any component in the diff nor any marked as pruned
// (as they may have been added back)
let cids = diff ? this.rendered.componentCIDs(diff).concat(this.pruningCIDs) : null
let [html, streams] = this.rendered.toString(cids)
return [`<${tag}>${html}</${tag}>`, streams]
})
}
Port support for streams from https://github.com/phoenixframework/phoenix_live_view/pull/2423
The wire format does have a new
stream
key that the diff/merge will need to handle.It is used in
comprehensionToBuffer
where previously justDYNAMICS
andSTATIC
was done.The whole of
rendered.js
changed from output just a rendered string to also tracking and outputting the streams toohttps://github.com/phoenixframework/phoenix_live_view/blob/45bd9bd23dcd4524a328950f511ff30f8382c4dd/assets/js/phoenix_live_view/rendered.js#L44
https://github.com/phoenixframework/phoenix_live_view/blob/45bd9bd23dcd4524a328950f511ff30f8382c4dd/assets/js/phoenix_live_view/rendered.js#L37-L40
Rendered.toString()
is called inrenderContainer
renderContainer
is called and the output put into aDOMPatch
DOMPatch.perform()
then applies thestreams
changes before the normalmorphdom
algorithm