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](https://github.com/Top-gg-Community/node-sdk/assets/53496941/2f10f863-5433-4ff3-acaf-ad3c660650d5)
raw-body
was used in a way that it only converted the request to a Buffer. This PR replaces usage ofraw-body
with 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-body
was 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 ![image](https://github.com/Top-gg-Community/node-sdk/assets/53496941/2f10f863-5433-4ff3-acaf-ad3c660650d5)