Re: [whatwg/dom] Proposal: DOMChangeList (#270)

Hey guys -- @drufball pointed us at this proposal and the async dom proposal and asked for some thoughts from FB on the api. I think there's a lot of interest in both APIs. Facebook incrementally renders a large part of our site and being able to do things like do that rendering in a worker thread and send a transaction or to do async layout are really valuable.

With that in mind I wanted to take a step back and talk a bit about how this might benefit a site like FB. At a very high level the goal of the API is to keep the UI responsive in the face of manipulations to the UI. Ideally this API would make it possible to parallelize layout with work the application wants to do.
 
So to take a concrete example, let’s say that you’re using FB newsfeed and that the page is downloading a new feed story to display. At the same time the user is writing a comment. 
 
* Ideally we want to minimize the typing lag in the comment while allowing the rendering of the feed story.
* The event handler for the keyboard events for the feed story needs to have information that reflects the current visual state of the DOM (for example, we want to know the position/size of the text box so that if we grow the text box due to the comment being too big we can scroll the document in a reasonable way).
* What choices does the API provide about the concurrency of the visual update of the new feed story vs the comment. If the feed story is inserted but hasn’t been laid out yet does the API allow the user to let the simple update to the text box happen before the feed story is inserted?
* Often times, a developer needs to do layout in JS and see the results all before the item is painted. IE, when it inserts the feed story at the top of the page, it might need to figure out how high the feed story is so it can scroll the viewport by that much when it inserts the story. This should all happen before the user sees anything


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/270#issuecomment-227927896

Received on Thursday, 23 June 2016 01:46:50 UTC