ef4 / ember-browserify

ember-cli addon for easily loading CommonJS packages from npm via browserify.
MIT License
172 stars 28 forks source link

Use acorn instead of esprima #33

Closed asakusuma closed 9 years ago

asakusuma commented 9 years ago

Acorn is faster. Acorn also does not make git requests during build, which Esprima does. This is unpaletable for many companies that don't want out-of-datacenter network calls at build time.

http://esprima.org/test/compare.html http://marijnhaverbeke.nl/blog/acorn.html

ef4 commented 9 years ago

Looks good to me, thanks Asa.

devinus commented 9 years ago

Perhaps you should use babel-core to parse (e.g. https://github.com/babel/babel-eslint/blob/master/index.js#L5) and pass in the app's babel configuration so that all valid ember-cli code is also valid ember-browserify code (e.g. computed decorators and everything else babel supports).

I believe this is why https://github.com/ef4/ember-browserify/issues/35 is happening to me.

devinus commented 9 years ago

Another example: https://github.com/babel/babel/blob/7407b37bd9cbde15c667b2dcf3a7b198ecfd14c8/test/core/generation.js#L29

asakusuma commented 9 years ago

Thanks @devinus I'll take a shot at a PR tomorrow

asakusuma commented 9 years ago

Actually @devinus your stack trace references esprima, not acorn, so I don't think this is related

devinus commented 9 years ago

@asakusuma Indeed, it was using Esprima, however the issue remains that it wont be able to parse anything that uses a Babel transform.