rsnext/packages/next/server
Kiko Beats fafbea8b74
Use Edge Runtime for running Edge Functions locally (#37024)
This PR introduces [Edge Runtime](https://edge-runtime.vercel.app/) for emulating [Edge Functions](https://vercel.com/features/edge-functions) locally.

Every time you run a [middleware](https://nextjs.org/docs/advanced-features/middleware) locally via `next dev`, an isolated edge runtime context will be created.

These contexts have the same constraints as production servers, plus they don't pollute the global scope; Instead, all the code run in a vm on top of a Node.js process.

Additionally, `@edge-runtime/jest-environment` has been added to make easier testing Edge Functions in a programmatic way.

It dropped the following polyfills from Next.js codebase, since they are now part of Edge Runtime:

- abort-controller
- formdata
- uuid
- web-crypto
- web-streams

Co-authored-by: Gal Schlezinger <2054772+Schniz@users.noreply.github.com>
2022-05-30 12:01:36 +00:00
..
api-utils fix NextApiRequestCookies and NextApiRequestQuery types (#25532) 2022-05-23 00:48:26 +00:00
base-http Allow reading request bodies in middlewares (#34294) (#34519) 2022-02-18 19:43:43 +00:00
dev Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
lib Refactor incremental cache to be extensible (#37258) 2022-05-28 00:50:21 +00:00
send-payload Reduce the size of web server (#34767) 2022-02-24 19:53:17 +00:00
web Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
accept-header.ts Implement Middleware RFC (#30081) 2021-10-20 17:52:11 +00:00
app-render.tsx Refactor client component out of client runtime (#37238) 2022-05-29 20:53:12 +02:00
base-server.ts Update to not trigger revalidation during prefetch (#37201) 2022-05-29 23:05:23 +00:00
body-streams.ts Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
config-shared.ts Add swcMinifyDebugOptions (#37172) 2022-05-29 03:53:57 +00:00
config-utils.ts Remove webpack 4 support (#29660) 2021-10-06 17:40:01 +02:00
config.ts Add swcMinifyDebugOptions (#37172) 2022-05-29 03:53:57 +00:00
crypto-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
font-utils.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
get-page-files.ts Add initial handling for routing tests (#36635) 2022-05-03 10:37:23 +00:00
get-route-from-entrypoint.ts Rename app paths folder (#37146) 2022-05-25 11:46:26 +02:00
htmlescape.ts Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
image-optimizer.ts Add experimental wildcard remotePatterns config for upstream images (#36245) 2022-05-05 02:19:16 +00:00
load-components.ts Rename app paths folder (#37146) 2022-05-25 11:46:26 +02:00
next-server.ts Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
next.ts Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
node-polyfill-fetch.js Pre-compile more dependencies (#32742) 2022-01-17 15:17:22 +00:00
node-polyfill-web-streams.js Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
node-web-streams-helper.ts Update client router for tests (#36822) 2022-05-12 20:52:59 +00:00
optimize-amp.ts Move next-server directory files to server directory (#26756) 2021-06-30 13:44:40 +02:00
post-process.ts Enable html post optimization for react 18 (#36837) 2022-05-12 17:41:37 +00:00
render-result.ts Add unstable_useFlushEffects hook (#34117) 2022-02-18 00:18:28 +00:00
render.tsx Show warning during build if page is returning a large amount of data (#37264) 2022-05-29 01:39:48 +00:00
request-meta.ts Ensure we don't poll page in development when notFound: true is returned (#34352) 2022-02-16 18:53:48 +00:00
require.ts Rename app paths folder (#37146) 2022-05-25 11:46:26 +02:00
response-cache.ts Update to not trigger revalidation during prefetch (#37201) 2022-05-29 23:05:23 +00:00
router.ts Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
serve-static.ts Add support for AVIF to next/image (#29683) 2021-10-11 23:17:47 +00:00
server-route-utils.ts Use edge compiler for middleware (#36486) 2022-04-27 11:50:29 +02:00
utils.ts Refactor base server to remove native dependencies (#33499) 2022-01-20 21:25:44 +00:00
web-server.ts Rename app paths folder (#37146) 2022-05-25 11:46:26 +02:00