Skip to content
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

Support for Node 10.x.y #7

Closed
char0n opened this issue Sep 23, 2020 · 2 comments
Closed

Support for Node 10.x.y #7

char0n opened this issue Sep 23, 2020 · 2 comments
Labels
question Further information is requested

Comments

@char0n
Copy link

char0n commented Sep 23, 2020

Hi @ikatyang,

I've just noticed that the grammar.js is using Object.fromEntries function which is not part of node 10. As node@10 is still in maintenance LTS, would be great if this YAML grammar supported it.

Would you be open to replace Object.fromEntries and possibly other non node@10 functions to other implementations?

Thanks

@ikatyang
Copy link
Owner

Hi, the grammar.js is considered a dev-only file, which should only be used in Node 12+, though I didn't mention it anywhere. The tree-sitter-yaml npm package only guarantees that its node binding will work, which is the case for Node 10. If you'd like to use grammar.js in Node 10, I'd recommend you to use it via @babel/register and/or @babel/polyfill, for example:

NODE_OPTIONS='--require "path/to/babel-polyfill" --require "path/to/babel-register"' tree-sitter generate

or use Docker/nvm to achieve this goal.

@char0n
Copy link
Author

char0n commented Sep 24, 2020

Sure, thanks; fortunately I'm using babel and your proposed solution works. Might be problem for people without babel though.

Thanks!

@char0n char0n closed this as completed Sep 24, 2020
@ikatyang ikatyang added question Further information is requested and removed awaiting response labels Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants