deps: replace raw-body with native approach - #90
Conversation
|
|
|
Would love to turn the SDK into a zero-dependency library, although we'd need a few more tests to ensure this would work across most HTTP clients such as express, hono, etc. |
|
is there a default length limit |
|
The But I will admit it is a small package. If you just want to remove a dependency, you could just copy its 300-line |
|
Actually there's another thing: this SDK assumes you're using Express (the entire In other words, |
raw-bodywas used in a way that it only converted the request to a Buffer. This PR replaces usage ofraw-bodywith a less complex, native approach, removing not just the 11 dependencies that came withraw-body, but alsoundici's only subdependency (that was gone after updatingundici). 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-bodywas used both give the same output, making this a free ~40% decrease in total bundle sizeCode I ran to test
https://runkit.com/embed/4hcq12gepy26