gitlab icon indicating copy to clipboard operation
gitlab copied to clipboard

refactor(api): use ky and undici instead of got #756

Open JonasSchubert opened this issue 9 months ago • 4 comments

Initial draft to move from got to ky (using undici).

JonasSchubert avatar Apr 11 '25 08:04 JonasSchubert

  • Tests are failing caused by undicis minimum node version being set to 20.18.1 in this PR.
  • either we also introduce a breaking change by updating our engine to same 20.x.x or higher or we abandon that for now
  • also @ievgennaida made a good point, but instead of mixing undici and ky we could simply use only undici (if we continue this direction)

JonasSchubert avatar Apr 11 '25 08:04 JonasSchubert

  • we also introduce a breaking change by updating our engine to same 20.x.x or higher

with node v18 going EOL at the end of the month, it is a good time to consider tightening our supported ranges. however, we normally change our support to be limited to only the latest LTS line when we do release a breaking chain, so that goes beyond even the change to undici.

we could simply use only undici

i assume we would then use it through the native fetch inerface built into node rather than using undici as a dependency at that point, right? in that case, the node version requirement seems to go away

i guess the question comes down to whether we see ky as providing some value beyond native fetch or not. i dont have strong feelings either way as long as the path we choose favors maintainability.

travi avatar Apr 11 '25 19:04 travi

fetch is introduced in v18 as experimental and became stable in Node.js v21.

ievgennaida avatar Apr 12 '25 02:04 ievgennaida

i assume we would then use it through the native fetch inerface built into node rather than using undici as a dependency at that point, right? in that case, the node version requirement seems to go away

i guess the question comes down to whether we see ky as providing some value beyond native fetch or not. i dont have strong feelings either way as long as the path we choose favors maintainability.

I will continue working on it this week and would try to use node's built-in functionality.

JonasSchubert avatar May 07 '25 12:05 JonasSchubert