Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed May 28, 2023
1 parent 38c1a36 commit f812a8f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 46 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-beta.9",
"@edge-runtime/jest-environment": "2.2.0-beta.10",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "2.2.1",
"@mdx-js/react": "2.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"@capsizecss/metrics": "1.1.0",
"@edge-runtime/cookies": "3.2.0-beta.1",
"@edge-runtime/ponyfill": "2.3.0-beta.0",
"@edge-runtime/primitives": "2.2.0-beta.8",
"@edge-runtime/primitives": "2.2.0-beta.9",
"@hapi/accept": "5.0.2",
"@jest/transform": "29.5.0",
"@jest/types": "29.5.0",
Expand Down Expand Up @@ -221,7 +221,7 @@
"debug": "4.1.1",
"devalue": "2.0.1",
"domain-browser": "4.19.0",
"edge-runtime": "2.3.0-beta.8",
"edge-runtime": "2.3.0-beta.9",
"events": "3.3.0",
"find-cache-dir": "3.3.1",
"find-up": "4.1.0",
Expand Down
31 changes: 14 additions & 17 deletions packages/next/src/compiled/@edge-runtime/primitives/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,19 @@ __export(load_exports, {
});
module.exports = __toCommonJS(load_exports);
var import_module = __toESM(require("module"));
var import_path = require("path");
var import_crypto = __toESM(require("crypto"));
function requireWithFakeGlobalScope(params) {
const getModuleCode = `(function(module,exports,require,__dirname,__filename,globalThis,${Object.keys(
const getModuleCode = `(function(module,exports,require,globalThis,${Object.keys(
params.scopedContext
).join(",")}) {${params.sourceCode}
})`;
const module = {
exports: {},
loaded: false,
id: params.path
id: params.id
};
const moduleRequire = (import_module.default.createRequire || import_module.default.createRequireFromPath)(
params.path
__filename
);
function throwingRequire(pathToRequire) {
if (pathToRequire.startsWith("./")) {
Expand All @@ -66,8 +65,6 @@ function requireWithFakeGlobalScope(params) {
module,
module.exports,
throwingRequire,
(0, import_path.dirname)(params.path),
params.path,
params.context,
...Object.values(params.scopedContext)
);
Expand All @@ -78,7 +75,7 @@ function load(scopedContext = {}) {
const context = {};
const encodingImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./encoding.js"),
id: "encoding.js",
sourceCode: require("./encoding.js.text.js"),
scopedContext
});
Expand All @@ -90,14 +87,14 @@ function load(scopedContext = {}) {
});
const consoleImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./console.js"),
id: "console.js",
sourceCode: require("./console.js.text.js"),
scopedContext
});
assign(context, { console: consoleImpl.console });
const eventsImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./events.js"),
id: "events.js",
sourceCode: require("./events.js.text.js"),
scopedContext
});
Expand All @@ -110,13 +107,13 @@ function load(scopedContext = {}) {
});
const streamsImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./streams.js"),
id: "streams.js",
sourceCode: require("./streams.js.text.js"),
scopedContext: { ...scopedContext }
});
const textEncodingStreamImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./text-encoding-streams.js"),
id: "text-encoding-streams.js",
sourceCode: require("./text-encoding-streams.js.text.js"),
scopedContext: { ...streamsImpl, ...scopedContext }
});
Expand All @@ -132,7 +129,7 @@ function load(scopedContext = {}) {
});
const abortControllerImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./abort-controller.js"),
id: "abort-controller.js",
sourceCode: require("./abort-controller.js.text.js"),
scopedContext: { ...eventsImpl, ...scopedContext }
});
Expand All @@ -143,7 +140,7 @@ function load(scopedContext = {}) {
});
const urlImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./url.js"),
id: "url.js",
sourceCode: require("./url.js.text.js"),
scopedContext: { ...scopedContext }
});
Expand All @@ -154,15 +151,15 @@ function load(scopedContext = {}) {
});
const blobImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./blob.js"),
id: "blob.js",
sourceCode: require("./blob.js.text.js"),
scopedContext: { ...streamsImpl, ...scopedContext }
});
assign(context, {
Blob: blobImpl.Blob
});
const structuredCloneImpl = requireWithFakeGlobalScope({
path: (0, import_path.join)(__dirname, "./structured-clone.js"),
id: "structured-clone.js",
context,
sourceCode: require("./structured-clone.js.text.js"),
scopedContext: { ...streamsImpl, ...scopedContext }
Expand All @@ -172,7 +169,7 @@ function load(scopedContext = {}) {
});
const fetchImpl = requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./fetch.js"),
id: "fetch.js",
sourceCode: require("./fetch.js.text.js"),
cache: /* @__PURE__ */ new Map([
["abort-controller", { exports: abortControllerImpl }],
Expand Down Expand Up @@ -229,7 +226,7 @@ function getCrypto(context, scopedContext) {
}
return requireWithFakeGlobalScope({
context,
path: (0, import_path.join)(__dirname, "./crypto.js"),
id: "crypto.js",
sourceCode: require("./crypto.js.text.js"),
scopedContext: {
...scopedContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/primitives","version":"2.2.0-beta.8","main":"./index.js","license":"MPL-2.0"}
{"name":"@edge-runtime/primitives","version":"2.2.0-beta.9","main":"./index.js","license":"MPL-2.0"}
46 changes: 21 additions & 25 deletions pnpm-lock.yaml

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

0 comments on commit f812a8f

Please sign in to comment.