2 ms·
Yeah, I'll let Javascript engines parse and convert my Javascript to bytecode for me. It's definitely not the same as manually parsing strings at runtime. And e
by dmitriid 8y ago
Yeah, I'll let Javascript engines parse and convert my Javascript to bytecode for me. It's definitely not the same as manually parsing strings at runtime. And equating the two is disingenuous at best
- spankalee 8y agoType-checking happens at compile time, and even the JS is parsed by a user-land library and not the JS engine. At runtime these templates are parsed by the browser's built-in HTML parser.
- dmitriid 8y ago> Type-checking happens at compile time, and even the JS is parsed by a user-land library and not the JS engine. True. Still, it's functions and regular JS, not strings manually processed at runtime > At runtime these templates are parsed by the browser's built-in HTML parser. It's not the first time I've seen this ... bullshit (no other word for it). Where does it come from? The only time it's parsed by browser's built-in HTML parser is when you manually call something like `element.innerHtml = "you string that you manually assembled in your function at runtime"`. The browser has no idea what is contained in your tagged string. Which is painfully obvious when you actually look at the implementations of HTM: https://github.com/developit/htm/blob/master/src/index.mjs#L36 https://github.com/developit/htm/blob/master/src/index.mjs#L... or lit-html: https://github.com/Polymer/lit-html/blob/master/src/lib/template-result.ts#L47 https://github.com/Polymer/lit-html/blob/master/src/lib/temp...