-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
lib: implement webidl dictionary converter and use it in structuredClone #55489
base: main
Are you sure you want to change the base?
Conversation
This is not the first time |
916878f
to
d2a6a48
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55489 +/- ##
==========================================
+ Coverage 88.41% 88.43% +0.01%
==========================================
Files 653 654 +1
Lines 187476 187735 +259
Branches 36083 36125 +42
==========================================
+ Hits 165763 166019 +256
- Misses 14946 14954 +8
+ Partials 6767 6762 -5
|
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.
LGTM, some small nits
@anonrig I am not sure why this needs a benchmark CI. |
Because it impacts structedClone. It's good to know the impacts of such highly used function. |
I'm not sure I agree because benchmark CIs are typically used for performance-related PRs. I can't see a reason to have one here other than to block the change. This fixes a number of small bugs (I outlined these issues in the PR that started to use the webidl sequence converter), this is not a PR related to performance. Likewise, the more steps we take away from webidl, the less valuable it becomes. It's fine to compare a few strings now, and change it to an enum-like value in the future IMO. |
458dc47
to
ca9beba
Compare
ca9beba
to
83c7f6b
Compare
83c7f6b
to
c70e5b9
Compare
benchmark: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1649/ result:
|
cc @nodejs/performance |
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.
lgtm
I'm not blocking but is 13% performance degregation worth this change? cc @mcollina |
node isn't properly implementing structuredClone without this change. The baseline should be this PR. |
c70e5b9
to
cfd248f
Compare
This commit provides a factory to generate `dictionaryConverter` compliant with the spec. The implemented factory function is used for the `structuredClone` algorithm with updated test cases.
cfd248f
to
e72a0c7
Compare
Commit Queue failed- Loading data for nodejs/node/pull/55489 ✔ Done loading data for nodejs/node/pull/55489 ----------------------------------- PR info ------------------------------------ Title lib: implement webidl dictionary converter and use it in structuredClone (#55489) Author Jason Zhang <[email protected]> (@jazelly) Branch jazelly:dictionary-converter -> nodejs:main Labels author ready, worker, web-standards Commits 2 - lib: prefer number than string in webidl `type` function - lib: implement webidl dictionary converter and use it in structuredClone Committers 1 - Jason Zhang <[email protected]> PR-URL: https://github.com/nodejs/node/pull/55489 Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/55489 Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last approving review: ⚠ - lib: implement webidl dictionary converter and use it in structuredClone ℹ This PR was created on Tue, 22 Oct 2024 11:19:21 GMT ✔ Approvals: 3 ✔ - Matthew Aitken (@KhafraDev): https://github.com/nodejs/node/pull/55489#pullrequestreview-2385375542 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/55489#pullrequestreview-2392490011 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/55489#pullrequestreview-2395332839 ✔ Last GitHub CI successful ℹ Last Benchmark CI on 2024-10-25T10:57:25Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1649/ ℹ Last Full PR CI on 2024-10-27T02:31:21Z: https://ci.nodejs.org/job/node-test-pull-request/63306/ - Querying data for job/node-test-pull-request/63306/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/11643709674 |
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.
Not blocking either but like @anonrig I'm -0 on this
approved by mistake, meant to comment
The first commit optimizes
type(V)
inwebidl.js
to return enuminstead of string.
The second commit provides a factory to generate
dictionaryConverter
compliant with the spec. The implemented factory function is used for
the
structuredClone
algorithm, along with updated test cases.