Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove our dependency on undici #442

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

erunion
Copy link
Member

@erunion erunion commented Nov 8, 2023

🧰 Changes

While pulling our latest release of this library into our main app I was having a lot of problems with Webpack trying to compile in undici into our frontend code because of the logic we've got here if the File API isn't present. Well much to my surprise Node began exposing this back in 18.13.01.

By removing undici completely and using File in node:buffer folks who use Webpack (especially api users) will be able to add a fallback for it2:

resolve: {
  fallback: {
    buffer: require.resolve('buffer/')
  }
}

Though this requires pinning our minimum Node 18 release at 18.13.0 instead of just 18.* I'm iffy on considering this a breaking change because Node 18.13.0 was released by in January and everyone, including us, who are using 18 should be past it by now. We may want to also pin @readme/api-core and api to >=18.13.0 though because they, well at least api-core, use this library.

Footnotes

  1. https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-01-05-version-18130-hydrogen-lts-danielleadams

  2. Something they've likely already had to do for the Blob polyfill we are using out of it if global.Blob isn't present.

@erunion erunion added enhancement New feature or request refactor Issues about tackling technical debt labels Nov 8, 2023
@erunion erunion merged commit fe496fc into main Nov 8, 2023
7 checks passed
@erunion erunion deleted the feat/use-native-file-api branch November 8, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants