@module-federation/runtime
Advanced tools
Comparing version 0.0.0-next-20240827062238 to 0.0.0-next-20240829065118
'use strict'; | ||
var share = require('./share.cjs.js'); | ||
require('@swc/helpers/_/_extends'); | ||
require('@swc/helpers/_/_object_without_properties_loose'); | ||
require('@module-federation/sdk'); | ||
@@ -5,0 +8,0 @@ const ShareUtils = { |
@@ -1,2 +0,5 @@ | ||
import { q as getRegisteredShare, A as getGlobalShareScope, G as Global, K as nativeGlobal, L as resetFederationGlobalInfo, F as getGlobalFederationInstance, I as setGlobalFederationInstance, H as getGlobalFederationConstructor, E as setGlobalFederationConstructor, n as getInfoWithoutType, x as getGlobalSnapshot, M as getTargetSnapshotInfoByModuleInfo, t as getGlobalSnapshotInfoByModuleInfo, v as setGlobalSnapshotInfoByModuleInfo, u as addGlobalSnapshot, c as getRemoteEntryExports, J as registerGlobalPlugins, g as getGlobalHostPlugins, o as getPreloaded, p as setPreloaded } from './share.esm.js'; | ||
import { o as getRegisteredShare, y as getGlobalShareScope, G as Global, I as nativeGlobal, J as resetFederationGlobalInfo, C as getGlobalFederationInstance, F as setGlobalFederationInstance, E as getGlobalFederationConstructor, B as setGlobalFederationConstructor, m as getInfoWithoutType, u as getGlobalSnapshot, K as getTargetSnapshotInfoByModuleInfo, q as getGlobalSnapshotInfoByModuleInfo, t as setGlobalSnapshotInfoByModuleInfo, r as addGlobalSnapshot, c as getRemoteEntryExports, H as registerGlobalPlugins, g as getGlobalHostPlugins, n as getPreloaded, s as setPreloaded } from './share.esm.js'; | ||
import '@swc/helpers/_/_extends'; | ||
import '@swc/helpers/_/_object_without_properties_loose'; | ||
import '@module-federation/sdk'; | ||
@@ -3,0 +6,0 @@ const ShareUtils = { |
{ | ||
"name": "@module-federation/runtime", | ||
"version": "0.5.2", | ||
"version": "0.6.0", | ||
"author": "zhouxiao <codingzx@gmail.com>", | ||
@@ -37,2 +37,7 @@ "main": "./index.cjs.js", | ||
}, | ||
"./embedded": { | ||
"types": "./dist/embedded.cjs.d.ts", | ||
"import": "./dist/embedded.esm.js", | ||
"require": "./dist/embedded.cjs.js" | ||
}, | ||
"./*": "./*" | ||
@@ -39,0 +44,0 @@ }, |
'use strict'; | ||
function _extends() { | ||
_extends = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
var _extends = require('@swc/helpers/_/_extends'); | ||
const defaultRetries = 3; | ||
@@ -61,3 +49,3 @@ async function fetchWithRetry({ url, options = {}, retryTimes = defaultRetries, fallbackUrl = '' }) { | ||
url, | ||
options: _extends({}, options, params == null ? void 0 : params.options), | ||
options: _extends._({}, options, params == null ? void 0 : params.options), | ||
retryTimes: params == null ? void 0 : params.retryTimes, | ||
@@ -64,0 +52,0 @@ fallbackUrl: params == null ? void 0 : params.fallbackUrl |
@@ -1,15 +0,3 @@ | ||
function _extends() { | ||
_extends = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
import { _ } from '@swc/helpers/_/_extends'; | ||
const defaultRetries = 3; | ||
@@ -59,3 +47,3 @@ async function fetchWithRetry({ url, options = {}, retryTimes = defaultRetries, fallbackUrl = '' }) { | ||
url, | ||
options: _extends({}, options, params == null ? void 0 : params.options), | ||
options: _({}, options, params == null ? void 0 : params.options), | ||
retryTimes: params == null ? void 0 : params.retryTimes, | ||
@@ -62,0 +50,0 @@ fallbackUrl: params == null ? void 0 : params.fallbackUrl |
'use strict'; | ||
var _extends = require('@swc/helpers/_/_extends'); | ||
var _object_without_properties_loose = require('@swc/helpers/_/_object_without_properties_loose'); | ||
var sdk = require('@module-federation/sdk'); | ||
function getBuilderId() { | ||
@@ -7,8 +11,2 @@ //@ts-ignore | ||
} | ||
function isDebugMode() { | ||
return Boolean(""); | ||
} | ||
function isBrowserEnv() { | ||
return typeof window !== 'undefined'; | ||
} | ||
@@ -59,10 +57,2 @@ const LOG_CATEGORY = '[ Federation Runtime ]'; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
} | ||
function isObject(val) { | ||
@@ -87,3 +77,3 @@ return val && typeof val === 'object'; | ||
}; | ||
if (isBrowserEnv()) { | ||
if (sdk.isBrowserEnv()) { | ||
return 'remoteEntry' in snapshot ? { | ||
@@ -105,28 +95,2 @@ url: snapshot.remoteEntry, | ||
function _extends$1() { | ||
_extends$1 = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends$1.apply(this, arguments); | ||
} | ||
function _object_without_properties_loose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for(i = 0; i < sourceKeys.length; i++){ | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
const nativeGlobal = (()=>{ | ||
@@ -216,6 +180,6 @@ try { | ||
} | ||
function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) { | ||
function setGlobalFederationConstructor(FederationConstructor, isDebug = sdk.isDebugMode()) { | ||
if (isDebug) { | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor; | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.5.2"; | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.0"; | ||
} | ||
@@ -268,3 +232,3 @@ } | ||
if ('version' in moduleInfo && moduleInfo['version']) { | ||
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [ | ||
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose._(moduleInfo, [ | ||
"version" | ||
@@ -287,3 +251,3 @@ ]); | ||
const addGlobalSnapshot = (moduleInfos)=>{ | ||
nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos); | ||
nativeGlobal.__FEDERATION__.moduleInfo = _extends._({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos); | ||
return ()=>{ | ||
@@ -681,16 +645,2 @@ const keys = Object.keys(moduleInfos); | ||
function _extends() { | ||
_extends = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function formatShare(shareArgs, from, name, shareStrategy) { | ||
@@ -712,3 +662,3 @@ let get; | ||
var _shareArgs_version, _shareArgs_scope, _shareArgs_strategy; | ||
return _extends({ | ||
return _extends._({ | ||
deps: [], | ||
@@ -719,3 +669,3 @@ useIn: [], | ||
}, shareArgs, { | ||
shareConfig: _extends({ | ||
shareConfig: _extends._({ | ||
requiredVersion: `^${shareArgs.version}`, | ||
@@ -746,3 +696,3 @@ singleton: false, | ||
}, {}); | ||
const shared = _extends({}, globalOptions.shared); | ||
const shared = _extends._({}, globalOptions.shared); | ||
Object.keys(shareInfos).forEach((shareKey)=>{ | ||
@@ -936,3 +886,2 @@ if (!shared[shareKey]) { | ||
exports.globalLoading = globalLoading; | ||
exports.isBrowserEnv = isBrowserEnv; | ||
exports.isObject = isObject; | ||
@@ -945,3 +894,2 @@ exports.isPlainObject = isPlainObject; | ||
exports.resetFederationGlobalInfo = resetFederationGlobalInfo; | ||
exports.safeToString = safeToString; | ||
exports.setGlobalFederationConstructor = setGlobalFederationConstructor; | ||
@@ -948,0 +896,0 @@ exports.setGlobalFederationInstance = setGlobalFederationInstance; |
@@ -0,1 +1,5 @@ | ||
import { _ as _$1 } from '@swc/helpers/_/_extends'; | ||
import { _ } from '@swc/helpers/_/_object_without_properties_loose'; | ||
import { isBrowserEnv, isDebugMode } from '@module-federation/sdk'; | ||
function getBuilderId() { | ||
@@ -5,8 +9,2 @@ //@ts-ignore | ||
} | ||
function isDebugMode() { | ||
return Boolean(""); | ||
} | ||
function isBrowserEnv() { | ||
return typeof window !== 'undefined'; | ||
} | ||
@@ -57,10 +55,2 @@ const LOG_CATEGORY = '[ Federation Runtime ]'; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
function safeToString(info) { | ||
try { | ||
return JSON.stringify(info, null, 2); | ||
} catch (e) { | ||
return ''; | ||
} | ||
} | ||
function isObject(val) { | ||
@@ -102,28 +92,2 @@ return val && typeof val === 'object'; | ||
function _extends$1() { | ||
_extends$1 = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends$1.apply(this, arguments); | ||
} | ||
function _object_without_properties_loose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for(i = 0; i < sourceKeys.length; i++){ | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
const nativeGlobal = (()=>{ | ||
@@ -216,3 +180,3 @@ try { | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor; | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.5.2"; | ||
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.0"; | ||
} | ||
@@ -265,3 +229,3 @@ } | ||
if ('version' in moduleInfo && moduleInfo['version']) { | ||
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [ | ||
const { version } = moduleInfo, resModuleInfo = _(moduleInfo, [ | ||
"version" | ||
@@ -284,3 +248,3 @@ ]); | ||
const addGlobalSnapshot = (moduleInfos)=>{ | ||
nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos); | ||
nativeGlobal.__FEDERATION__.moduleInfo = _$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos); | ||
return ()=>{ | ||
@@ -678,16 +642,2 @@ const keys = Object.keys(moduleInfos); | ||
function _extends() { | ||
_extends = Object.assign || function(target) { | ||
for(var i = 1; i < arguments.length; i++){ | ||
var source = arguments[i]; | ||
for(var key in source){ | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function formatShare(shareArgs, from, name, shareStrategy) { | ||
@@ -709,3 +659,3 @@ let get; | ||
var _shareArgs_version, _shareArgs_scope, _shareArgs_strategy; | ||
return _extends({ | ||
return _$1({ | ||
deps: [], | ||
@@ -716,3 +666,3 @@ useIn: [], | ||
}, shareArgs, { | ||
shareConfig: _extends({ | ||
shareConfig: _$1({ | ||
requiredVersion: `^${shareArgs.version}`, | ||
@@ -743,3 +693,3 @@ singleton: false, | ||
}, {}); | ||
const shared = _extends({}, globalOptions.shared); | ||
const shared = _$1({}, globalOptions.shared); | ||
Object.keys(shareInfos).forEach((shareKey)=>{ | ||
@@ -908,2 +858,2 @@ if (!shared[shareKey]) { | ||
export { getGlobalShareScope as A, addUniqueItem as B, getBuilderId as C, DEFAULT_REMOTE_TYPE as D, setGlobalFederationConstructor as E, getGlobalFederationInstance as F, Global as G, getGlobalFederationConstructor as H, setGlobalFederationInstance as I, registerGlobalPlugins as J, nativeGlobal as K, resetFederationGlobalInfo as L, getTargetSnapshotInfoByModuleInfo as M, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, getRemoteEntryInfoFromSnapshot as l, isBrowserEnv as m, getInfoWithoutType as n, getPreloaded as o, setPreloaded as p, getRegisteredShare as q, arrayOptions as r, safeToString as s, getGlobalSnapshotInfoByModuleInfo as t, addGlobalSnapshot as u, setGlobalSnapshotInfoByModuleInfo as v, warn as w, getGlobalSnapshot as x, formatShareConfigs as y, getTargetSharedOptions as z }; | ||
export { getBuilderId as A, setGlobalFederationConstructor as B, getGlobalFederationInstance as C, DEFAULT_REMOTE_TYPE as D, getGlobalFederationConstructor as E, setGlobalFederationInstance as F, Global as G, registerGlobalPlugins as H, nativeGlobal as I, resetFederationGlobalInfo as J, getTargetSnapshotInfoByModuleInfo as K, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, getRemoteEntryInfoFromSnapshot as l, getInfoWithoutType as m, getPreloaded as n, getRegisteredShare as o, arrayOptions as p, getGlobalSnapshotInfoByModuleInfo as q, addGlobalSnapshot as r, setPreloaded as s, setGlobalSnapshotInfoByModuleInfo as t, getGlobalSnapshot as u, formatShareConfigs as v, warn as w, getTargetSharedOptions as x, getGlobalShareScope as y, addUniqueItem as z }; |
@@ -1,2 +0,2 @@ | ||
import type { ModuleInfo, GlobalModuleInfo } from '@module-federation/sdk'; | ||
import { ModuleInfo, GlobalModuleInfo } from '@module-federation/sdk'; | ||
import { Options, UserOptions, PreloadAssets, PreloadOptions, PreloadRemoteArgs, Remote, RemoteInfo, RemoteEntryExports, CallFrom } from '../type'; | ||
@@ -3,0 +3,0 @@ import { FederationHost } from '../core'; |
@@ -0,4 +1,3 @@ | ||
export { isBrowserEnv, isDebugMode } from '@module-federation/sdk'; | ||
export declare function isDevelopmentMode(): boolean; | ||
export declare function getBuilderId(): string; | ||
export declare function isDebugMode(): boolean; | ||
export declare function isBrowserEnv(): boolean; |
@@ -1,2 +0,2 @@ | ||
import type { RemoteWithEntry, ModuleInfo, RemoteEntryType } from '@module-federation/sdk'; | ||
import { RemoteWithEntry, ModuleInfo, RemoteEntryType } from '@module-federation/sdk'; | ||
import { Remote, RemoteInfoOptionalVersion } from '../type'; | ||
@@ -8,3 +8,2 @@ export declare function addUniqueItem(arr: Array<string>, item: string): Array<string>; | ||
export declare function safeWrapper<T extends (...args: Array<any>) => any>(callback: T, disableWarn?: boolean): Promise<ReturnType<T> | undefined>; | ||
export declare function safeToString(info: any): string; | ||
export declare function isObject(val: any): boolean; | ||
@@ -11,0 +10,0 @@ export declare const objectToString: () => string; |
{ | ||
"name": "@module-federation/runtime", | ||
"version": "0.0.0-next-20240827062238", | ||
"version": "0.0.0-next-20240829065118", | ||
"author": "zhouxiao <codingzx@gmail.com>", | ||
@@ -37,2 +37,7 @@ "main": "./dist/index.cjs.js", | ||
}, | ||
"./embedded": { | ||
"types": "./dist/embedded.cjs.d.ts", | ||
"import": "./dist/embedded.esm.js", | ||
"require": "./dist/embedded.cjs.js" | ||
}, | ||
"./*": "./*" | ||
@@ -57,4 +62,4 @@ }, | ||
"dependencies": { | ||
"@module-federation/sdk": "0.0.0-next-20240827062238" | ||
"@module-federation/sdk": "0.0.0-next-20240829065118" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
60
299725
6856
10
+ Added@module-federation/sdk@0.0.0-next-20240829065118(transitive)
- Removed@module-federation/sdk@0.0.0-next-20240827062238(transitive)