Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to latest @edge-runtime packages #62955

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/preset-flow": "7.22.5",
"@babel/preset-react": "7.22.5",
"@edge-runtime/jest-environment": "2.3.4",
"@edge-runtime/jest-environment": "2.3.10",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.1",
"@fullhuman/postcss-purgecss": "1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
"@babel/types": "7.22.5",
"@capsizecss/metrics": "2.0.0",
"@edge-runtime/cookies": "4.1.0",
"@edge-runtime/ponyfill": "2.4.1",
"@edge-runtime/primitives": "4.0.2",
"@edge-runtime/ponyfill": "2.4.2",
"@edge-runtime/primitives": "4.1.0",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function edge() {
File,
FormData,
Headers,
performance,
PromiseRejectionEvent,
ReadableStream,
ReadableStreamBYOBReader,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/ponyfill","version":"2.4.1","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}
{"name":"@edge-runtime/ponyfill","version":"2.4.2","main":"./index.js","types":"./index.d.ts","license":"MPL-2.0"}

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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ declare namespace Event$1 {
declare const EventTargetConstructor: typeof EventTarget
declare const EventConstructor: typeof Event


declare class FetchEvent {
request: Request
response: Response | null
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ declare const FileConstructor: typeof File
declare const FormDataConstructor: typeof FormData
declare const WebSocketConstructor: typeof WebSocket

export { FileConstructor as File, FormDataConstructor as FormData, Headers, Request, RequestInfo, RequestInit, Response, WebSocketConstructor as WebSocket, fetchImplementation as fetch };
export { FileConstructor as File, FormDataConstructor as FormData, Headers, Request, type RequestInfo, type RequestInit, Response, WebSocketConstructor as WebSocket, fetchImplementation as fetch };

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions packages/next/src/compiled/@edge-runtime/primitives/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ export { AbortController, AbortSignal, DOMException } from './abort-controller.d
export { Blob } from './blob.d.js';
export { console } from './console.d.js';
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 { structuredClone } from './structured-clone.d.js';
export { URL, URLPattern, URLSearchParams } from './url.d.js';
export { setInterval, setTimeout } from './timers.d.js';

declare const TextEncoderConstructor: typeof TextEncoder
declare const TextDecoderConstructor: typeof TextDecoder


declare const _atob: typeof atob
declare const _btoa: typeof btoa

/**
* The type of `ReadableStreamBYOBReader` is not included in Typescript so we
* are declaring it inline to not have to worry about bundling.
Expand All @@ -18,7 +24,7 @@ declare class ReadableStreamBYOBReader {
get closed(): Promise<undefined>
cancel(reason?: any): Promise<void>
read<T extends ArrayBufferView>(
view: T
view: T,
): Promise<{ done: false; value: T } | { done: true; value: T | undefined }>
releaseLock(): void
}
Expand All @@ -33,4 +39,6 @@ declare const WritableStreamDefaultWriterConstructor: typeof WritableStreamDefau
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 };
declare const performanceConstructor: typeof performance

export { ReadableStreamConstructor as ReadableStream, ReadableStreamBYOBReaderConstructor as ReadableStreamBYOBReader, ReadableStreamDefaultReaderConstructor as ReadableStreamDefaultReader, TextDecoderConstructor as TextDecoder, TextDecoderStreamConstructor as TextDecoderStream, TextEncoderConstructor as TextEncoder, TextEncoderStreamConstructor as TextEncoderStream, TransformStreamConstructor as TransformStream, WritableStreamConstructor as WritableStream, WritableStreamDefaultWriterConstructor as WritableStreamDefaultWriter, _atob as atob, _btoa as btoa, performanceConstructor as performance };
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import * as __index from './index';
* ```
*/
declare function load(
scopedContext: Record<string, unknown>
scopedContext: Record<string, unknown>,
): typeof __index

export { load };
11 changes: 3 additions & 8 deletions packages/next/src/compiled/@edge-runtime/primitives/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,14 @@ function requireWithFakeGlobalScope(params) {
__name(requireWithFakeGlobalScope, "requireWithFakeGlobalScope");
function load(scopedContext = {}) {
const context = {};
const encodingImpl = requireWithFakeGlobalScope({
context,
id: "encoding.js",
sourceCode: require("./encoding.js.text.js"),
scopedContext
});
assign(context, {
TextDecoder,
TextEncoder,
TextEncoderStream: import_web.TextEncoderStream,
TextDecoderStream: import_web.TextDecoderStream,
atob: encodingImpl.atob,
btoa: encodingImpl.btoa
atob,
btoa,
performance
});
const consoleImpl = requireWithFakeGlobalScope({
context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/primitives","version":"4.0.2","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/primitives","version":"4.1.0","main":"./index.js","license":"MPL-2.0"}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare const _setTimeout: typeof Number
declare const _setInterval: typeof Number
declare const _setTimeout: (callback: () => void, ms?: number) => number
declare const _setInterval: (callback: () => void, ms?: number) => number

export { _setInterval as setInterval, _setTimeout as setTimeout };

Large diffs are not rendered by default.