Skip to content

Commit

Permalink
[edge-runtime] drop node18
Browse files Browse the repository at this point in the history
It also updated to use undici@6
  • Loading branch information
Kikobeats committed Dec 2, 2024
1 parent 7c24763 commit 8f695e9
Show file tree
Hide file tree
Showing 25 changed files with 37,354 additions and 223 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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": "3.0.4",
"@edge-runtime/jest-environment": "4.0.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 @@ -153,9 +153,9 @@
"@babel/traverse": "7.22.5",
"@babel/types": "7.22.5",
"@capsizecss/metrics": "3.4.0",
"@edge-runtime/cookies": "5.0.0",
"@edge-runtime/ponyfill": "3.0.0",
"@edge-runtime/primitives": "5.1.1",
"@edge-runtime/cookies": "6.0.0",
"@edge-runtime/ponyfill": "4.0.0",
"@edge-runtime/primitives": "6.0.0",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down Expand Up @@ -242,7 +242,7 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "3.0.5",
"edge-runtime": "4.0.0",
"events": "3.3.0",
"find-up": "4.1.0",
"fresh": "0.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ type RequestCookie = Pick<CookieListItem, 'name' | 'value'>;
*/
declare class RequestCookies {
constructor(requestHeaders: Headers);
[Symbol.iterator](): IterableIterator<[string, RequestCookie]>;
[Symbol.iterator](): MapIterator<[string, RequestCookie]>;
/**
* The amount of cookies received from the client
*/
Expand Down
9 changes: 6 additions & 3 deletions packages/next/src/compiled/@edge-runtime/cookies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ function parseSetCookie(setCookie) {
partitioned,
priority
} = Object.fromEntries(
attributes.map(([key, value2]) => [key.toLowerCase(), value2])
attributes.map(([key, value2]) => [
key.toLowerCase().replace(/-/g, ""),
value2
])
);
const cookie = {
name,
Expand Down Expand Up @@ -297,8 +300,8 @@ var ResponseCookies = class {
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
*/
delete(...args) {
const [name, path, domain] = typeof args[0] === "string" ? [args[0]] : [args[0].name, args[0].path, args[0].domain];
return this.set({ name, path, domain, value: "", expires: /* @__PURE__ */ new Date(0) });
const [name, options] = typeof args[0] === "string" ? [args[0]] : [args[0].name, args[0]];
return this.set({ ...options, name, value: "", expires: /* @__PURE__ */ new Date(0) });
}
[Symbol.for("edge-runtime.inspect.custom")]() {
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/cookies","version":"5.0.0","main":"./index.js","license":"MIT"}
{"name":"@edge-runtime/cookies","version":"6.0.0","main":"./index.js","license":"MIT"}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/ponyfill","version":"3.0.0","main":"./index.js","types":"./index.d.ts","license":"MIT"}
{"name":"@edge-runtime/ponyfill","version":"4.0.0","main":"./index.js","types":"./index.d.ts","license":"MIT"}
3 changes: 0 additions & 3 deletions packages/next/src/compiled/@edge-runtime/primitives/blob.d.ts

This file was deleted.

This file was deleted.

45 changes: 45 additions & 0 deletions packages/next/src/compiled/@edge-runtime/primitives/crypto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/primitives/crypto.js
var crypto_exports = {};
__export(crypto_exports, {
Crypto: () => Crypto,
CryptoKey: () => CryptoKey,
SubtleCrypto: () => SubtleCrypto,
crypto: () => crypto
});
module.exports = __toCommonJS(crypto_exports);
var import_node_crypto = require("crypto");
var { Crypto, CryptoKey } = import_node_crypto.webcrypto;
function SubtleCrypto() {
if (!(this instanceof SubtleCrypto))
return new SubtleCrypto();
throw TypeError("Illegal constructor");
}
__name(SubtleCrypto, "SubtleCrypto");
var crypto = new Crypto();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Crypto,
CryptoKey,
SubtleCrypto,
crypto
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
declare class Headers extends globalThis.Headers {
/** @deprecated Use [`.getSetCookie()`](https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie) instead. */
getAll?(key: 'set-cookie'): string[]
}

declare class Request extends globalThis.Request {
readonly headers: Headers
readonly duplex: string
Expand All @@ -23,5 +18,6 @@ declare const fetchImplementation: (
declare const FileConstructor: typeof File
declare const FormDataConstructor: typeof FormData
declare const WebSocketConstructor: typeof WebSocket
declare const HeadersConstructor: typeof Headers

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

0 comments on commit 8f695e9

Please sign in to comment.