Unverified Commit 1274713b authored by Kiko Beats's avatar Kiko Beats Committed by GitHub

edge: expose Websocket constructor (#48870)

This PR make possible to use WebSocket in an Edge Function 🙂
parent c390c166
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
"timers-browserify": "2.0.12", "timers-browserify": "2.0.12",
"tty-browserify": "0.0.1", "tty-browserify": "0.0.1",
"ua-parser-js": "0.7.28", "ua-parser-js": "0.7.28",
"undici": "5.14.0", "undici": "5.22.0",
"unistore": "3.4.1", "unistore": "3.4.1",
"util": "0.12.4", "util": "0.12.4",
"uuid": "8.3.2", "uuid": "8.3.2",
......
This diff is collapsed.
...@@ -235,6 +235,7 @@ async function createModuleContext(options: ModuleContextOptions) { ...@@ -235,6 +235,7 @@ async function createModuleContext(options: ModuleContextOptions) {
? { strings: true, wasm: true } ? { strings: true, wasm: true }
: undefined, : undefined,
extend: (context) => { extend: (context) => {
context.WebSocket = require('next/dist/compiled/undici').WebSocket
context.process = createProcessPolyfill(options) context.process = createProcessPolyfill(options)
Object.defineProperty(context, 'require', { Object.defineProperty(context, 'require', {
......
...@@ -706,7 +706,7 @@ importers: ...@@ -706,7 +706,7 @@ importers:
timers-browserify: 2.0.12 timers-browserify: 2.0.12
tty-browserify: 0.0.1 tty-browserify: 0.0.1
ua-parser-js: 0.7.28 ua-parser-js: 0.7.28
undici: 5.14.0 undici: 5.22.0
unistore: 3.4.1 unistore: 3.4.1
util: 0.12.4 util: 0.12.4
uuid: 8.3.2 uuid: 8.3.2
...@@ -917,7 +917,7 @@ importers: ...@@ -917,7 +917,7 @@ importers:
timers-browserify: 2.0.12 timers-browserify: 2.0.12
tty-browserify: 0.0.1 tty-browserify: 0.0.1
ua-parser-js: 0.7.28 ua-parser-js: 0.7.28
undici: 5.14.0 undici: 5.22.0
unistore: 3.4.1_react@18.2.0 unistore: 3.4.1_react@18.2.0
util: 0.12.4 util: 0.12.4
uuid: 8.3.2 uuid: 8.3.2
...@@ -24388,9 +24388,9 @@ packages: ...@@ -24388,9 +24388,9 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true dev: true
/undici/5.14.0: /undici/5.22.0:
resolution: {integrity: sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==} resolution: {integrity: sha512-fR9RXCc+6Dxav4P9VV/sp5w3eFiSdOjJYsbtWfd4s5L5C4ogyuVpdKIVHeW0vV1MloM65/f7W45nR9ZxwVdyiA==}
engines: {node: '>=12.18'} engines: {node: '>=14.0'}
dependencies: dependencies:
busboy: 1.6.0 busboy: 1.6.0
dev: true dev: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment