Skip to content

Conversation

@muqiuhan
Copy link
Contributor

  • readBig(U)Int64(BE/LE)
  • subarray(ToEnd)

NOTE: Buffer.slice is now deprecated (since node 16.x LTS)

Refs.

- readBig(U)Int64(BE/LE)
- subarray(ToEnd)

NOTE: Buffer.slice is now deprecated (since node 16.x LTS)

Refs.
=======

- https://nodejs.org/docs/latest-v16.x/api/buffer.html#bufslicestart-end
external readUintLE: (t, ~offset: int, ~length: int) => float = "readUintLE"

@send
external readBigInt64BE: (t, ~offset: int) => bigint = "readBigInt64BE"
Copy link
Contributor Author

@muqiuhan muqiuhan Jan 19, 2025

Choose a reason for hiding this comment

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

CI says there are compilation errors here:

   We've found a bug for you!
  /home/runner/work/rescript-nodejs/rescript-nodejs/src/Buffer.res:276:47-52

  274275 │ @send
  276external readBigInt64BE: (t, ~offset: int) => bigint = "readBigInt64BE
      │ "
  277278 │ @send

  This type constructor, `bigint`, can't be found.
  If you wanted to write a recursive type, don't forget the `rec` in `type rec`

But rescript 11.1 already treats bigint as primitive type: Primitive Types | Big Integer.


Maybe it's because the rescript version in the devDependencies of the current project is 11.0.1:

  "devDependencies": {
    "rescript": "^11.0.1",
  },

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, this repo is quite out of date, feel free to upgrade.

@TheSpyder
Copy link
Owner

NOTE: Buffer.slice is now deprecated (since node 16.x LTS)

Feel free to add an @deprecated warning while you're here 🙂

@muqiuhan muqiuhan force-pushed the feat.buffer.1 branch 2 times, most recently from 5a82174 to 447f398 Compare March 2, 2025 08:14
- Upgrade rescript to v11.1.0
- Add rescript.json configuration file
- Mark Buffer.slice methods as deprecated in favor of subarray methods
- Update Cluster module classification logic
@muqiuhan
Copy link
Contributor Author

muqiuhan commented Mar 2, 2025

Hello, I have fixed the CI bug (upgraded rescript to ^11.1.0) and added some @deprecated annotations~

@TheSpyder
Copy link
Owner

Thank you! I'll look at it soon

@TheSpyder TheSpyder merged commit 47ff6ae into TheSpyder:main Mar 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants