Uh oh!
There was an error while loading. Please reload this page.
adds experimental napi_date - #497
Conversation
NickNaso
left a comment
There was a problem hiding this comment.
Hi @mathiask88,
good work, thanks for adding this new API. There are some tasks to address. Hope to hear you very soon.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mathiask88
commented
Jun 16, 2019
I added some docs, but the current doc structure and naming is not fully consistent. I tried to stay file scope consistent. |
NickNaso
left a comment
There was a problem hiding this comment.
Some little comment about the documentation.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mhdawson
commented
Jun 17, 2019
On other through, the doc sections should probably indicate that the Date related parts are experimental. |
mathiask88
commented
Jun 17, 2019
@mhdawson True, I thought about it, but didn't add anything because BigInt isn't explicitly indicated as experimental. I'll add it and open another PR for all the mentioned doc stuff. Why was Date as a basic JavaScript object even added that late to N-API? And is it experimental because every new stuff starts as experimental? Just curious. |
mhdawson
commented
Jun 17, 2019
@mathiask88, new functions are added to N-API as experimental. This allows us to properly managed what is in each N-API version and confirm that the new functions don't have fundamental usage issues before we can no longer change them. N-API does not cover all of the JavaScript spec, instead we drove the APIs based on what we saw being used in the most used modules. So it's just most likely that Date was not in the set that we'd looked at. As I wrote my comment I was thinking that we probably were not good about marking things as experimental before but I still think its a good idea going forward. Just to say that I understand why it would not have been evident that it was something to do. |
mhdawson
commented
Jun 17, 2019
@mathiask88, also wanted to say thanks for being so understanding. We still have some work to go in getting the module to be consistent and to iorn out how we handle experimental/new functions. |
NickNaso
left a comment
There was a problem hiding this comment.
It's ok for me just one last little task. Good work @mathiask88 .
Uh oh!
There was an error while loading. Please reload this page.
mathiask88
commented
Jun 28, 2019
@mhdawson Thanks, but there is still an open question #497 (comment) |
@mathiask88 good point, I've commented above that I'm ok with valueOf instead. |
gabrielschulhof
commented
Jun 28, 2019
Shouldn't it be |
NickNaso
commented
Jun 28, 2019
@gabrielschulhof yes you're right. @mathiask88 could you change the method name like repoter by @gabrielschulhof ? |
mathiask88
commented
Jun 28, 2019
@gabrielschulhof@NickNaso Oh, sure. I was in JavaScript lower camel case land :) |
gabrielschulhof
commented
Jun 28, 2019
😂 I know the feeling. |
NickNaso
commented
Jul 17, 2019
Hi everyone, |
gabrielschulhof
commented
Jul 17, 2019
@NickNaso I'll start the CI. |
gabrielschulhof
commented
Jul 17, 2019
gabrielschulhof
commented
Jul 17, 2019
@gabrielschulhof It's ok so it could be a good idea mark this PR with |
gabrielschulhof
commented
Jul 17, 2019
@NickNaso SGTM 👍 |
mathiask88
commented
Aug 16, 2019
Any news on this? How long does it usually take until a backport lands? I would like to see this basic functionality implemented in node/napi. |
mhdawson
commented
Aug 20, 2019
@mathiask88 V8 is in maintenance so updates are not frequent. @gabrielschulhof with the proper version checks this could probably be landed but only be enable version N-API version >5 right? What we'd want to avoid in that case is it 8.x supporting V 5 before 10.x does. |
mhdawson
commented
Sep 4, 2019
@mathiask88 coud you update to add the N-API version checks so that the functionality is only enabled if N-API is set to version 5 or greater? |
mathiask88
commented
Sep 4, 2019
mhdawson
commented
Sep 4, 2019
That is what I had in mind. Leaving that line makes sense as well. CI run on V8.x https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/549/ CI run on V10.x https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/550/ CI run on 12.x - https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/551/ CI run on master (13.x) - https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/552/ |
mhdawson
commented
Sep 4, 2019
I'm confused because it looks like from the CI output the data tests are running on 10 and 12 which I don't expect. |
Locally I have node 12.10.0 + WIN10 and following tests are running npm testnpm test --NAPI_VERSION=4npm test --NAPI_VERSION=5 Does obviously not compile Is |
mhdawson
commented
Sep 5, 2019
The CI uses the process.versions to set the --NAPI_VERSION to the one reported by the version of Node.js being tested. |
mhdawson
commented
Sep 5, 2019
From the CI job, this is how it gets and sets it. echo'console.log(process.versions.napi)'>get_napi_version.js
NAPI_VERSION_REPORTED=`node get_napi_version.js`
npm test --NAPI_VERSION=$NAPI_VERSION_REPORTEDSo it should be being set appropriately for the Node.js version. When I looked it was still 4 for 10.x which is why I was confused that it ran in https://ci.nodejs.org/view/x%20-%20Abi%20stable%20module%20API/job/node-test-node-addon-api-new/nodes=rhel72-s390x/550/console |
mathiask88
commented
Sep 5, 2019
mhdawson
commented
Sep 5, 2019
@mathiask88 good catch , that explains why they are running. We should leave it that way as it's good to run the tests if we can. The CI has |
mhdawson
commented
Sep 5, 2019
CI looks good to me. |
PR-URL: #497 Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
mhdawson
commented
Sep 5, 2019
Landed as 6192e70. Thanks @mathiask88 |
mathiask88
commented
Sep 5, 2019
Thank you! |
PR-URL: nodejs/node-addon-api#497 Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs/node-addon-api#497 Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs/node-addon-api#497 Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs/node-addon-api#497 Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
I tried to add the experimental date stuff. I'll add the docs if the rest is correct.