-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add support info for Web APIs that node supports #3160
Conversation
Hm, this is tricky, but a good point. I will think about APIs and nodejs implementation. You've added new nodejs versions, we need to double check them if these were really the ones when support was introduced. So, if you have links, bugs or any other first hand material, it would ease the review. Thanks! |
Sure, those versions are all from the node documentation:
The version a feature was introduced in is usually in small text below the heading for it. If there were changes in other versions it is a table that can be shown by clicking "History". |
I've used true for when the subfeature was introduced with the main feature or in the case of timers to avoid saying it was added in "0.0.1" and instead just say it has always been there. |
I've added info on TextDecoder and Encoder, since those have actually been supported by node for quite some time too and were recently added to the global context. See |
Found another API that node supports: https://nodejs.org/api/perf_hooks.html |
7ce9ced
to
058beb5
Compare
@Elchi3 have you given any more thought to including Node.js's equivalents to web APIs in BCD? |
So, I think there are a few things that we want to do here:
|
I just noticed I had pushed it and noted it in the commit but not explicitly written a comment on it: I've added node's experimental Worker API as entry in the DOM worker API. It has some similarities, but it is a very different concept and I'm not really convinced it warrants inclusion. I mainly added the commit to put it on the table.
Those versions are directly from the versions noted in the official docs as to when this has become available. It is worthy to note that node didn't really do proper major releases prior to their re-merging with IO, which is v4, iirc. In semver 0.1.11 -> 0.1.12 is a "minor" bump (or as it's now coined an enhancement bump or whatever). They also often add new APIs in semver "minor" versions (so the second number, not the first one). As is noted further up I sometimes just used |
I think that historically, we haven't kept pre-1.0 releases for browsers, and I feel that Node.js should be no different. Anything that's before 1.0, we should bump up to 1.0 (not set as true, since that would mean we don't know when they were added, which we do). |
@vinyldarkscratch I don't think the no-pre-1.0 approach will make sense for Node given its release and governance history. The short version is that Node.js didn't use major version release numbers in its early history; io.js forked Node and started versioning from 1.0; io.js and Node merged back together again, versioning from 4.0. Ignoring pre-0.10 Node releases is probably more like what we do for browsers, but I don't think it's strictly required for us to do that, particularly if we've got reliable data for those releases. I think the no-pre-1.0 approach is more of a pragmatic thing, about finding reliable data. |
I see what you mean. Alright, if that's the case, I'm all for having 0.x releases in the data! |
I think I'm also +1 on adding the 0.x releases
However, this also adds a few more releases and I want to shed some light we haven't added them so far. So, when you have "7.5.0" on node.green, and you hover it, you can actually see it goes back to "7.0.0", which is the first release where this v8 version was used. But this is only true for ECMAScript features (I believe as this is what this PR suggests). See for example #3970 where this is the case and I asked to use a prior version. As this PR deals with non-ECMAScript features for node, new version numbers come in the game:
If we would add "7.5.0" (and others, see above) to the data, I think it should still be invalid for ECMAScript features so that always use the first version when a new v8 engine version was used. Am I making sense? |
For that, the I could add additional handling to |
Ah whoops, sorry about the bad merge, @freaktechnik! |
So, in order to move forward with adding nodejs version to non-ECMAScript features, I would like to move the addition of more nodejs versions in |
I’ve now implemented the test in #4264. |
Thank you, I'll try to rebase/merge once that's merged. |
Thanks for rebasing! Looking at this PR again, it seems that it's gotten fairly larger. To help speed up the review process, we may want to consider cherry-picking changes into separate PRs to keep the scope of each as small as possible. At that point, we can then gradually add the data in, one piece at a time. Does that sound reasonable to you?
|
Hey @freaktechnik, do you plan to return to this PR? |
Sure, however so far I've only seen hypotheticals for possible changes and no word from a potential reviewer, so I've seen no reason to take action. |
Well, I was sort of hoping that we could start cherry-picking groups of changes so we can get them merged a little quicker? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience and I'm sorry it took so long to get to this. As you know, this won't actually be rendered on MDN yet, so it wasn't really a priority to review, but let's now attempt to get this data merged and worry about additional tests and MDN rendering later.
This is very well researched and matches what is in the nodejs docs. Great work!
I think there a bit of misinterpretation of how we use alternative_name
, so I have a few things to change but overall I'm happy with this. Thank you!
It would be great if you could also rebase against latest master, so that we make sure all the data still passes the latest linting tests.
Thank you again! 👍
Not sure if this warrants actual compatibility mention, but I thought I'd throw it in the mix
…er timing functions
Alright, rebased and the alternative_names usage reduced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick updates @freaktechnik and sorry again this took enormously long! Happy to merge this now and really appreciating your patience and commitment to help this project. 💯
Node supports a couple of web APIs out of the box:
URL
is implemented to follow the whatwg specURLQueryParams
is implemented to follow the whatwg specconsole
follows the console spec too, afaiksetInterval
/setTimeout
are very close to their web equivalentI am aware that currently this information is not shown on MDN at all, since node is not enabled to be rendered in api/
Table of all the APIs and corresponding node docs:
URL
URLSearchParams
console
setInterval
setTimeout
clearInterval
clearTimeout
setImmediate
clearImmediate
TextDecoder
TextEncoder
Worker
,Message*