13 ms·
In my opinion TC39 process works okay, and is much better than whatever passes for process at w3c. Weird shit still slips through (I think the whole import() a
by dmitriid 4y ago
In my opinion TC39 process works okay, and is much better than whatever passes for process at w3c.
Weird shit still slips through (I think the whole import() and import.meta is an awful hacky addition that could've been made better), but there are actual discussions on how to make things and most things end up somewhat carefully considered.
It's slow as molasses, and not necessarily the best result wins. But in comparison to "here's this chrome-only badly specified pretense of a spec that chrome is already shipping, and all discussion be damned" it works well
- frou_dh 4y agoWhen I had an opportunity to make use of import.meta, I was pleasantly surprised because it enabled me to write a "userspace" hot-module-reload policy with hardly any code (for a browser game when developing using Vite: https://vitejs.dev/guide/api-hmr.html https://vitejs.dev/guide/api-hmr.html). The "keyword followed by a dot?!" aspect that initially felt strange to me isn't that off-the-wall either, because it also exists in the form new.target: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- dmitriid 4y agoYes, new.target was cited as a precedent for this decision. Even though new.target itself was such an ugly hack that the spec was specifically coded for new.target alone. So import is: - a keyword that can only exist at top level at the top of the file - except when it looks like a function, but it's not a function and doesn't behave like one - and it's also apparently and object because it has what looks like a property on it IIRC there was a proposal for an Import (or was it System?) that would take care of things like import.meta etc., but it was deemed to complex. Instead we have import()
- WorldMaker 4y ago> and it's also apparently and object because it has what looks like a property on it In JS functions are objects, so this isn't that weird for JS. (For easy example, JQuery alone used this a lot with `$('selector')` and `$.ajax(…)` and all sorts of other things.)
- dmitriid 4y agoYes, but import() isn't a function ;)