Hacker News new | ask | show | jobs
by spankalee 1090 days ago
The main JS implementations do not run ahead of the spec. They implement at Stage 3.
2 comments

Import attributes are at Stage 3: https://tc39.es/proposal-import-attributes/
I'm well aware, but this is not just import attributes. It's using import attributes syntax to trigger a transform of the importing module, in addition to changing the behavior of the exporting module.
More concise than my previous reply: that’s just moving the same outcome around in time. If a fully runtime-only import attribute would result in inlining a static-at-build-time value where its export is called, this is just inlining it sooner. That seems fine to me unless it doesn’t fit the import attribute use case. In which case… don’t voluntarily use it?
A. Import attributes are stage 3.

B. If you blur the line between "runtime" and "compiler", you'll realize that a lot of JS ecosystem (e.g. Babel) run ahead of that.