You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The antlr4 package used by this project for the cypher grammar has several issues with its packaging.
This issue is to track the current state of those issues to facilitate any future work to address them.
We are currently using version 4.10.1 which provides all source files with nothing but es6 exports, but unfortunately that doesn't support commonjs, and also doesn't provide separate entry points for consumption by node vs browser.
This is why the current @neo4j/antlr-browser package exists, as a hack to remove the node specific code so that we can use it for the web.
The newer latest version is 4.12.0 in which they made an attempt to provide separate entry points for node vs browser, but unfortunately they decided to use webpack to bundle the code for both, resulting in massive bloat to the dependency size (>100KB !) and also prevents any tree-shaking optimizations since they ship everything as 1 file.
A couple of PRs were made to antlr4 to address this (antlr/antlr4#4193 and antlr/antlr4#4199) but unfortunately the antlr4 maintainers didn't accept it.
Someone else did make a PR (antlr/antlr4#4217) that got merged to add yet another webpack bundle output which may help us somewhat, so we should try it once it's released (probably in 4.12.1) and evaluate if it's worth upgrading to despite the fact that it will increase our bundle size by >100KB.
Also relevant, lots of people are hitting similar problems to the ones we've faced, as shown in this issue: antlr/antlr4#4218
The text was updated successfully, but these errors were encountered:
The antlr4 package used by this project for the cypher grammar has several issues with its packaging.
This issue is to track the current state of those issues to facilitate any future work to address them.
We are currently using version
4.10.1
which provides all source files with nothing but es6 exports, but unfortunately that doesn't support commonjs, and also doesn't provide separate entry points for consumption by node vs browser.This is why the current
@neo4j/antlr-browser
package exists, as a hack to remove the node specific code so that we can use it for the web.The newer latest version is
4.12.0
in which they made an attempt to provide separate entry points for node vs browser, but unfortunately they decided to use webpack to bundle the code for both, resulting in massive bloat to the dependency size (>100KB !) and also prevents any tree-shaking optimizations since they ship everything as 1 file.A couple of PRs were made to antlr4 to address this (antlr/antlr4#4193 and antlr/antlr4#4199) but unfortunately the antlr4 maintainers didn't accept it.
Someone else did make a PR (antlr/antlr4#4217) that got merged to add yet another webpack bundle output which may help us somewhat, so we should try it once it's released (probably in 4.12.1) and evaluate if it's worth upgrading to despite the fact that it will increase our bundle size by >100KB.
Also relevant, lots of people are hitting similar problems to the ones we've faced, as shown in this issue: antlr/antlr4#4218
The text was updated successfully, but these errors were encountered: