@module-federation/runtime
Advanced tools
Comparing version 0.0.0-next-20241118060105 to 0.0.0-next-20241118091452
'use strict'; | ||
var runtimeCore = require('@module-federation/runtime-core'); | ||
var share = require('./share.cjs.js'); | ||
const ShareUtils = { | ||
getRegisteredShare: share.getRegisteredShare, | ||
getGlobalShareScope: share.getGlobalShareScope | ||
}; | ||
const GlobalUtils = { | ||
Global: share.Global, | ||
nativeGlobal: share.nativeGlobal, | ||
resetFederationGlobalInfo: share.resetFederationGlobalInfo, | ||
getGlobalFederationInstance: share.getGlobalFederationInstance, | ||
setGlobalFederationInstance: share.setGlobalFederationInstance, | ||
getGlobalFederationConstructor: share.getGlobalFederationConstructor, | ||
setGlobalFederationConstructor: share.setGlobalFederationConstructor, | ||
getInfoWithoutType: share.getInfoWithoutType, | ||
getGlobalSnapshot: share.getGlobalSnapshot, | ||
getTargetSnapshotInfoByModuleInfo: share.getTargetSnapshotInfoByModuleInfo, | ||
getGlobalSnapshotInfoByModuleInfo: share.getGlobalSnapshotInfoByModuleInfo, | ||
setGlobalSnapshotInfoByModuleInfo: share.setGlobalSnapshotInfoByModuleInfo, | ||
addGlobalSnapshot: share.addGlobalSnapshot, | ||
getRemoteEntryExports: share.getRemoteEntryExports, | ||
registerGlobalPlugins: share.registerGlobalPlugins, | ||
getGlobalHostPlugins: share.getGlobalHostPlugins, | ||
getPreloaded: share.getPreloaded, | ||
setPreloaded: share.setPreloaded | ||
}; | ||
var helpers = { | ||
global: GlobalUtils, | ||
share: ShareUtils | ||
}; | ||
module.exports = runtimeCore.helpers; | ||
module.exports = helpers; |
@@ -20,28 +20,28 @@ import type * as IndexModule from './index'; | ||
private _getInstance; | ||
get options(): import("packages/runtime-core/dist/types.cjs").Options; | ||
set options(value: import("packages/runtime-core/dist/types.cjs").Options); | ||
get hooks(): import("packages/runtime-core/dist/src/utils/hooks").PluginSystem<{ | ||
beforeInit: import("packages/runtime-core/dist/src/utils/hooks").SyncWaterfallHook<{ | ||
userOptions: import("packages/runtime-core/dist/src").UserOptions; | ||
options: import("packages/runtime-core/dist/types.cjs").Options; | ||
get options(): import("./type").Options; | ||
set options(value: import("./type").Options); | ||
get hooks(): import("./utils/hooks").PluginSystem<{ | ||
beforeInit: import("./utils/hooks").SyncWaterfallHook<{ | ||
userOptions: import("./type").UserOptions; | ||
options: import("./type").Options; | ||
origin: IndexModule.FederationHost; | ||
shareInfo: import("packages/runtime-core/dist/types.cjs").ShareInfos; | ||
shareInfo: import("./type").ShareInfos; | ||
}>; | ||
init: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{ | ||
options: import("packages/runtime-core/dist/types.cjs").Options; | ||
init: import("./utils/hooks").SyncHook<[{ | ||
options: import("./type").Options; | ||
origin: IndexModule.FederationHost; | ||
}], void>; | ||
beforeInitContainer: import("packages/runtime-core/dist/src/utils/hooks").AsyncWaterfallHook<{ | ||
shareScope: import("packages/runtime-core/dist/types.cjs").ShareScopeMap[string]; | ||
initScope: import("packages/runtime-core/dist/types.cjs").InitScope; | ||
remoteEntryInitOptions: import("packages/runtime-core/dist/types.cjs").RemoteEntryInitOptions; | ||
remoteInfo: import("packages/runtime-core/dist/types.cjs").RemoteInfo; | ||
beforeInitContainer: import("./utils/hooks").AsyncWaterfallHook<{ | ||
shareScope: import("./type").ShareScopeMap[string]; | ||
initScope: import("./type").InitScope; | ||
remoteEntryInitOptions: import("./type").RemoteEntryInitOptions; | ||
remoteInfo: import("./type").RemoteInfo; | ||
origin: IndexModule.FederationHost; | ||
}>; | ||
initContainer: import("packages/runtime-core/dist/src/utils/hooks").AsyncWaterfallHook<{ | ||
shareScope: import("packages/runtime-core/dist/types.cjs").ShareScopeMap[string]; | ||
initScope: import("packages/runtime-core/dist/types.cjs").InitScope; | ||
remoteEntryInitOptions: import("packages/runtime-core/dist/types.cjs").RemoteEntryInitOptions; | ||
remoteInfo: import("packages/runtime-core/dist/types.cjs").RemoteInfo; | ||
remoteEntryExports: import("packages/runtime-core/dist/types.cjs").RemoteEntryExports; | ||
initContainer: import("./utils/hooks").AsyncWaterfallHook<{ | ||
shareScope: import("./type").ShareScopeMap[string]; | ||
initScope: import("./type").InitScope; | ||
remoteEntryInitOptions: import("./type").RemoteEntryInitOptions; | ||
remoteInfo: import("./type").RemoteInfo; | ||
remoteEntryExports: import("./type").RemoteEntryExports; | ||
origin: IndexModule.FederationHost; | ||
@@ -55,8 +55,8 @@ id: string; | ||
get moduleCache(): Map<string, IndexModule.Module>; | ||
get snapshotHandler(): import("packages/runtime-core/dist/src/plugins/snapshot/SnapshotHandler").SnapshotHandler; | ||
get sharedHandler(): import("packages/runtime-core/dist/src/shared").SharedHandler; | ||
get remoteHandler(): import("packages/runtime-core/dist/src/remote").RemoteHandler; | ||
get shareScopeMap(): import("packages/runtime-core/dist/types.cjs").ShareScopeMap; | ||
get loaderHook(): import("packages/runtime-core/dist/src/utils/hooks").PluginSystem<{ | ||
getModuleInfo: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{ | ||
get snapshotHandler(): import("./plugins/snapshot/SnapshotHandler").SnapshotHandler; | ||
get sharedHandler(): import("./shared").SharedHandler; | ||
get remoteHandler(): import("./remote").RemoteHandler; | ||
get shareScopeMap(): import("./type").ShareScopeMap; | ||
get loaderHook(): import("./utils/hooks").PluginSystem<{ | ||
getModuleInfo: import("./utils/hooks").SyncHook<[{ | ||
target: Record<string, any>; | ||
@@ -68,24 +68,24 @@ key: any; | ||
}>; | ||
createScript: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{ | ||
createScript: import("./utils/hooks").SyncHook<[{ | ||
url: string; | ||
attrs?: Record<string, any>; | ||
}], import("packages/sdk/dist/src").CreateScriptHookReturn>; | ||
createLink: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{ | ||
createLink: import("./utils/hooks").SyncHook<[{ | ||
url: string; | ||
attrs?: Record<string, any>; | ||
}], void | HTMLLinkElement>; | ||
fetch: import("packages/runtime-core/dist/src/utils/hooks").AsyncHook<[string, RequestInit], false | void | Promise<Response>>; | ||
getModuleFactory: import("packages/runtime-core/dist/src/utils/hooks").AsyncHook<[{ | ||
remoteEntryExports: import("packages/runtime-core/dist/types.cjs").RemoteEntryExports; | ||
fetch: import("./utils/hooks").AsyncHook<[string, RequestInit], false | void | Promise<Response>>; | ||
getModuleFactory: import("./utils/hooks").AsyncHook<[{ | ||
remoteEntryExports: import("./type").RemoteEntryExports; | ||
expose: string; | ||
moduleInfo: import("packages/runtime-core/dist/types.cjs").RemoteInfo; | ||
moduleInfo: import("./type").RemoteInfo; | ||
}], Promise<(() => Promise<IndexModule.Module>) | undefined>>; | ||
}>; | ||
get bridgeHook(): import("packages/runtime-core/dist/src/utils/hooks").PluginSystem<{ | ||
beforeBridgeRender: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeRender: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
beforeBridgeDestroy: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeDestroy: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
get bridgeHook(): import("./utils/hooks").PluginSystem<{ | ||
beforeBridgeRender: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeRender: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
beforeBridgeDestroy: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeDestroy: import("./utils/hooks").SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
}>; | ||
initOptions(...args: Parameters<IndexModule.FederationHost['initOptions']>): import("packages/runtime-core/dist/types.cjs").Options; | ||
initOptions(...args: Parameters<IndexModule.FederationHost['initOptions']>): import("./type").Options; | ||
loadShare<T>(...args: Parameters<IndexModule.FederationHost['loadShare']>): Promise<false | (() => T | undefined)>; | ||
@@ -100,3 +100,3 @@ loadShareSync<T>(...args: Parameters<IndexModule.FederationHost['loadShareSync']>): () => T | never; | ||
registerRemotes(...args: Parameters<IndexModule.FederationHost['registerRemotes']>): void; | ||
formatOptions(...args: Parameters<IndexModule.FederationHost['formatOptions']>): import("packages/runtime-core/dist/types.cjs").Options; | ||
formatOptions(...args: Parameters<IndexModule.FederationHost['formatOptions']>): import("./type").Options; | ||
} | ||
@@ -116,13 +116,13 @@ export interface ModuleInterface { | ||
private _getInstance; | ||
get remoteInfo(): import("packages/runtime-core/dist/types.cjs").RemoteInfo; | ||
set remoteInfo(value: import("packages/runtime-core/dist/types.cjs").RemoteInfo); | ||
get remoteInfo(): import("./type").RemoteInfo; | ||
set remoteInfo(value: import("./type").RemoteInfo); | ||
get inited(): boolean; | ||
set inited(value: boolean); | ||
get lib(): import("packages/runtime-core/dist/types.cjs").RemoteEntryExports | undefined; | ||
set lib(value: import("packages/runtime-core/dist/types.cjs").RemoteEntryExports | undefined); | ||
get lib(): import("./type").RemoteEntryExports | undefined; | ||
set lib(value: import("./type").RemoteEntryExports | undefined); | ||
get host(): IndexModule.FederationHost; | ||
set host(value: IndexModule.FederationHost); | ||
getEntry(...args: Parameters<IndexModule.Module['getEntry']>): Promise<import("packages/runtime-core/dist/types.cjs").RemoteEntryExports>; | ||
getEntry(...args: Parameters<IndexModule.Module['getEntry']>): Promise<import("./type").RemoteEntryExports>; | ||
get(...args: Parameters<IndexModule.Module['get']>): Promise<any>; | ||
private wraperFactory; | ||
} |
@@ -1,3 +0,32 @@ | ||
import { helpers } from '@module-federation/runtime-core'; | ||
export type { IGlobalUtils, IShareUtils, } from '@module-federation/runtime-core'; | ||
export default helpers; | ||
import { resetFederationGlobalInfo, getGlobalFederationInstance, setGlobalFederationInstance, getGlobalFederationConstructor, setGlobalFederationConstructor, getInfoWithoutType, getGlobalSnapshot, getTargetSnapshotInfoByModuleInfo, getGlobalSnapshotInfoByModuleInfo, setGlobalSnapshotInfoByModuleInfo, addGlobalSnapshot, getRemoteEntryExports, registerGlobalPlugins, getGlobalHostPlugins, getPreloaded, setPreloaded, Global } from './global'; | ||
import { getRegisteredShare, getGlobalShareScope } from './utils/share'; | ||
interface IShareUtils { | ||
getRegisteredShare: typeof getRegisteredShare; | ||
getGlobalShareScope: typeof getGlobalShareScope; | ||
} | ||
interface IGlobalUtils { | ||
Global: typeof Global; | ||
nativeGlobal: typeof global; | ||
resetFederationGlobalInfo: typeof resetFederationGlobalInfo; | ||
getGlobalFederationInstance: typeof getGlobalFederationInstance; | ||
setGlobalFederationInstance: typeof setGlobalFederationInstance; | ||
getGlobalFederationConstructor: typeof getGlobalFederationConstructor; | ||
setGlobalFederationConstructor: typeof setGlobalFederationConstructor; | ||
getInfoWithoutType: typeof getInfoWithoutType; | ||
getGlobalSnapshot: typeof getGlobalSnapshot; | ||
getTargetSnapshotInfoByModuleInfo: typeof getTargetSnapshotInfoByModuleInfo; | ||
getGlobalSnapshotInfoByModuleInfo: typeof getGlobalSnapshotInfoByModuleInfo; | ||
setGlobalSnapshotInfoByModuleInfo: typeof setGlobalSnapshotInfoByModuleInfo; | ||
addGlobalSnapshot: typeof addGlobalSnapshot; | ||
getRemoteEntryExports: typeof getRemoteEntryExports; | ||
registerGlobalPlugins: typeof registerGlobalPlugins; | ||
getGlobalHostPlugins: typeof getGlobalHostPlugins; | ||
getPreloaded: typeof getPreloaded; | ||
setPreloaded: typeof setPreloaded; | ||
} | ||
declare const _default: { | ||
global: IGlobalUtils; | ||
share: IShareUtils; | ||
}; | ||
export default _default; | ||
export type { IGlobalUtils, IShareUtils }; |
@@ -1,4 +0,10 @@ | ||
import { FederationHost, type UserOptions } from '@module-federation/runtime-core'; | ||
export { loadScript, loadScriptNode, Module, getRemoteEntry, getRemoteInfo, registerGlobalPlugins, type FederationRuntimePlugin, } from '@module-federation/runtime-core'; | ||
export { FederationHost }; | ||
import { FederationHost } from './core'; | ||
import { UserOptions, FederationRuntimePlugin } from './type'; | ||
export { FederationHost } from './core'; | ||
export { registerGlobalPlugins } from './global'; | ||
export { getRemoteEntry, getRemoteInfo } from './utils'; | ||
export { loadScript, loadScriptNode } from '@module-federation/sdk'; | ||
export { Module } from './module'; | ||
export type { Federation } from './global'; | ||
export type { FederationRuntimePlugin }; | ||
export declare function init(options: UserOptions): FederationHost; | ||
@@ -5,0 +11,0 @@ export declare function loadRemote<T>(...args: Parameters<FederationHost['loadRemote']>): Promise<T | null>; |
@@ -1,1 +0,1 @@ | ||
export * from '@module-federation/runtime-core/types'; | ||
export * from './type'; |
'use strict'; | ||
var types = require('@module-federation/runtime-core/types'); | ||
Object.keys(types).forEach(function (k) { | ||
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { | ||
enumerable: true, | ||
get: function () { return types[k]; } | ||
}); | ||
}); |
{ | ||
"name": "@module-federation/runtime", | ||
"version": "0.0.0-next-20241118060105", | ||
"version": "0.0.0-next-20241118091452", | ||
"author": "zhouxiao <codingzx@gmail.com>", | ||
@@ -53,6 +53,5 @@ "main": "./dist/index.cjs.js", | ||
"dependencies": { | ||
"@module-federation/sdk": "0.0.0-next-20241118060105", | ||
"@module-federation/error-codes": "0.0.0-next-20241118060105", | ||
"@module-federation/runtime-core": "0.0.0-next-20241118060105" | ||
"@module-federation/sdk": "0.0.0-next-20241118091452", | ||
"@module-federation/error-codes": "0.0.0-next-20241118091452" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
326603
2
61
7650
5
+ Added@module-federation/error-codes@0.0.0-next-20241118091452(transitive)
+ Added@module-federation/sdk@0.0.0-next-20241118091452(transitive)
- Removed@module-federation/runtime-core@0.0.0-next-20241118060105
- Removed@module-federation/error-codes@0.0.0-next-20241118060105(transitive)
- Removed@module-federation/runtime-core@0.0.0-next-20241118060105(transitive)
- Removed@module-federation/sdk@0.0.0-next-20241118060105(transitive)
Updated@module-federation/error-codes@0.0.0-next-20241118091452