node-sdk icon indicating copy to clipboard operation
node-sdk copied to clipboard

deps: replace `raw-body` with native approach

Open SuperchupuDev opened this issue 1 year ago • 0 comments

raw-body was used in a way that it only converted the request to a Buffer. This PR replaces usage of raw-body with a less complex, native approach, removing not just the 11 dependencies that came with raw-body, but also undici's only subdependency (that was gone after updating undici). As such this PR lowers the amount of transitive dependencies in this package from 13 down to one (1).

I've tested that this approach and the way raw-body was used both give the same output, making this a free ~40% decrease in total bundle size

Code I ran to test

https://runkit.com/embed/4hcq12gepy26

image

SuperchupuDev avatar Jun 23 '24 23:06 SuperchupuDev