CommonJS is hurting JavaScript
deno.com
CommonJS is hurting JavaScript
1–10 of 134 posts
Re: CommonJS is hurting JavaScript
#2Re: CommonJS is hurting JavaScript
#3I do much like the `import` syntax personally and its a little cleaner to read, but CommonJS and AMD were the undisputed winners of the module format until ES Modules were born. Not that I have a problem with ES Modules, I don't, however I am interested in what was so insufficient about the preceding formats that we couldn't have standardized on them
EDIT: I know about the deal with CommonJS being synchronous. That isn't per se an issue I don't think, esp. because AMD built on top of CommonJS primitives, and with minimal refactoring CommonJS code could be used in the browser when defined this way if asynchronicity is a must. Generally, what I "imagine" browsers doing with CommonJS is making the `require` calls async in the background (IE non visible to developers) so they can resolve the modules then parse the code. This isn't terribly different from how import statements work today.
I'm wondering why we didn't undertake the work to just improve the existing format, more or less.
EDIT 2: I'm interested from a historical perspective. I think ESM is the right choice and 100% the future.
Re: CommonJS is hurting JavaScript
#4I've definitely worked around my fair share of CommonJS issues but until ESM "just works" I'm slightly pained by how aggressive the tone of this article is.
Re: CommonJS is hurting JavaScript
#5[flagged]
Re: CommonJS is hurting JavaScript
#6[flagged]
Re: CommonJS is hurting JavaScript
#7[flagged]
Re: CommonJS is hurting JavaScript
#8Does anyone have a detailed understanding of why CommonJS (and its async incarnation, AMD) were not adopted by browsers? I do much like the `import` syntax personally and its a little cleaner to read, but CommonJS and AMD were the undisputed winners of the module format until ES Modules were born. Not that I have a problem with ES Modules, I don't, however I am interested in what was so insufficient about the precedi…
Re: CommonJS is hurting JavaScript
#9[flagged]
(Me, I use them as a compilation target, so arguments like the ones in this article are about as interesting to me as arguments about whether the security rings in the next iteration of CPUs are appropriate for modeling proper access constraints).
Re: CommonJS is hurting JavaScript
#10[flagged]
And we’d be moaning about how bad VBScript is, and how we wish another language had won.