@plasmicapp/loader-core
Advanced tools
Comparing version 1.0.122 to 1.0.123
@@ -138,3 +138,3 @@ "use strict"; | ||
function getBundleSubset(bundle, names, opts2) { | ||
var _a; | ||
var _a, _b; | ||
const namesSet = new Set(names); | ||
@@ -157,3 +157,4 @@ const target = (_a = opts2 == null ? void 0 : opts2.target) != null ? _a : "browser"; | ||
projects: bundle.projects, | ||
activeSplits: bundle.activeSplits | ||
activeSplits: bundle.activeSplits, | ||
bundleUrlQuery: (_b = bundle.bundleUrlQuery) != null ? _b : null | ||
}; | ||
@@ -195,2 +196,8 @@ } | ||
} | ||
if (!this.modules[name] && globalThis.__PLASMIC_CHUNKS && !!globalThis.__PLASMIC_CHUNKS[name]) { | ||
this.modules[name] = globalThis.__PLASMIC_CHUNKS[name]; | ||
} | ||
if (!this.modules[name] && globalThis.__PlasmicBundlePromises && !!typeof globalThis.__PlasmicBundlePromises[name] && !!globalThis.__PlasmicBundlePromises[name].then) { | ||
throw globalThis.__PlasmicBundlePromises[name]; | ||
} | ||
if (!(name in this.modules)) { | ||
@@ -227,2 +234,5 @@ throw new Error(`Unknown module ${name}`); | ||
delete this.loadedModules[name]; | ||
if (!(err2 instanceof Error) && !!err2 && !!err2.then) { | ||
throw err2; | ||
} | ||
throw new Error(`PLASMIC: Failed to load ${name}: ${err2}`); | ||
@@ -235,4 +245,8 @@ } | ||
for (const mod of isBrowser ? bundle.modules.browser : bundle.modules.server) { | ||
if (mod.type === "code" && mod.code !== this.modules[mod.fileName]) { | ||
if (mod.type === "code" && !!mod.code && mod.code !== this.modules[mod.fileName]) { | ||
this.modules[mod.fileName] = mod.code; | ||
if (!globalThis.__PLASMIC_CHUNKS) { | ||
globalThis.__PLASMIC_CHUNKS = {}; | ||
} | ||
globalThis.__PLASMIC_CHUNKS[mod.fileName] = mod.code; | ||
updated = true; | ||
@@ -239,0 +253,0 @@ } |
@@ -36,3 +36,3 @@ import { Api } from '@plasmicapp/loader-fetcher'; | ||
export declare function getBundleSubset(bundle: LoaderBundleOutput, names: string[], opts?: { | ||
target?: 'browser' | 'server'; | ||
target?: "browser" | "server"; | ||
}): LoaderBundleOutput; | ||
@@ -39,0 +39,0 @@ |
@@ -103,3 +103,3 @@ var __defProp = Object.defineProperty; | ||
function getBundleSubset(bundle, names, opts2) { | ||
var _a; | ||
var _a, _b; | ||
const namesSet = new Set(names); | ||
@@ -122,3 +122,4 @@ const target = (_a = opts2 == null ? void 0 : opts2.target) != null ? _a : "browser"; | ||
projects: bundle.projects, | ||
activeSplits: bundle.activeSplits | ||
activeSplits: bundle.activeSplits, | ||
bundleUrlQuery: (_b = bundle.bundleUrlQuery) != null ? _b : null | ||
}; | ||
@@ -160,2 +161,8 @@ } | ||
} | ||
if (!this.modules[name] && globalThis.__PLASMIC_CHUNKS && !!globalThis.__PLASMIC_CHUNKS[name]) { | ||
this.modules[name] = globalThis.__PLASMIC_CHUNKS[name]; | ||
} | ||
if (!this.modules[name] && globalThis.__PlasmicBundlePromises && !!typeof globalThis.__PlasmicBundlePromises[name] && !!globalThis.__PlasmicBundlePromises[name].then) { | ||
throw globalThis.__PlasmicBundlePromises[name]; | ||
} | ||
if (!(name in this.modules)) { | ||
@@ -192,2 +199,5 @@ throw new Error(`Unknown module ${name}`); | ||
delete this.loadedModules[name]; | ||
if (!(err2 instanceof Error) && !!err2 && !!err2.then) { | ||
throw err2; | ||
} | ||
throw new Error(`PLASMIC: Failed to load ${name}: ${err2}`); | ||
@@ -200,4 +210,8 @@ } | ||
for (const mod of isBrowser ? bundle.modules.browser : bundle.modules.server) { | ||
if (mod.type === "code" && mod.code !== this.modules[mod.fileName]) { | ||
if (mod.type === "code" && !!mod.code && mod.code !== this.modules[mod.fileName]) { | ||
this.modules[mod.fileName] = mod.code; | ||
if (!globalThis.__PLASMIC_CHUNKS) { | ||
globalThis.__PLASMIC_CHUNKS = {}; | ||
} | ||
globalThis.__PLASMIC_CHUNKS[mod.fileName] = mod.code; | ||
updated = true; | ||
@@ -204,0 +218,0 @@ } |
@@ -138,3 +138,3 @@ "use strict"; | ||
function getBundleSubset(bundle, names, opts2) { | ||
var _a; | ||
var _a, _b; | ||
const namesSet = new Set(names); | ||
@@ -157,3 +157,4 @@ const target = (_a = opts2 == null ? void 0 : opts2.target) != null ? _a : "browser"; | ||
projects: bundle.projects, | ||
activeSplits: bundle.activeSplits | ||
activeSplits: bundle.activeSplits, | ||
bundleUrlQuery: (_b = bundle.bundleUrlQuery) != null ? _b : null | ||
}; | ||
@@ -195,2 +196,8 @@ } | ||
} | ||
if (!this.modules[name] && globalThis.__PLASMIC_CHUNKS && !!globalThis.__PLASMIC_CHUNKS[name]) { | ||
this.modules[name] = globalThis.__PLASMIC_CHUNKS[name]; | ||
} | ||
if (!this.modules[name] && globalThis.__PlasmicBundlePromises && !!typeof globalThis.__PlasmicBundlePromises[name] && !!globalThis.__PlasmicBundlePromises[name].then) { | ||
throw globalThis.__PlasmicBundlePromises[name]; | ||
} | ||
if (!(name in this.modules)) { | ||
@@ -227,2 +234,5 @@ throw new Error(`Unknown module ${name}`); | ||
delete this.loadedModules[name]; | ||
if (!(err2 instanceof Error) && !!err2 && !!err2.then) { | ||
throw err2; | ||
} | ||
throw new Error(`PLASMIC: Failed to load ${name}: ${err2}`); | ||
@@ -235,4 +245,8 @@ } | ||
for (const mod of isBrowser ? bundle.modules.browser : bundle.modules.server) { | ||
if (mod.type === "code" && mod.code !== this.modules[mod.fileName]) { | ||
if (mod.type === "code" && !!mod.code && mod.code !== this.modules[mod.fileName]) { | ||
this.modules[mod.fileName] = mod.code; | ||
if (!globalThis.__PLASMIC_CHUNKS) { | ||
globalThis.__PLASMIC_CHUNKS = {}; | ||
} | ||
globalThis.__PLASMIC_CHUNKS[mod.fileName] = mod.code; | ||
updated = true; | ||
@@ -239,0 +253,0 @@ } |
{ | ||
"version": "1.0.122", | ||
"version": "1.0.123", | ||
"license": "MIT", | ||
@@ -45,5 +45,5 @@ "types": "./dist/index.d.ts", | ||
"@plasmicapp/isomorphic-unfetch": "1.0.3", | ||
"@plasmicapp/loader-fetcher": "1.0.44" | ||
"@plasmicapp/loader-fetcher": "1.0.45" | ||
}, | ||
"gitHead": "60e590bf33cd69167cb9fda7cad1807118943548" | ||
"gitHead": "06322ab98d09d2a4f26e68939555898c57d2d082" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108282
1690
5
+ Added@plasmicapp/loader-fetcher@1.0.45(transitive)
- Removed@plasmicapp/loader-fetcher@1.0.44(transitive)