feat(javascript): align buffer read/write API with Java naming#3346
Merged
chaokunyang merged 2 commits intoapache:mainfrom Feb 18, 2026
Merged
feat(javascript): align buffer read/write API with Java naming#3346chaokunyang merged 2 commits intoapache:mainfrom
chaokunyang merged 2 commits intoapache:mainfrom
Conversation
chaokunyang
reviewed
Feb 18, 2026
| return `${this.holder}.readSetCursor(${v})`; | ||
| } | ||
|
|
||
| varInt32() { |
Collaborator
There was a problem hiding this comment.
Could you also rename such methods?
Contributor
Author
There was a problem hiding this comment.
I have done this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the JavaScript buffer API with Java and other xlang implementations by using explicit
read*/write*method names only. No compatibility aliases; one-shot breaking change.Changes
lib/writer/index.ts): Removed short-name aliases (int8,uint8,int16, etc.). Public write API is now only the existingwrite*methods (e.g.writeInt8,writeUint8,writeInt32,writeFloat64,writeGetCursor, etc.).lib/reader/index.ts): Removed short-name aliases. Public read API is now only the existingread*methods (e.g.readInt8,readUint8,readInt32,readGetCursor,readSetCursor,readSkip, etc.).lib/gen/builder.ts):BinaryWriterBuildernow emitswrite*calls (e.g.bw.writeInt8(...));BinaryReaderBuildernow emitsread*calls (e.g.br.readInt8(),br.readGetCursor()).test/io.test.ts): Updated dynamic writer calls fromwriter['uint${x}']/writer['int${x}']towriter['writeUint${x}']/writer['writeInt${x}'].Requirements met
write*prefix (e.g.writeInt8,writeUint32).read*prefix (e.g.readInt8,readUint32).Testing
cd javascript && node ./node_modules/.bin/jest --ci— all 18 suites pass (112 tests, 1 skipped).Fixes #3345