Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Document fragments are like transactions for the DOM. Alternatively you could just learn which Dom operations force a layout shift and batch those.


> Document fragments are like transactions for the DOM.

About the same way innerHTML is which is completely unhelpful: during reconciliation you need to copy, update, and reset the subtree which contains all the update points, which is almost certainly a lot more than you need.

You also likely need to reconcile document state (e.g. focus) by hand.


You are correct, but if you think about it, you're talking about parsing and tokenizing before the operation can even occur. That's really heavy. I think it could be better than reading .innerHTML




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: