node icon indicating copy to clipboard operation
node copied to clipboard

perf_hooks: fix webperf idlharness

Open legendecas opened this issue 1 year ago • 12 comments

lib: brand check event handler property receivers

Event handler properties defined by defineEventHandler should check if the receiver is a valid EventTarget.

perf_hooks: fix webperf idlharness

  1. Enforce receiver checks on IDL interfaces.
  2. Avoid prototype manipulation on constructing IDL interfaces with ReflectConstruct.
  3. defineReplaceableAttribute should create IDL getter/setter.
  4. Corrected PerformanceResourceTiming to inherit the public interface PerformanceEntry instead of the internal interface InternalPerformanceResourceTiming.
  5. detail is not a specified attribute on PerfomanceEntry. Node.js specific extensions are moved to a subclass of PerformanceEntry as PerformanceNodeEntry.

perf_hooks: expose webperf global scope interfaces

Exposes PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceObserver, PerformanceObserverEntryList, and PerformanceResourceTiming to the global scope.

legendecas avatar Sep 01 '22 18:09 legendecas

Review requested:

  • [ ] @nodejs/startup

nodejs-github-bot avatar Sep 01 '22 18:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/46402/

nodejs-github-bot avatar Sep 03 '22 16:09 nodejs-github-bot

As this is updating global interfaces for spec compliance, I'm marking it as don't land on LTS versions.

legendecas avatar Sep 06 '22 05:09 legendecas

As a spec-compliance update, should this be considered a breaking change thus a semver-major?

/cc @nodejs/diagnostics @nodejs/tsc any inputs will be helpful <3

legendecas avatar Sep 06 '22 17:09 legendecas

Given that it is going to break usages on performance.now() without receivers, I'm marking this as a breaking change, hence a semver-major patch.

@nodejs/tsc would you mind weighing in and taking a look at this PR? thank you <3

legendecas avatar Sep 13 '22 17:09 legendecas

Given that it is going to break usages on performance.now() without receivers, I'm marking this as a breaking change, hence a semver-major patch.

Can you articulate this with an example?

mcollina avatar Sep 14 '22 07:09 mcollina

Given that it is going to break usages on performance.now() without receivers, I'm marking this as a breaking change, hence a semver-major patch.

Can you articulate this with an example?

Example from Chrome: image

This doesn't throw in Node.js 18.

targos avatar Sep 14 '22 07:09 targos

@legendecas if this is semver-major, do we want to also include the other changes from https://github.com/nodejs/node/pull/44460?

aduh95 avatar Sep 14 '22 07:09 aduh95

if this is semver-major, do we want to also include the other changes from https://github.com/nodejs/node/pull/44460?

yeah... make sense to me. I can do it in this PR too.

legendecas avatar Sep 14 '22 12:09 legendecas

New globals need to be documented in globals.md, and an entry for each should be added in lib/eslintrc.yml as well.

aduh95 avatar Sep 14 '22 19:09 aduh95

thanks for the suggestions! updated :)

legendecas avatar Sep 15 '22 16:09 legendecas

CI: https://ci.nodejs.org/job/node-test-pull-request/46671/

nodejs-github-bot avatar Sep 20 '22 10:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/46821/

nodejs-github-bot avatar Sep 26 '22 15:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/47007/

nodejs-github-bot avatar Oct 02 '22 22:10 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/47006/

nodejs-github-bot avatar Oct 02 '22 22:10 nodejs-github-bot

Landed in ecd5de08b78a...587367d10791. Thank you for the review!

legendecas avatar Oct 03 '22 16:10 legendecas