Hacker News new | ask | show | jobs
by Aeolun 1687 days ago
There is one. Which is that you can’t easily do an inline require any more.

The rest of the text can mostly be summarized as https://xkcd.com/927/

3 comments

I’ve been working with node for roughly 5 years and I’ve never liked the hackieness CJS let people incorporate.

People, especially a few years ago, were trying to get clever with the require calls, were fiddling around with require cache and while with ESM we no longer can “easily” do stuff like dynamic reloads, I genuinely feel it’s for the better.

I strongly agree with privatenumber’s point that import() syntax is the true first class citizen here.

Inline require(...), Are we back to bad old days of PHP include '...'; midway through a classes function already?
inline require is most likely a bad design, imo