tl;dr:
You can use JavaScript modules in node today without transpiling, just npm -S esm and run your app with node -r esm foo.js. add "...
For further actions, you may consider blocking this person and/or reporting abuse
Babel is also a very good way to scare beginners from using latest JS. Backwards compatibility is important but there isn't a need to include it in every single tutorial out there. Let people get a taste of new JS then introduce them to Babel, especially now when most up-to-date browsers support it.
I can attest to this. My first dev foray was into JS and while I was impressed by the breadth of the ecosystem and the enthusiasm of its torch-bearers, I quickly came to find myself in a sea of chaos.
Sea of Chaos is my title for JS because something that has been around for so long should not be nearly so complicated... all to support versions of browsers that less than 5% of people use.
TypeScript looks nice... but Transcrypt has always looked better since embracing Python.
And I thought that CoffeeScript was the closest to Python. Good find!
Well put
A previous version of this post said that the
"esm": "auto"
package.json configuration is required for interop, which is incorrect.esm
will let you load cjs in modules out of the box, you just need to install and load. The post has been edited.Thanks for the detailed look into this! Dealing with imports is one of the few remaining annoying bits to deal with.
Not about the content, but tapping the ID links towards the top doesn't seem to work for me. My address bar updates, but nothing else happens.
Thanks for the notes. I used GFM-style anchor links, maybe they don't work the same on dev.to.
issue for tracking
Markdown Headers Should Have IDs for Linking #682
Feature Request or Task
When users create headings in markdown, the headings should have ids added to enable linking throughout the document
User Story / Description
Users with medium-to-long-form content might want to add a table of contents, or a link to a summary or tl;dr.
Definition of Done
When the links in the above snippet work as expected: clicking on one scrolls to the relevant header.
Great, thanks for sharing!
ESM is not ready to be used. you can not mock any ESmodules yet, so if you need this functionality you are out of luck.