This week-end was a MDN doc sprint. I haven’t had the time to do a lot, but some of the interactions have been really useful and i’d like to share a couple of things i’ve learned.
On the Doc Sprint Etherpad, I have noticed that Jonathan Wilsson (McGurk) added pages for setImmediate and clearImmediate. These not-yet-specified functions aim at being an efficient replacement to setTimeout(0) (which is clamped to 4ms for historical reasons) and its hack-ish postMessage based replacement.
In a way, this is a good news, but it’s a bit overlapping with what TC39 has in mind for concurrency. In an es-discuss e-mail, Mark Miller sounded enthusiastic with the idea of making Q.delay part of the default upcoming concurrency API. This would make 2 features for the same purpose. As stated in the es-discuss quoted thread i started, it would make more sense to bring
setTimeout to ECMAScript rather than letting it be part of a web standard since timing issue aren’t really specific to the web. As a matter of fact Node.js uses the same API.
textContent VS innerText
I have improved the style for Node.textContent and have read with great interest the notes which state some difference with Microsoft’s
innerText. One being that
innerText cannot retrieve the text from <script> and <style> elements. Well… That is the explanation of why Selectivizr explains that “Styles defined in <style> tags won’t be parsed.” (in old IE, of course).
innerHTML counter-intuitive performance