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
While I was investingating problems with bundle compilation, I've noticed we have Xpath lexer/parser bundled with the library, including its huge serialized ATN.
Unfortunately this code is not removed during dead code elimination phase in webpack. Can we move it to a separate package/project, so only those who actually need it would install and import it?
Well, it's only the lexer and in total (as a file) 27KB in size, which is not really big IMO (I'm building bundles with parser + editor stuff in it that become > 3MB). What I talked about in the linked issue was building the XPath stuff.
Thinking about dead-code-elimination, would it help to make the _serializedATN member private? There's no other code accessing it (and it's by nature local to the lexer class). Can you please test if that helps?
it's only the lexer and in total (as a file) 27KB in size, which is not really big IMO (I'm building bundles with parser + editor stuff in it that become > 3MB)
I agree it does not add that much, it just felt not right. If you don't see a simple way to improve it, let's close the issue.
would it help to make the _serializedATN member private?
Unfortunately, tree shaking is still a black box for me. My guess is that since the library is bundled into a single file, any internal optimizations would not help.
While I was investingating problems with bundle compilation, I've noticed we have Xpath lexer/parser bundled with the library, including its huge serialized ATN.
Unfortunately this code is not removed during dead code elimination phase in webpack. Can we move it to a separate package/project, so only those who actually need it would install and import it?
I'm not sure if it's right place to ask, since the library is a port of https://github.com/antlr/antlr4. There was even a similar proposal there.
The text was updated successfully, but these errors were encountered: