Remove usage of `node-fetch`
piranna opened this issue · comments
Node.js has an implementation of fetch()
API since 17.5.0. Remove usage of node-fetch
for it, to don't add extra dependencies, it's being used only on npm-scripts.mjs
file so it's not needed at runtime at all.
- mediasoup is guaranteed to run in Node >= 16: https://github.com/versatica/mediasoup/blob/v3/package.json#L48, so we cannot rely on native
fetch
. node-fetch
is used in runtime to download the prebuilt mediasoup-worker binary: https://github.com/versatica/mediasoup/blob/v3/npm-scripts.mjs#L83
So we must live with node-fetch
until we increase require Node version to 18, which will not happen soon.
2.
node-fetch
is used in runtime to download the prebuilt mediasoup-worker binary:v3
/npm-scripts.mjs#L83
For me that's install time, not runtime :-) but the Node.js >= 16 is enough reason for me, just only let's keep this topic in mind, Node.js 16 will get EOL in a bit more than three months...
Install time is not runtime, right, but node-fetch must be available when installing mediasoup via NPM in production mode so it must be in "dependencies" rather than in "devDependencies".
Install time is not runtime, right, but node-fetch must be available when installing mediasoup via NPM in production mode so it must be in "dependencies" rather than in "devDependencies".
Agree.