| I disagree. What we gained is a native module system that works the same everywhere (Nodejs, browsers, deno, Bun) vs CommonJS which was really only built for Nodejs (with compatibility layers for others). We have a specification for this system and any changes done to it have to follow the same process as any other change done to the language (for better or worse). We have top-level async support that works across import boundaries. This is less useful on the server, but in the browser? With just a `import thing from "https://example.com/foo.js"` I get a fully intialised library even if does async requests as part of its initialisation. What we lost is just this ```
const someInitializedModule = require("module-name")(someOptions);
``` The `app.use()` example can be replicated with an async `import()`. Maybe it's not as elegant as before. There's going to be a lot pain of transitioning a big ecosystem like Javascript's to ESM but is that really a reason to not evolve the language? |
This is indeed convenient if you want to quickly try a lib. However, what happens in a larger project with dozens of dependencies? Those http requests will get inefficient soon, and you'll be back having to compile everything with Babel or similar.