Skip to content

Commit

Permalink
Update Edge Runtime (#38862)
Browse files Browse the repository at this point in the history
This PR updates the Edge Runtime to use a new version that loads dependencies differently. This addresses #38766 so `instanceof` works as expected.

It involved a few code changes, mostly regarding to types. The most important change is that the `Runner` function in the sandbox doesn't take a `ReadableStream` as `body` anymore since this implies creating the instance on "node land" and makes the runtime `fetch` function not to be able to compare with `ReadableStream` using `instanceof`.  Instead we introduce a "clonable body" abstraction that allows to create the `ReadableStream` from `Readable` by using the edge runtime primitive which would hold the correct prototype.

Also, this PR changes the way we pre-compile the Edge Runtime to adapt it to the new version.
  • Loading branch information
javivelasco committed Jul 21, 2022
1 parent fe4b711 commit 14463dd
Show file tree
Hide file tree
Showing 43 changed files with 27,589 additions and 21,985 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -56,7 +56,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
"@babel/preset-flow": "7.14.5",
"@babel/preset-react": "7.14.5",
"@edge-runtime/jest-environment": "1.1.0-beta.11",
"@edge-runtime/jest-environment": "1.1.0-beta.17",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "0.18.0",
"@next/bundle-analyzer": "workspace:*",
Expand Down

0 comments on commit 14463dd

Please sign in to comment.