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

fix: use res.arrayBuffer() instead of res.buffer() #624

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

tniessen
Copy link
Member

Without this, when using git node wpt:

tniessen@ubuntuserver:~/dev/node$ node ../node-core-utils/bin/git-node.js wpt wasm/webapi
   ⚠  Please create wasm/webapi.json in test/wpt/status
--------------------- Checking updates for wasm/webapi... ----------------------
Last local update for wasm/webapi is fd1b23eeaaf9
✔  wasm/webapi is up to date with upstream (fd1b23eeaaf9)
⠸ Updating license...(node:596531) [node-fetch#buffer] DeprecationWarning: Please use 'response.arrayBuffer()' instead of 'response.buffer()'
(Use `node --trace-deprecation ...` to show where the warning was created)
✔  Updated test/fixtures/wpt/LICENSE.md.

Tracing it:

tniessen@ubuntuserver:~/dev/node$ node --trace-deprecation ../node-core-utils/bin/git-node.js wpt wasm/webapi
   ⚠  Please create wasm/webapi.json in test/wpt/status
--------------------- Checking updates for wasm/webapi... ----------------------
Last local update for wasm/webapi is fd1b23eeaaf9
✔  wasm/webapi is up to date with upstream (fd1b23eeaaf9)
⠙ Updating license...(node:597136) [node-fetch#buffer] DeprecationWarning: Please use 'response.arrayBuffer()' instead of 'response.buffer()'
    at file:///home/tniessen/dev/node-core-utils/lib/request.js:40:53
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async WPTUpdater.pullTextFile (file:///home/tniessen/dev/node-core-utils/lib/wpt/index.js:53:21)
    at async WPTUpdater.updateLicense (file:///home/tniessen/dev/node-core-utils/lib/wpt/index.js:123:5)
✔  Updated test/fixtures/wpt/LICENSE.md.

This PR modifies the relevant function to use the standard res.arrayBuffer() function instead of res.buffer().

This fixes a DeprecationWarning when using git node wpt.
@codecov
Copy link

codecov bot commented Apr 22, 2022

Codecov Report

Merging #624 (c987c3f) into main (649a3b0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #624   +/-   ##
=======================================
  Coverage   84.13%   84.13%           
=======================================
  Files          37       37           
  Lines        4065     4065           
=======================================
  Hits         3420     3420           
  Misses        645      645           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 649a3b0...c987c3f. Read the comment docs.

@tniessen tniessen added the enhancement Things that enhances functionality, provided by node-core-utils label Apr 24, 2022
Copy link
Contributor

@austinkelleher austinkelleher left a comment

Choose a reason for hiding this comment

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

Looks good. I had made the same changes locally and saw that you had already tackled this! 😬

@targos targos merged commit 03b4b70 into nodejs:main Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Things that enhances functionality, provided by node-core-utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants