-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token categories rely on global state #1056
Comments
A good use case of Chevrotain is to execute parse tasks in web workers, possibly with many different parsers handling parse events. |
I am not sure if web workers are relevant to this issue. Optimization for web-workers may be around I have started some guides/feature related to initialization performance here: |
Web workers do not share state with the UI thread or other workers. All state must be serialized and transferred by a message; no shared global state. There is a use case for serializing state between lexing and parsing workers. Admittedly probably a corner case from your POV. |
It seems less likely that separate web workers would be used for the lexer and the parser which would be needed to re-produce this issue. But yeah its the same issue 😄 |
Fixing this (e.g via state on lexer/parser) is likely to cause too many API changes for too little benefit Closing unless this edge case starts causing "real" problems. |
Specifically this:
This can cause issues when there are multiple Chevrotain packages in existence.
E.g when the Lexer and Parser are in separate npm packages.
This could also cause issues in splitting up Chevrotain into multiple smaller packages.
The text was updated successfully, but these errors were encountered: