rsnext/packages/next/shared/lib
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
..
i18n Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
isomorphic polish isomorphic path module (#36521) 2022-04-27 18:23:26 +00:00
page-path Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
router Update to not trigger revalidation during prefetch (#37201) 2022-05-29 23:05:23 +00:00
amp-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
amp.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
app-router-context.ts Refactor client component out of client runtime (#37238) 2022-05-29 20:53:12 +02:00
constants.ts Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
dynamic.tsx Preload chunks for next/dynamic in suspense mode (#37245) 2022-05-27 20:11:34 +00:00
escape-regexp.ts perf(escapeStringRegexp): test before replace (#34472) 2022-04-16 05:42:10 +00:00
flatten.ts Refactor Page Paths utils and Middleware Plugin (#36576) 2022-04-30 11:19:27 +00:00
get-hostname.ts Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
head-manager-context.ts next/script fix duplicate scripts (#28428) 2021-08-24 11:07:38 -05:00
head.tsx fix: place the charset meta tag at the top of the head (#36561) 2022-05-22 17:28:54 +00:00
html-context.ts Show warning during build if page is returning a large amount of data (#37264) 2022-05-29 01:39:48 +00:00
image-config-context.ts fix: make sure image-config gets transpiled (#34677) 2022-02-22 09:27:18 -05:00
image-config.ts Add experimental wildcard remotePatterns config for upstream images (#36245) 2022-05-05 02:19:16 +00:00
is-plain-object.ts Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
loadable-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.d.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.js Preload chunks for next/dynamic in suspense mode (#37245) 2022-05-27 20:11:34 +00:00
match-remote-pattern.ts Fix experimental remotePatterns wildcard (#37137) 2022-05-25 20:25:06 +00:00
mitt.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
router-context.ts Add new target for middleware (#30299) 2021-10-26 18:50:56 +02:00
runtime-config.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
side-effect.tsx Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
styled-jsx.d.ts Reexports styled-jsx JSXStyle in nextjs (#36585) 2022-04-30 20:25:05 +00:00
styled-jsx.js Reexports styled-jsx JSXStyle in nextjs (#36585) 2022-04-30 20:25:05 +00:00
utils.ts Add JSX.Element to styles type in DocumentInitialProps (#36392) 2022-05-22 23:00:36 -05:00