Skip to content

Conversation

calebcordry
Copy link
Member

@calebcordry calebcordry commented Feb 24, 2020

Splits logic handled by current DomWriter into two separate classes with some API changes.

The first class DetachedDomStream expects two callbacks (onChunk, onEnd) in its constructor, and handles taking the given chunks and writing them to an in memory document. It will pass the in memory doc to its callbacks.

The second class DomTransformStream uses these two callbacks and exposes two methods waitForHead that returns a promise of the head, and transferBody which starts transferring elements from the detached doc to the given target element.

@calebcordry calebcordry marked this pull request as ready for review March 2, 2020 22:49
@calebcordry calebcordry requested a review from lannka March 2, 2020 22:49
@calebcordry calebcordry merged commit eb3d5f3 into ampproject:master Mar 10, 2020
@calebcordry calebcordry deleted the dom-streamer branch March 10, 2020 01:05
@calebcordry
Copy link
Member Author

Part of #27189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants