Repository navigation
fix(js-legacy): work without a global Buffer - #1612
Merged
joncinque merged 2 commits intoNov 21, 2026
Merged
Conversation
Contributor
Author
|
@joncinque related to #453: this removes |
Contributor
Author
|
@joncinque gentle ping. CI hasn't run yet: the workflows are waiting for approval (first-time contributor). |
Contributor
|
This PR is doing two things at once -- let's fix the Buffer import with this PR and drop the rest of the changes. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@joncinque done in 32629fe: the PR now only adds the explicit |
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.
Part of #1611.
Imports
Bufferexplicitly frombufferin thesrcfiles that used the global, so bundlers include it instead of relying on a global polyfill.bufferwas already a dependency. No API changes.Changes
import { Buffer } from 'buffer'in 62srcfiles;import type { Buffer } from 'buffer'in the 3 that only use the type. That is the whole diff: 65 lines, no other changes.The
@solana/buffer-layout-utils/bigint-bufferreplacement from the first version is dropped, as asked.bigint-buffer's browser build still reads the globalBuffer, so a fully polyfill-free browser bundle needs that separately; I can open it as its own PR if you want it.Checks
pnpm format,pnpm lint,pnpm build,pnpm test:unit: 108 passing.