| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Should this be titled something like "C/C++ Addons (N-API)", so that it is adjacent to the other "C/C++ Addons" topic?
Sorry, something went wrong.
There was a problem hiding this comment.
makes sense to me, will update once we have more comments.
Sorry, something went wrong.
There was a problem hiding this comment.
documented?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
Didn't make it through the entire PR, but it looks pretty good. Can you make an effort to remove language like "your". 👍
Sorry, something went wrong.
There was a problem hiding this comment.
I would drop newer here. Otherwise, it will probably claim to be new for years to come.
Sorry, something went wrong.
There was a problem hiding this comment.
I don't know if we standardized anywhere, but you have two spaces after some sentences, and one period after others.
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
There was a problem hiding this comment.
We should standardise, probably on 1.
Sorry, something went wrong.
There was a problem hiding this comment.
Add a space after "document"
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
This sentence begins and ends with "instead." I think the second one can be dropped.
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
Same comments in these first two paragraphs apply.
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe start a new sentence at "and the"
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
This could probably be combined with the last sentence of the previous paragraph.
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
Does catch need to be in single quotes?
Sorry, something went wrong.
There was a problem hiding this comment.
does flow better without, removed.
Sorry, something went wrong.
There was a problem hiding this comment.
Is this guaranteed to be an Error object, or can it be whatever was thrown by JS?
Sorry, something went wrong.
There was a problem hiding this comment.
That is a good point, it will be whatever was thrown.
Sorry, something went wrong.
There was a problem hiding this comment.
error -> Error
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
the second -> in the section?
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
There was a problem hiding this comment.
missing backticks above
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
There was a problem hiding this comment.
missing backticks above
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
There was a problem hiding this comment.
buggy space
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed
Sorry, something went wrong.
There was a problem hiding this comment.
wrong backtick
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
data' -> data`
It seems this is a bug in GitHub: this comment is for line 2873, but it is misplaced here due to possibly long diff (+ diff is truncated here). Beware other comments for the distant lines may be misplaced too.
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
|
Till #12554 fixed, maybe it is reasonable to split very big docs into several parts for review time. |
Sorry, something went wrong.
|
Did a pass
|
Sorry, something went wrong.
|
@cjihrig @vsemozhetbyt pushed commits to address all comments so far. |
Sorry, something went wrong.
|
I'm happy to split up into separate PRs or review in this single PR. I'll leave it up to the reviewers to comment on which they think in best. |
Sorry, something went wrong.
There was a problem hiding this comment.
N-API
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
V8
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
There was a problem hiding this comment.
V8
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
|
Added a rendered link in the OP, points to the branch, not a specific commit: https://github.com/mhdawson/io.js/blob/napi-doc/doc/api/n-api.md |
Sorry, something went wrong.
|
Can we get rid of the Signature, Parameters, Return value, Description mini-headers? They take up a lot of space in the long document and are unnecessary. We could move it to be more like a JS api example, for consistency and readability. Consider this comparison: napi_close_handle_scopeSignatureNODE_EXTERN napi_status napi_close_handle_scope(napi_env e,
napi_handle_scope scope);Parameters
Return value
DescriptionThis API closes the scope passed in. Scopes must be closed in the vs napi_close_handle_scopeNODE_EXTERN napi_status napi_close_handle_scope(napi_env e,
napi_handle_scope scope);
Returns napi_ok if the API succeeded. This API closes the scope passed in. Scopes must be closed in the |
Sorry, something went wrong.
|
Also, can we add added-in placeholders to the API methods? |
Sorry, something went wrong.
There was a problem hiding this comment.
created.o is a typo
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
This paragraph seems to be talking about C++ wrappers around N-API, so I would strike faster here – they would be easier but they would inherently be limited to being as fast as N-API at best
Sorry, something went wrong.
There was a problem hiding this comment.
meant faster in terms of development not speed, but remove to avoid confusion
Sorry, something went wrong.
There was a problem hiding this comment.
TODO?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
Notes should be on separate paragraphs and not be all uppercase, followed by a capitalized sentence, i.e. *Note:* You should …
Sorry, something went wrong.
There was a problem hiding this comment.
Done, and fixed other instances as well.
Sorry, something went wrong.
There was a problem hiding this comment.
This is not the actual signature, though?
Sorry, something went wrong.
There was a problem hiding this comment.
No, to keep thing shorter and because we have the full signature/details in the later sections moved it from these earlier references.
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe adding ... for the parameters would help ?
Sorry, something went wrong.
There was a problem hiding this comment.
typo: Tthe and double space after it
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
If you’re talking about the data pointer possibly being moved: That does not happen. :)
Sorry, something went wrong.
There was a problem hiding this comment.
removed TODO.
Sorry, something went wrong.
There was a problem hiding this comment.
typo: returns, also s/C++/C/ again
Sorry, something went wrong.
There was a problem hiding this comment.
fixed, and also went through and looked for other cases as well.
Sorry, something went wrong.
There was a problem hiding this comment.
s/C++/C/ (going to stop commenting that now 😄)
Sorry, something went wrong.
There was a problem hiding this comment.
typo: lowercase pointer
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
These should probably mention what happens when the value does not fit into the corresponding range?
Sorry, something went wrong.
There was a problem hiding this comment.
Couple of issues
Sorry, something went wrong.
There was a problem hiding this comment.
Should include the Experimental stability index flag here.
Sorry, something went wrong.
There was a problem hiding this comment.
ok, we have that in the actual section on n-api but I can add here as well
Sorry, something went wrong.
There was a problem hiding this comment.
Having it in both places is good.
Sorry, something went wrong.
There was a problem hiding this comment.
Please avoid the use of you in the docs... here and throughout.
Sorry, something went wrong.
There was a problem hiding this comment.
Did a pass removing all of the 'you's.
Sorry, something went wrong.
There was a problem hiding this comment.
Here and throughout, can we make sure that the signature has the same names as the listed parameters?
e.g. e should be env to match.
Sorry, something went wrong.
There was a problem hiding this comment.
fixed all of the env instances.
Sorry, something went wrong.
|
@addaleax @jasnell @Fishrock123 pushed commits to address all of the comments so far. Note that the short links render ok when you do make doc and view as html as opposed to what you see when you look at the rendered markdown link you posted. |
Sorry, something went wrong.
|
This does not pass new doc linting: 1987:1 error Unexpected var, use let or const instead no-var 2011:1 error Unexpected var, use let or const instead no-var 2035:1 error Unexpected var, use let or const instead no-var 2036:1 error Unexpected var, use let or const instead no-var 2056:1 error Unexpected var, use let or const instead no-var 2455:1 error Opening curly brace does not appear on the same line as controlling statement brace-style 2456:5 error Expected indentation of 2 spaces but found 4 indent 2546:1 error Unexpected var, use let or const instead no-var 2630:1 error Opening curly brace does not appear on the same line as controlling statement brace-style 2631:5 error Expected indentation of 2 spaces but found 4 indent 2634:1 error Unexpected var, use let or const instead no-var 2634:11 error Strings must use singlequote quotes 2635:1 error Unexpected var, use let or const instead no-var ✖ 13 problems (13 errors, 0 warnings) Lines like this also may need to be addressed for consistency: // var obj = {}Testing Linter CI: https://ci.nodejs.org/job/node-test-linter/8536/ Strange. Why Linting passes on CI? Testing if full CI also passes with linting: https://ci.nodejs.org/job/node-test-pull-request/7659/ (passes, 1 Windows fail seems unrelated). |
Sorry, something went wrong.
There was a problem hiding this comment.
Looking good! Couple more comments.
Also, according to the github diff renderer formatting breaks halfway through... It is possible that is just because the diff it too large but we should check for markdown errors in case.
Sorry, something went wrong.
There was a problem hiding this comment.
Should this be an enum def?
Sorry, something went wrong.
There was a problem hiding this comment.
change to be enum definition
Sorry, something went wrong.
There was a problem hiding this comment.
Can we apply the same hear rules to e.g. here?
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure what you mean here.
Sorry, something went wrong.
There was a problem hiding this comment.
If you meant removing the headers (Definition and Members) I went ahead and did that. Seems better to me.
Sorry, something went wrong.
There was a problem hiding this comment.
- `member`: Regular grammar rules.
Ditto for the parameters section of most APIs. I think this is the style we use elsewhere.
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure what you mean here either.
Sorry, something went wrong.
There was a problem hiding this comment.
I think the point is:
error_code -> `error_code`
Sorry, something went wrong.
There was a problem hiding this comment.
Ok guessing that it meant the parameter sections use use regular grammar including capital at the start and period at the end. Went through and fixed all that up.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, fixed error_code -> error_code as well. It was pretty much ok except for the instance identified.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, that's what I meant. Code blocks and grammar. Sorry.
Sorry, something went wrong.
There was a problem hiding this comment.
Can we use 1 space between [in/out] and name? Here and throughout. They don't render with more than 1 space it seems anyways?
(Unless make doc does, but I doubt it?)
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com>
|
@Fishrock123 github/large file may not be helping us here as I'm not 100% sure what's left with respect to https://github.com/nodejs/node/pull/12549/files#r112795649. I already added the stability index as James requested and I think that's the comment that that one shows me. |
Sorry, something went wrong.
|
@Fishrock123 I don't have any great ideas on the headings right now, so I'd prefer to land this and then I can spend a bit more time and maybe come up with something in a later PR. |
Sorry, something went wrong.
There was a problem hiding this comment.
@mhdawson Oh whoops, didn't see it on the line below. LGTM to me on doc style. (I didn't review the APIs in detail.)
Sorry, something went wrong.
|
@addaleax I think I've addressed your issues so I plan to land soon. If not just let me know. CI run: https://ci.nodejs.org/job/node-test-pull-request/7734/ |
Sorry, something went wrong.
|
@mhdawson Yeah, sorry, didn’t have the time to give it a full review. So please don’t let me hold up anything! :) |
Sorry, something went wrong.
|
@addaleax thanks. Of course if you spot anything later on just let me know and I'll cover it in a later PR. |
Sorry, something went wrong.
|
Ok CI good, landing. |
Sorry, something went wrong.
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
NM |
Sorry, something went wrong.
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: nodejs#12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> Backport-PR-URL: #19447 PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
Add the initial documentation for the N-API
Rendered
This PR is a result of work in the abi-stable-node repo:
https://github.com/nodejs/abi-stable-node/tree/doc,
with this PR being the cumulative work on the documentation
sections in that repo with the following contributors
in alphabetical order:
Checklist
Affected core subsystem(s)
doc, n-api