@module-federation/runtime
Advanced tools
Comparing version 0.0.0-next-20241114091142 to 0.0.0-next-20241114094904
@@ -91,2 +91,5 @@ 'use strict'; | ||
} | ||
get bridgeHook() { | ||
return this._getInstance().bridgeHook; | ||
} | ||
initOptions(...args) { | ||
@@ -93,0 +96,0 @@ return this._getInstance().initOptions(...args); |
@@ -92,2 +92,16 @@ 'use strict'; | ||
} | ||
const processModuleAlias = (name, subPath)=>{ | ||
// @host/ ./button -> @host/button | ||
let moduleName; | ||
if (name.endsWith('/')) { | ||
moduleName = name.slice(0, -1); | ||
} else { | ||
moduleName = name; | ||
} | ||
if (subPath.startsWith('.')) { | ||
subPath = subPath.slice(1); | ||
} | ||
moduleName = moduleName + subPath; | ||
return moduleName; | ||
}; | ||
@@ -187,3 +201,3 @@ const CurrentGlobal = typeof globalThis === 'object' ? globalThis : window; | ||
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor; | ||
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.3"; | ||
CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.7.4"; | ||
} | ||
@@ -918,2 +932,3 @@ } | ||
exports.nativeGlobal = nativeGlobal; | ||
exports.processModuleAlias = processModuleAlias; | ||
exports.registerGlobalPlugins = registerGlobalPlugins; | ||
@@ -920,0 +935,0 @@ exports.resetFederationGlobalInfo = resetFederationGlobalInfo; |
@@ -69,2 +69,8 @@ import type { CreateScriptHookReturn, ModuleInfo } from '@module-federation/sdk'; | ||
}>; | ||
bridgeHook: PluginSystem<{ | ||
beforeBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeRender: SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
beforeBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
afterBridgeDestroy: SyncHook<[Record<string, any>], void | Record<string, any>>; | ||
}>; | ||
constructor(userOptions: UserOptions); | ||
@@ -71,0 +77,0 @@ initOptions(userOptions: UserOptions): Options; |
@@ -81,2 +81,8 @@ import type * as IndexModule from './index'; | ||
}>; | ||
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("./type").Options; | ||
@@ -83,0 +89,0 @@ loadShare<T>(...args: Parameters<IndexModule.FederationHost['loadShare']>): Promise<false | (() => T | undefined)>; |
@@ -35,2 +35,7 @@ import { GlobalModuleInfo, Manifest, ModuleInfo } from '@module-federation/sdk'; | ||
}>; | ||
afterLoadSnapshot: AsyncWaterfallHook<{ | ||
options: Options; | ||
moduleInfo: Remote; | ||
remoteSnapshot: ModuleInfo; | ||
}>; | ||
}>; | ||
@@ -37,0 +42,0 @@ loaderHook: FederationHost['loaderHook']; |
@@ -7,3 +7,3 @@ import type { RemoteWithEntry, RemoteWithVersion, Module, RemoteEntryType } from '@module-federation/sdk'; | ||
}; | ||
interface RemoteInfoCommon { | ||
export interface RemoteInfoCommon { | ||
alias?: string; | ||
@@ -10,0 +10,0 @@ shareScope?: string; |
@@ -18,2 +18,6 @@ import { FederationHost } from '../core'; | ||
}>; | ||
type ModuleBridgeLifeCycle = Module['host']['bridgeHook']['lifecycle']; | ||
type ModuleBridgeLifeCycleCyclePartial = Partial<{ | ||
[k in keyof ModuleBridgeLifeCycle]: Parameters<ModuleBridgeLifeCycle[k]['on']>[0]; | ||
}>; | ||
type SharedLifeCycle = SharedHandler['hooks']['lifecycle']; | ||
@@ -27,3 +31,3 @@ type SharedLifeCycleCyclePartial = Partial<{ | ||
}>; | ||
export type FederationRuntimePlugin = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial & { | ||
export type FederationRuntimePlugin = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial & ModuleBridgeLifeCycleCyclePartial & { | ||
name: string; | ||
@@ -30,0 +34,0 @@ version?: string; |
import { FederationHost } from '../core'; | ||
import { UserOptions } from '../type'; | ||
import { Module } from '../module'; | ||
export declare function registerPlugins(plugins: UserOptions['plugins'], hookInstances: Array<FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | FederationHost['sharedHandler']['hooks'] | FederationHost['remoteHandler']['hooks'] | Module['host']['loaderHook']>): import("../type").FederationRuntimePlugin[] | undefined; | ||
export declare function registerPlugins(plugins: UserOptions['plugins'], hookInstances: Array<FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | FederationHost['sharedHandler']['hooks'] | FederationHost['remoteHandler']['hooks'] | Module['host']['loaderHook'] | Module['host']['bridgeHook']>): import("../type").FederationRuntimePlugin[] | undefined; |
@@ -18,1 +18,2 @@ import { RemoteWithEntry, ModuleInfo, RemoteEntryType } from '@module-federation/sdk'; | ||
}; | ||
export declare const processModuleAlias: (name: string, subPath: string) => string; |
{ | ||
"name": "@module-federation/runtime", | ||
"version": "0.0.0-next-20241114091142", | ||
"version": "0.0.0-next-20241114094904", | ||
"author": "zhouxiao <codingzx@gmail.com>", | ||
@@ -53,5 +53,5 @@ "main": "./dist/index.cjs.js", | ||
"dependencies": { | ||
"@module-federation/sdk": "0.0.0-next-20241114091142", | ||
"@module-federation/error-codes": "0.0.0-next-20241114091142" | ||
"@module-federation/sdk": "0.0.0-next-20241114094904", | ||
"@module-federation/error-codes": "0.0.0-next-20241114094904" | ||
} | ||
} |
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
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
326603
7650
+ Added@module-federation/error-codes@0.0.0-next-20241114094904(transitive)
+ Added@module-federation/sdk@0.0.0-next-20241114094904(transitive)
- Removed@module-federation/error-codes@0.0.0-next-20241114091142(transitive)
- Removed@module-federation/sdk@0.0.0-next-20241114091142(transitive)
Updated@module-federation/error-codes@0.0.0-next-20241114094904