onesignal-node-api
onesignal-node-api copied to clipboard
refactor: remove dependence node-fetch
trafficstars
close https://github.com/OneSignal/onesignal-node-api/issues/83
Description
One Line Summary
Remove node-fetch as fetch is available in the modern environments (browser and Node >= 18)
Details
Motivation
This package depends on node-fetch v2.x, which is old and depends on an old version of whatwg-url and causes warning "The punycode module is deprecated. Please use a userland alternative instead." in Node >= 22. node-fetch is not needed in the modern environments, see https://github.com/lquixada/cross-fetch/issues/177#issuecomment-2358005899
Scope
The package will use the Node built-in fetch
Testing
Manual testing
yarn prepare- I am not sure how to do further testing but I am happy to do so if I could get some guidance.
Checklist
Overview
- [x] I have filled out all REQUIRED sections above
- [x] PR does one thing
- If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
- [x] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
- [x] I have personally tested this on my device, or explained why that is not possible
Final pass
- [x] Code is as readable as possible.
- Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
- [x] I have reviewed this PR myself, ensuring it meets each checklist item
- WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.