Skip to content

Commit

Permalink
upgrade Edge Runtime dependency (#54489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats authored Aug 24, 2023
1 parent 9ea6bc4 commit 08b117a
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 211 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,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.5",
"@edge-runtime/jest-environment": "2.3.0",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.1",
"@fullhuman/postcss-purgecss": "1.3.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
"@babel/traverse": "7.18.0",
"@babel/types": "7.18.0",
"@capsizecss/metrics": "1.1.0",
"@edge-runtime/cookies": "3.3.0",
"@edge-runtime/ponyfill": "2.3.0",
"@edge-runtime/primitives": "3.0.4",
"@edge-runtime/cookies": "3.4.0",
"@edge-runtime/ponyfill": "2.4.0",
"@edge-runtime/primitives": "3.1.0",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down Expand Up @@ -225,7 +225,7 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.4.5",
"edge-runtime": "2.5.0",
"events": "3.3.0",
"find-cache-dir": "3.3.1",
"find-up": "4.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/cookies","version":"3.3.0","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/cookies","version":"3.4.0","main":"./index.js","license":"MPL-2.0"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/ponyfill","version":"2.3.0","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}
{"name":"@edge-runtime/ponyfill","version":"2.4.0","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}
Original file line number Diff line number Diff line change
@@ -1,77 +0,0 @@
Bundled license information:

pvtsutils/build/index.es.js:
/*!
* MIT License
*
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/

pvutils/build/utils.es.js:
/*!
Copyright (c) Peculiar Ventures, LLC
*/

asn1js/build/index.es.js:
/*!
* Copyright (c) 2014, GMO GlobalSign
* Copyright (c) 2015-2022, Peculiar Ventures
* All rights reserved.
*
* Author 2014-2019, Yury Strozhevsky
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

webcrypto-core/build/webcrypto-core.es.js:
/*!
Copyright (c) Peculiar Ventures, LLC
*/

@peculiar/webcrypto/build/webcrypto.es.js:
/*!
Copyright (c) Peculiar Ventures, LLC
*/

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions packages/next/src/compiled/@edge-runtime/primitives/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@ export { Crypto, CryptoKey, SubtleCrypto, crypto } from './crypto.d.js';
export { TextDecoder, TextEncoder, atob, btoa } from './encoding.d.js';
export { Event, EventTarget, FetchEvent, PromiseRejectionEvent } from './events.d.js';
export { File, FormData, Headers, Request, RequestInfo, RequestInit, Response, WebSocket, fetch } from './fetch.d.js';
export { ReadableStream, ReadableStreamBYOBReader, ReadableStreamDefaultReader, TransformStream, WritableStream, WritableStreamDefaultWriter } from './streams.d.js';
export { TextDecoderStream, TextEncoderStream } from './text-encoding-streams.d.js';
export { structuredClone } from './structured-clone.d.js';
export { URL, URLPattern, URLSearchParams } from './url.d.js';

/**
* The type of `ReadableStreamBYOBReader` is not included in Typescript so we
* are declaring it inline to not have to worry about bundling.
*/
declare class ReadableStreamBYOBReader {
constructor(stream: ReadableStream<Uint8Array>)
get closed(): Promise<undefined>
cancel(reason?: any): Promise<void>
read<T extends ArrayBufferView>(
view: T
): Promise<{ done: false; value: T } | { done: true; value: T | undefined }>
releaseLock(): void
}

declare const ReadableStreamConstructor: typeof ReadableStream
declare const ReadableStreamBYOBReaderConstructor: typeof ReadableStreamBYOBReader
declare const ReadableStreamDefaultReaderConstructor: typeof ReadableStreamDefaultReader
declare const TransformStreamConstructor: typeof TransformStream
declare const WritableStreamConstructor: typeof WritableStream
declare const WritableStreamDefaultWriterConstructor: typeof WritableStreamDefaultWriter

declare const TextDecoderStreamConstructor: typeof TextDecoderStream
declare const TextEncoderStreamConstructor: typeof TextEncoderStream

export { ReadableStreamConstructor as ReadableStream, ReadableStreamBYOBReaderConstructor as ReadableStreamBYOBReader, ReadableStreamDefaultReaderConstructor as ReadableStreamDefaultReader, TextDecoderStreamConstructor as TextDecoderStream, TextEncoderStreamConstructor as TextEncoderStream, TransformStreamConstructor as TransformStream, WritableStreamConstructor as WritableStream, WritableStreamDefaultWriterConstructor as WritableStreamDefaultWriter };
47 changes: 17 additions & 30 deletions packages/next/src/compiled/@edge-runtime/primitives/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __export(load_exports, {
module.exports = __toCommonJS(load_exports);
var import_module = __toESM(require("module"));
var import_crypto = __toESM(require("crypto"));
var import_web = require("stream/web");
function requireWithFakeGlobalScope(params) {
const getModuleCode = `(function(module,exports,require,globalThis,${Object.keys(
params.scopedContext
Expand Down Expand Up @@ -82,6 +83,8 @@ function load(scopedContext = {}) {
assign(context, {
TextDecoder,
TextEncoder,
TextEncoderStream: import_web.TextEncoderStream,
TextDecoderStream: import_web.TextDecoderStream,
atob: encodingImpl.atob,
btoa: encodingImpl.btoa
});
Expand All @@ -99,39 +102,26 @@ function load(scopedContext = {}) {
scopedContext
});
assign(context, {
Event: eventsImpl.Event,
EventTarget: eventsImpl.EventTarget,
Event,
EventTarget,
FetchEvent: eventsImpl.FetchEvent,
// @ts-expect-error we need to add this to the type definitions maybe
PromiseRejectionEvent: eventsImpl.PromiseRejectionEvent
});
const streamsImpl = requireWithFakeGlobalScope({
context,
id: "streams.js",
sourceCode: require("./streams.js.text.js"),
scopedContext: { ...scopedContext }
});
const textEncodingStreamImpl = requireWithFakeGlobalScope({
context,
id: "text-encoding-streams.js",
sourceCode: require("./text-encoding-streams.js.text.js"),
scopedContext: { ...streamsImpl, ...scopedContext }
});
assign(context, {
ReadableStream: streamsImpl.ReadableStream,
ReadableStreamBYOBReader: streamsImpl.ReadableStreamBYOBReader,
ReadableStreamDefaultReader: streamsImpl.ReadableStreamDefaultReader,
TextDecoderStream: textEncodingStreamImpl.TextDecoderStream,
TextEncoderStream: textEncodingStreamImpl.TextEncoderStream,
TransformStream: streamsImpl.TransformStream,
WritableStream: streamsImpl.WritableStream,
WritableStreamDefaultWriter: streamsImpl.WritableStreamDefaultWriter
});
const streamsImpl = {
ReadableStream: import_web.ReadableStream,
ReadableStreamBYOBReader: import_web.ReadableStreamBYOBReader,
ReadableStreamDefaultReader: import_web.ReadableStreamDefaultReader,
TransformStream: import_web.TransformStream,
WritableStream: import_web.WritableStream,
WritableStreamDefaultWriter: import_web.WritableStreamDefaultWriter
};
assign(context, streamsImpl);
const abortControllerImpl = requireWithFakeGlobalScope({
context,
id: "abort-controller.js",
sourceCode: require("./abort-controller.js.text.js"),
scopedContext: { ...eventsImpl, ...scopedContext }
scopedContext: { ...scopedContext }
});
assign(context, {
AbortController: abortControllerImpl.AbortController,
Expand All @@ -156,10 +146,7 @@ function load(scopedContext = {}) {
if (typeof Blob === "function") {
return { Blob };
}
const global = {
...streamsImpl,
...scopedContext
};
const global = { ...streamsImpl, ...scopedContext };
const globalGlobal = { ...global, Blob: void 0 };
Object.setPrototypeOf(globalGlobal, globalThis);
global.global = globalGlobal;
Expand Down Expand Up @@ -193,10 +180,10 @@ function load(scopedContext = {}) {
scopedContext: {
global: { ...scopedContext },
...scopedContext,
...streamsImpl,
...urlImpl,
...abortControllerImpl,
...eventsImpl,
...streamsImpl,
structuredClone: context.structuredClone
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/primitives","version":"3.0.4","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/primitives","version":"3.1.0","main":"./index.js","license":"MPL-2.0"}
22 changes: 0 additions & 22 deletions packages/next/src/compiled/@edge-runtime/primitives/streams.d.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

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.

Loading

0 comments on commit 08b117a

Please sign in to comment.