Skip to content

Commit

Permalink
upgrade edge-runtime dependency (vercel#50636)
Browse files Browse the repository at this point in the history
Hello,

We removed some core non-necessary dependencies that make Edge Runtime
smaller 🙂.

Also, Edge Runtime is exposing `WebSocket`, so nothing additional should
be done.

Closes vercel#50760

---------

Co-authored-by: Wyatt Johnson <[email protected]>
  • Loading branch information
2 people authored and hydRAnger committed Jun 12, 2023
1 parent 94c1222 commit e0077e6
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 1,842 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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": "2.2.0",
"@edge-runtime/jest-environment": "2.2.1",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "2.2.1",
"@mdx-js/react": "2.2.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@
"@babel/traverse": "7.18.0",
"@babel/types": "7.18.0",
"@capsizecss/metrics": "1.1.0",
"@edge-runtime/cookies": "3.2.0",
"@edge-runtime/cookies": "3.2.1",
"@edge-runtime/ponyfill": "2.3.0",
"@edge-runtime/primitives": "3.0.0",
"@edge-runtime/primitives": "3.0.1",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down Expand Up @@ -222,7 +222,7 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.3.0",
"edge-runtime": "2.3.2",
"events": "3.3.0",
"find-cache-dir": "3.3.1",
"find-up": "4.1.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/next/src/compiled/@edge-runtime/cookies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ function parseCookieString(cookie) {
if (!pair)
continue;
const splitAt = pair.indexOf("=");
if (splitAt === -1) {
map.set(pair, "true");
continue;
}
const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];
try {
map.set(key, decodeURIComponent(value != null ? value : "true"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/cookies","version":"3.2.0","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/cookies","version":"3.2.1","main":"./index.js","license":"MPL-2.0"}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/next/src/compiled/@edge-runtime/primitives/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ function load(scopedContext = {}) {
scopedContext
});
assign(context, {
TextDecoder: encodingImpl.TextDecoder,
TextEncoder: encodingImpl.TextEncoder,
TextDecoder,
TextEncoder,
atob: encodingImpl.atob,
btoa: encodingImpl.btoa
});
Expand Down Expand Up @@ -145,8 +145,8 @@ function load(scopedContext = {}) {
scopedContext: { ...scopedContext }
});
assign(context, {
URL: urlImpl.URL,
URLSearchParams: urlImpl.URLSearchParams,
URL,
URLSearchParams,
URLPattern: urlImpl.URLPattern
});
const blobImpl = (() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/primitives","version":"3.0.0","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/primitives","version":"3.0.1","main":"./index.js","license":"MPL-2.0"}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions packages/next/src/compiled/babel-packages/packages-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/next/src/compiled/edge-runtime/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/next/src/server/web/sandbox/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ async function createModuleContext(options: ModuleContextOptions) {
? { strings: true, wasm: true }
: undefined,
extend: (context) => {
context.WebSocket = require('next/dist/compiled/ws').WebSocket
context.process = createProcessPolyfill()

Object.defineProperty(context, 'require', {
Expand Down
Loading

0 comments on commit e0077e6

Please sign in to comment.