rsnext/packages/next/compiled
Ethan Arrowood e0cc9cd44f
feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318)
This PR adds a new `experimental.enableUndici` option to let the
developer switch from `next-fetch` to `undici` as the underlying
polyfill for `fetch` in Node.js.

In the current implementation, Next.js makes sure that `fetch` is always
available by using `node-fetch`. However, we do not polyfill in Node.js
18+, since those versions come with their own `fetch` implementation
already, built-in.

Node.js 18+ uses `undici` under the hood, so letting the developer use
`undici` earlier could make the migration easier later on.

Eventually, we hope to be able to stop polyfilling `fetch` in an
upcoming major version of Next.js, shipping less code.


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Sukka <isukkaw@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2022-09-27 13:37:28 -07:00
..
@babel/runtime Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
@edge-runtime/primitives build: upgrade edge-runtime (#40788) 2022-09-23 12:01:36 +00:00
@hapi/accept Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@napi-rs/triples Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@segment/ajv-human-errors Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
@vercel/nft feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
acorn Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
amphtml-validator Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
arg Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
assert Update semver of eslint-plugin-react (#40246) 2022-09-13 01:55:44 +00:00
async-retry Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
async-sema Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
babel Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
babel-packages Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
browserify-zlib Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
browserslist Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
buffer Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
bytes Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
chalk Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ci-info Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
cli-select Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
comment-json Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
compression Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
conf feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
constants-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
content-disposition Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
content-type Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
cookie Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
cross-spawn Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
crypto-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
cssnano-simple Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
debug Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
devalue Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
domain-browser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
edge-runtime build: upgrade edge-runtime (#40788) 2022-09-23 12:01:36 +00:00
events Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
find-cache-dir Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
find-up Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
fresh Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
get-orientation Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
glob Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
gzip-size Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
http-proxy Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
https-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
icss-utils Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ignore-loader Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
image-size Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-animated Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-docker Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
is-wsl Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
jest-worker Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
json5 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
jsonwebtoken Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
loader-utils2 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
loader-utils3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
lodash.curry Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
lru-cache Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
micromatch Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
mini-css-extract-plugin Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
nanoid Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
native-url Update to latest ncc and ensure caniuse-lite data is external (#32064) 2021-12-08 10:41:35 -06:00
neo-async Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
node-fetch Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
node-html-parser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ora feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
os-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
p-limit Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
path-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-flexbugs-fixes Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-extract-imports Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-local-by-default Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-scope Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-modules-values Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-preset-env Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-safe-parser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-scss Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
postcss-value-parser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
process Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
punycode Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
querystring-es3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
raw-body Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
react-is Pre-compile more dependencies (#32742) 2022-01-17 15:17:22 +00:00
react-server-dom-webpack Upgrade react@experimental (#40885) 2022-09-25 21:35:05 +02:00
regenerator-runtime Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
sass-loader Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
schema-utils2 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
schema-utils3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
semver Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
send Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
setimmediate Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
source-map Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
stream-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
stream-http Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
string-hash Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
string_decoder Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
strip-ansi Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
tar Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
terser Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
text-table Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
timers-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
tty-browserify Pre-compile more dependencies (#32627) 2021-12-20 14:01:35 +01:00
ua-parser-js Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
undici feat(experimental): option to polyfill fetch using undici in Node.js <18 (#40318) 2022-09-27 13:37:28 -07:00
unistore Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
util Update semver of eslint-plugin-react (#40246) 2022-09-13 01:55:44 +00:00
vm-browserify Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
watchpack Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
web-vitals Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
webpack refactor: split up CONTRIBUTING.md (#40515) 2022-09-16 14:54:58 -07:00
webpack-sources1 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
webpack-sources3 Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
ws Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00