CommonJS is hurting JavaScript
11–20 of 134 posts
Re: CommonJS is hurting JavaScript
#12Does 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…
I’m going to guess the good faith answer really involves some version of “CommonJS has some shortcomings and we didn’t want to confusingly write mostly-same syntax so we designed something new based on ideas from numerous languages.”
Re: CommonJS is hurting JavaScript
#13[flagged]
In any case, WASM pretty much nullifies any problems with JavaScript going forward.
Re: CommonJS is hurting JavaScript
#14Re: CommonJS is hurting JavaScript
#15Re: CommonJS is hurting JavaScript
#16Does 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…
I don't know if that's the entire story -- probably not -- but I do know that is one major differentiator for things like generating import-graphs and performing tree shaking.
(you can still do like `import('foo' + someVar)` which will only invoke dynamically at runtime, so I'm not sure how that case is dealt with)
Re: CommonJS is hurting JavaScript
#17Re: CommonJS is hurting JavaScript
#18Re: CommonJS is hurting JavaScript
#19[flagged]
However, the big boss still says "use JavaScript, period", and the tech economy dictates that supply side has the upper hand. The users are simple peasants who have no say in the matter. And frankly, none of them really care.
Unless Google execs start pushing an alternative on Chrome, we're stuck with what we have.