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
feat!: use js-tokens instead of acorn #6
Conversation
@antfu what do you think? |
Looks solid! It seems that regex mode is never used now. Could we find a counter-example, or maybe we could just remove the regex mode and always use js-tokens? |
For For |
Do you have this benchmark somewhere? I can try optimizing the new implementation a bit more (using |
I see now you already pushed it :D
As I said in the issue description, it never throws an error. I am fine with removing the regexp implementation. But does anyone use |
@antfu acorn and regexp are removed now, ready for a review. I removed factory with restructuring, so it's a little bit faster now |
Description
This PR replaces
acorn
withjs-tokens
. All tests are passing (I did update Vitest that changed snapshots, but I did it before running tests, so this is legitimate). I am opening this PR before I am fully ready (I didn't try updatingcreateIsLiteralPositionAcorn
yet) to also discuss some potential API changes:js-tokens
never throws an error, so do we need still the regexp version?strip-iteral/acorn
with the previous implementation, and specify acorn in peerDependencies?Linked Issues
js-tokens
to reduce the size of this dependency #5Additional context