browserify / browserify/detective

Replace `acorn` parser for `babylon`?

Open
#71 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
414
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Hi,

I came across a problem when `node-detective` cannot operate on ES2015+ source code.

This is not a problem solely related to this package. The same problem applies to `node-syntax-error` package which is used in `browserify` pipeline.

I can see a clear problem in the fact, that some packages used by `browserify` internally depend on `acorn` parser.

This parser dependency is limiting e.g. for using `browserify` in conjuction with `babelify` in such situations when you don't want to transpile all the source code down to ES5.

For instance, let's say you don't want to transpile those syntax features, which are already natively supported by browsers, e.g. object spread operator in current Chrome. And now comes the problem with browserify syntax check and module dependecies parsing via `module-deps` -> `node-detective` dependency, all caused by code containing syntax features not parseable using `acorn` parser. It this case with `...` operator.

Don't you think it would make sense to replace the parser and be more aligned with `babel` ecosystem?

Cheers,

Ondrej

PS: The same issue is being solved in these issues in Webpack project:

https://github.com/webpack/webpack/pull/4308
https://github.com/webpack/webpack/issues/2872

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.