News for hackers. Stuff that matters.
Re:Alternatives to JSX by tracker1 on Monday February 25, 2019 @04:49PM (#19249796)
Is this doing a full re-render on each change? Having not seen the state management piece... but could be nice for progressive enhancement modules in a server-rendered app. I've done similar in JS.
Re:Alternatives to JSX by zemptime on Monday February 25, 2019 @05:24PM (#19250058)
Nope! It doesn't visit each node like vdom. VDOM visits every virtual node. lit-html looks at only the expressions. That's where a lot of the speed/performance comes from
Re:Alternatives to JSX by spankalee on Monday February 25, 2019 @06:51PM (#19250659)
zeptime's correct. lit-html places markers in the HTML where the expressions are. Then it renders the HTML once, and updates the expressions directly. That's how it avoids a full re-render and avoids building am in-memory VDOM and doing any diffing.