Page MenuHomePhabricator

[chronik-client] Do not use buffer type to support browser builds without webpack Buffer fallbacks
ClosedPublic

Authored by bytesofman on Mar 11 2024, 19:26.

Details

Summary

Buffer type only exists in NodeJS and not the browser. There are available polyfills. However, to use these, we would need a tool like webpack.

The Buffer type is only used to distinguish between node and browser processing env. A common way to do this is to check on window.

Use this way instead of instanceof Buffer

Test Plan

CI, see if this install works on websocket for D15665

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

confirmed this resolves the buffer type issue from D15665

image.png (796×576 px, 98 KB)

tobias_ruck added a subscriber: tobias_ruck.

reworded the changelog (the purpose really is just fixing it in the browser), otherwise gtg

modules/chronik-client/README.md
106 ↗(On Diff #46100)
This revision is now accepted and ready to land.Mar 11 2024, 23:46