slash icon indicating copy to clipboard operation
slash copied to clipboard

[Feature]: `@toss/ky` why node-fetch is being used separately when Node.js 18+ has built-in support for fetch

Open dayongkr opened this issue 1 year ago • 0 comments

Package Scope

  • [x] Add to an existing package
  • [ ] New package

Package name: @toss/ky

Overview

Starting from Node.js 18, built-in fetch is supported, making it possible to use without polyfills or the node-fetch library.

Describe the solution you'd like

It seems that we no longer need to use the node-fetch library and can instead use the Node.js built-in fetch, which offers the following pros and cons:

Even if we continue to use node-fetch due to the experimental stage or other reasons, I believe the phrase "For server-side rendering, we should use the separate ky-universal library." in the documentation should be updated because with Node.js 18 or higher, it is no longer necessary to use ky-universal.

dayongkr avatar Jul 05 '24 11:07 dayongkr