Skip to content

feat(axios-to-whatwg-fetch): introduce #269

Open
AugustinMauroy wants to merge 45 commits intomainfrom
feat/axios-to-whatwg-fetch
Open

feat(axios-to-whatwg-fetch): introduce #269
AugustinMauroy wants to merge 45 commits intomainfrom
feat/axios-to-whatwg-fetch

Conversation

@AugustinMauroy
Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy commented Nov 8, 2025

@AugustinMauroy AugustinMauroy added the awaiting reviewer Author has responded and needs action from the reviewer label Nov 8, 2025
@AugustinMauroy AugustinMauroy requested review from a team and removed request for a team November 8, 2025 13:49
@AugustinMauroy AugustinMauroy removed the awaiting reviewer Author has responded and needs action from the reviewer label Nov 8, 2025
@AugustinMauroy AugustinMauroy marked this pull request as draft November 8, 2025 13:50
@JakobJingleheimer
Copy link
Copy Markdown
Member

omg please yes

@AugustinMauroy AugustinMauroy requested a review from a team December 10, 2025 10:34
@AugustinMauroy
Copy link
Copy Markdown
Member Author

cc @nodejs/userland-migrations can I have first review on this one

@AugustinMauroy AugustinMauroy added the awaiting reviewer Author has responded and needs action from the reviewer label Dec 13, 2025
AugustinMauroy and others added 6 commits January 17, 2026 16:08
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
@AugustinMauroy
Copy link
Copy Markdown
Member Author

@JakobJingleheimer I tried to apply all of your proposal.

But why the ci didn't ran ?

@JakobJingleheimer
Copy link
Copy Markdown
Member

It looks like CI did run?

If not, was this whilst I was fiddling with the repo permissions? (I specifically told you on slack you'd temporarily have read-only permissions for a bit, which means you couldn't do anything other than read within the repo)

@AugustinMauroy
Copy link
Copy Markdown
Member Author

It looks like CI did run?

If not, was this whilst I was fiddling with the repo permissions? (I specifically told you on slack you'd temporarily have read-only permissions for a bit, which means you couldn't do anything other than read within the repo)

it's ran after the merge commit. idk what really happened but it's work now !

it's didn't help since I dunno why windows is doing windows thing

@AugustinMauroy AugustinMauroy added awaiting reviewer Author has responded and needs action from the reviewer and removed awaiting author Reviewer has requested something from the author labels Jan 17, 2026
Copy link
Copy Markdown
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tidy!

It's still missing handling for transformRequest, transformResponse, paramsSerializer, etc, which was the blocker before. It needs to either

  • support them
  • detect them and abort/fail the migration

Doing neither will result in broken userland code.

@JakobJingleheimer JakobJingleheimer added awaiting author Reviewer has requested something from the author and removed awaiting reviewer Author has responded and needs action from the reviewer labels Jan 25, 2026
Comment thread recipes/axios-to-whatwg-fetch/src/workflow.ts Outdated
@AugustinMauroy AugustinMauroy force-pushed the feat/axios-to-whatwg-fetch branch from d1ae93f to 469e199 Compare April 6, 2026 07:33
@AugustinMauroy AugustinMauroy added awaiting reviewer Author has responded and needs action from the reviewer and removed awaiting author Reviewer has requested something from the author labels Apr 6, 2026
@AugustinMauroy
Copy link
Copy Markdown
Member Author

@JakobJingleheimer applied your proposal

Copy link
Copy Markdown
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Comment on lines +69 to +84
'transformRequest',
'transformResponse',
'paramsSerializer',
'withCredentials',
'timeout',
'httpAgent',
'httpsAgent',
'validateStatus',
'maxRedirects',
'socketPath',
'decompress',
'maxContentLength',
'maxBodyLength',
'beforeRedirect',
'cancelToken',
'signal',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for the grok

Suggested change
'transformRequest',
'transformResponse',
'paramsSerializer',
'withCredentials',
'timeout',
'httpAgent',
'httpsAgent',
'validateStatus',
'maxRedirects',
'socketPath',
'decompress',
'maxContentLength',
'maxBodyLength',
'beforeRedirect',
'cancelToken',
'signal',
'beforeRedirect',
'cancelToken',
'decompress',
'httpAgent',
'httpsAgent',
'maxBodyLength',
'maxContentLength',
'maxRedirects',
'paramsSerializer',
'signal',
'socketPath',
'timeout',
'transformRequest',
'transformResponse',
'validateStatus',
'withCredentials',

'beforeRedirect',
'cancelToken',
'signal',
];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
];
] as const;

}

return { unsupported: false };
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be more than one; I think it would be useful to report them all to the user. In that case, I think it would make sense to do something like

function getUnsupportedOptions(configNode?: SgNode<Js>): false | (typeof UNSUPPORTED_CONFIG_OPTIONS)[number][];

Comment on lines +147 to +148
// if it's already a FormData or URLSearchParams instance, return as is
// we only check for common instantiation patterns here maybe add complex ones later
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
// if it's already a FormData or URLSearchParams instance, return as is
// we only check for common instantiation patterns here maybe add complex ones later
// if it's already a FormData or URLSearchParams instance, return as-is
// we only check for common instantiation patterns heremaybe add complex ones later?

},
});

const axiosMethodUpdates: AxiosMethodUpdateConfig[] = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use satisfies

Suggested change
const axiosMethodUpdates: AxiosMethodUpdateConfig[] = [
const axiosMethodUpdates = [

oldOptionsIndex: 1,
optionalOptionsArg: false,
},
];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
];
] satisfies AxiosMethodUpdateConfig[];

Comment on lines +250 to +254
const baseUpdates: {
oldBind: string;
replaceFn: BindingToReplace['replaceFn'];
supportDefaultAccess?: boolean;
}[] = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const baseUpdates: {
oldBind: string;
replaceFn: BindingToReplace['replaceFn'];
supportDefaultAccess?: boolean;
}[] = [
const baseUpdates = [

`;
},
},
];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
];
] satisfies {
oldBind: string;
replaceFn: BindingToReplace['replaceFn'];
supportDefaultAccess?: boolean;
}[];

Comment on lines +304 to +308
return dedent.withOptions({ alignValues: true })`
fetch(${url}${options ? `, ${options}` : ''})
.then(async (resp) => Object.assign(resp, { data: await resp.json() }))
.catch(() => null)
`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since this is dedented, can the indentation here be "proper"?

Suggested change
return dedent.withOptions({ alignValues: true })`
fetch(${url}${options ? `, ${options}` : ''})
.then(async (resp) => Object.assign(resp, { data: await resp.json() }))
.catch(() => null)
`;
return dedent.withOptions({ alignValues: true })`
fetch(${url}${options ? `, ${options}` : ''})
.then(async (resp) => Object.assign(resp, { data: await resp.json() }))
.catch(() => null)
`;

},
},
{
oldBind: '$.request',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh 🤦 👍

I think still better to errorWithLocation (because something failed).

@JakobJingleheimer JakobJingleheimer removed the awaiting reviewer Author has responded and needs action from the reviewer label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

feat(axios-to-whatwg-fetch)

4 participants