Skip to content

Get the library working with node 12 - #45

Merged
maxbrunsfeld merged 2 commits into
masterfrom
node-12-compat
Oct 22, 2019
Merged

maxbrunsfeld merged 2 commits into
masterfrom
node-12-compat

Conversation

@maxbrunsfeld

@maxbrunsfeld maxbrunsfeld commented May 3, 2019 •

Copy link
Copy Markdown
Contributor

Fixes #46

There are a bunch of V8 API changes from Node 10 to Node 12.

@fernandocanizo

Copy link
Copy Markdown

Is this fix dead? Who should we poke that has write access?

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

If anyone is interested in working on this, that would be great! It may be a while before I have time to work on this further.

@bdurrani

bdurrani commented Jun 4, 2019

Copy link
Copy Markdown

@maxbrunsfeld I downloaded the repo and ran npm install, but it looks like one of the dependencies doesn't install yet. It needs one of your other PRs merged.

Do I need superstring in order to do this work?
I can take a stab at updating this, but I'm a little new to this. Are there any contributing guidelines?

Thanks for all your work!

@tommai78101

Copy link
Copy Markdown

@bdurrani

That PR you linked above is now merged back in July. You should be able to continue.

@drom

drom commented Sep 15, 2019

Copy link
Copy Markdown

@maxbrunsfeld could you estimate the amount and the nature of work needed to be done here?

@bdurrani

Copy link
Copy Markdown

@bdurrani

That PR you linked above is now merged back in July. You should be able to continue.

The PR was merged, but looks like the changes have not been published to npm yet.

@tommai78101

Copy link
Copy Markdown

@bdurrani
I didn't know that. 🤔

@bdurrani

Copy link
Copy Markdown

I was able to temporarily work about that by reference the git repo in the package file. But I'm now I'm just trying to understant the API and how the node bindings work. Let's see how it goes.

@bdurrani

bdurrani commented Sep 30, 2019 •

Copy link
Copy Markdown

I'm not sure what I'm missing here. I've cleaned up any compile errors.
But for some reason, I cant seem to create a new instance of the Tree.

Here is what I have:
https://github.com/bdurrani/node-tree-sitter/blob/08c1c3e4a36ed2a44b615292bf7c9894f8b2838c/src/tree.cc#L64

Tree::NewInstance() gets a tree pointer.
The call to Nan::NewInstance() works. I can confirm that Tree::New() is called and the
arguments to it were passed correctly by comparing the pointer values.

But for some reason, the return value from Nan::NewInstance() returns an empty object.

As a test, I looked at the node-addon-examples and modified the sample to follow
the pattern in tree-sitter
https://github.com/bdurrani/node-addon-examples/blob/f423f0390bd547230f56207bab3db279ea707289/6_object_wrap/nan/one.cc#L16

One::NewInstance() gets a pointer to some c++ class
It's constructor is called, and this time, the return value from Nan::NewInstance()
returns an object that is not empty. The code is almost identical.

I haven't played much with node bindings before. Any ideas how I would debug by
NewInstance() is returning an empty object. I don't see any errors or anything happening.

Any one have any suggestions? @maxbrunsfeld

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

Hey, thanks for taking a look at this @bdurrani; I appreciate you helping out. I think that your comment summarizes the problem that I was stuck on when I initially opened this PR, but unlike me, you took the time to write it out, which is very helpful.

Unfortunately, I haven't had much time to look into this lately, but I plan on spending a little time on it this week.

@maxbrunsfeld
maxbrunsfeld force-pushed the node-12-compat branch 3 times, most recently from 55a1763 to b84f2f6 Compare October 22, 2019 17:33
@bdurrani

Copy link
Copy Markdown

Hey, thanks for taking a look at this @bdurrani; I appreciate you helping out. I think that your comment summarizes the problem that I was stuck on when I initially opened this PR, but unlike me, you took the time to write it out, which is very helpful.

Unfortunately, I haven't had much time to look into this lately, but I plan on spending a little time on it this week.

no problem @maxbrunsfeld
I forgot to add more information. I added some extra code to look at existing exceptions and there was an error about an object being `null or undefined. But that's where I stopped since it wasn't clear what exactly was null or undefined

If there is anything I can do to help, let me know. I don't mind looking into it further.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

Ok, I worked on this some more this morning and at least gotten it working on osx.

@maxbrunsfeld
maxbrunsfeld merged commit 11636a1 into master Oct 22, 2019
@maxbrunsfeld
maxbrunsfeld deleted the node-12-compat branch October 22, 2019 19:59
@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

Ok, this is published in 0.15.9, but there is a problem with the prebuilt binaries: Travis seems to be having some trouble downloading the electron headers. 😕

@maxbrunsfeld

Copy link
Copy Markdown
Contributor Author

Ok, prebuilt assets seem to be uploading ok for v0.15.10.

jashmenn added a commit to newlinedotco/cq that referenced this pull request Nov 19, 2019
tmiland pushed a commit to atomeditor-io/node-tree-sitter that referenced this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to build with node 12.1.0

5 participants