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

Node.js 18.8.0 supported Performance interface #25007

Merged
merged 7 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/Performance.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
},
"nodejs": [
{
"version_added": "16.0.0"
"version_added": "18.8.0"
},
{
"version_added": "8.5.0",
"version_removed": "18.8.0",
"partial_implementation": true,
"notes": "Exported from the `perf_hooks` module"
"notes": "Only available as an internal instance."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could users interact with this interface, if it wasn't exported prior to 18.8.0?

Copy link
Contributor Author

@skyclouds2001 skyclouds2001 Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though the interface can't be accessed directly, but it can be accessed via performance property: require('perf_hooks').performance.__proto__.constructor

performance.__proto__.constructor === Performance will report true in latest node

and another reason is that there is a rule which force parent feature' version must not be greater or equal than child feature's version

see also #25001 (comment) and #24998 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can be accessed via performance property: require('perf_hooks').performance.__proto__.constructor

Should we mention this explicitly? I feel like the previous note was somewhat more informative.

Suggested change
"notes": "Only available as an internal instance."
"notes": "Only available as an internal instance (`require('perf_hooks').performance.__proto__.constructor`)."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyclouds2001 What do you think about this suggestion? 👆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the info of how to access the interface is not required, as in most case user will not access this interface directly but use its properites and methods; and since the info is only for old node.js version, very fewer user will use it.

}
],
"oculus": "mirror",
Expand Down
Loading