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

Replace deprecated Node Buffer constructor #3126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kudlav
Copy link

@kudlav kudlav commented Jan 8, 2025

Node.js new Buffer(size) is deprecated since: v6.0.0.

Replace it with Buffer.from(string) and Buffer.alloc(size).

The Buffer.alloc(size) returns zero-filled memory which was default for new Buffer(size) starting from v8.0.0.

https://nodejs.org/docs/latest-v22.x/api/buffer.html#new-bufferbuffer

@louwers louwers requested a review from acalcutt January 8, 2025 18:57
@louwers louwers added the node label Jan 8, 2025
Copy link

github-actions bot commented Jan 8, 2025

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3126-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +31% +36.1Mi  +438% +26.2Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3126-compared-to-legacy.txt

Copy link

github-actions bot commented Jan 8, 2025

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            -0.0052         -0.0052             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-3126-compared-to-main.txt

Copy link

github-actions bot commented Jan 8, 2025

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3126-compared-to-main.txt

Copy link
Collaborator

@acalcutt acalcutt left a comment

Choose a reason for hiding this comment

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

This change looks good to me, based on the documentation and tests passing. I think I have seen that warning before, thouh I don't see it in the ci.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants