Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@module-federation/runtime

Package Overview
Dependencies
Maintainers
8
Versions
681
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/runtime - npm Package Compare versions

Comparing version 0.0.0-next-20241117192957 to 0.0.0-next-20241118060105

dist/src/utils.d.ts

33

dist/helpers.cjs.js
'use strict';
var share = require('./share.cjs.js');
var runtimeCore = require('@module-federation/runtime-core');
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 = helpers;
module.exports = runtimeCore.helpers;

@@ -20,28 +20,28 @@ import type * as IndexModule from './index';

private _getInstance;
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;
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;
origin: IndexModule.FederationHost;
shareInfo: import("./type").ShareInfos;
shareInfo: import("packages/runtime-core/dist/types.cjs").ShareInfos;
}>;
init: import("./utils/hooks").SyncHook<[{
options: import("./type").Options;
init: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{
options: import("packages/runtime-core/dist/types.cjs").Options;
origin: IndexModule.FederationHost;
}], void>;
beforeInitContainer: import("./utils/hooks").AsyncWaterfallHook<{
shareScope: import("./type").ShareScopeMap[string];
initScope: import("./type").InitScope;
remoteEntryInitOptions: import("./type").RemoteEntryInitOptions;
remoteInfo: import("./type").RemoteInfo;
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;
origin: IndexModule.FederationHost;
}>;
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;
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;
origin: IndexModule.FederationHost;

@@ -55,8 +55,8 @@ id: string;

get moduleCache(): Map<string, IndexModule.Module>;
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<[{
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<[{
target: Record<string, any>;

@@ -68,24 +68,24 @@ key: any;

}>;
createScript: import("./utils/hooks").SyncHook<[{
createScript: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{
url: string;
attrs?: Record<string, any>;
}], import("packages/sdk/dist/src").CreateScriptHookReturn>;
createLink: import("./utils/hooks").SyncHook<[{
createLink: import("packages/runtime-core/dist/src/utils/hooks").SyncHook<[{
url: string;
attrs?: Record<string, any>;
}], void | HTMLLinkElement>;
fetch: import("./utils/hooks").AsyncHook<[string, RequestInit], false | void | Promise<Response>>;
getModuleFactory: import("./utils/hooks").AsyncHook<[{
remoteEntryExports: import("./type").RemoteEntryExports;
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;
expose: string;
moduleInfo: import("./type").RemoteInfo;
moduleInfo: import("packages/runtime-core/dist/types.cjs").RemoteInfo;
}], Promise<(() => Promise<IndexModule.Module>) | undefined>>;
}>;
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>>;
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>>;
}>;
initOptions(...args: Parameters<IndexModule.FederationHost['initOptions']>): import("./type").Options;
initOptions(...args: Parameters<IndexModule.FederationHost['initOptions']>): import("packages/runtime-core/dist/types.cjs").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("./type").Options;
formatOptions(...args: Parameters<IndexModule.FederationHost['formatOptions']>): import("packages/runtime-core/dist/types.cjs").Options;
}

@@ -116,13 +116,13 @@ export interface ModuleInterface {

private _getInstance;
get remoteInfo(): import("./type").RemoteInfo;
set remoteInfo(value: import("./type").RemoteInfo);
get remoteInfo(): import("packages/runtime-core/dist/types.cjs").RemoteInfo;
set remoteInfo(value: import("packages/runtime-core/dist/types.cjs").RemoteInfo);
get inited(): boolean;
set inited(value: boolean);
get lib(): import("./type").RemoteEntryExports | undefined;
set lib(value: import("./type").RemoteEntryExports | undefined);
get lib(): import("packages/runtime-core/dist/types.cjs").RemoteEntryExports | undefined;
set lib(value: import("packages/runtime-core/dist/types.cjs").RemoteEntryExports | undefined);
get host(): IndexModule.FederationHost;
set host(value: IndexModule.FederationHost);
getEntry(...args: Parameters<IndexModule.Module['getEntry']>): Promise<import("./type").RemoteEntryExports>;
getEntry(...args: Parameters<IndexModule.Module['getEntry']>): Promise<import("packages/runtime-core/dist/types.cjs").RemoteEntryExports>;
get(...args: Parameters<IndexModule.Module['get']>): Promise<any>;
private wraperFactory;
}

@@ -1,32 +0,3 @@

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 };
import { helpers } from '@module-federation/runtime-core';
export type { IGlobalUtils, IShareUtils, } from '@module-federation/runtime-core';
export default helpers;

@@ -1,10 +0,4 @@

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 };
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 };
export declare function init(options: UserOptions): FederationHost;

@@ -11,0 +5,0 @@ export declare function loadRemote<T>(...args: Parameters<FederationHost['loadRemote']>): Promise<T | null>;

@@ -1,1 +0,1 @@

export * from './type';
export * from '@module-federation/runtime-core/types';
'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-20241117192957",
"version": "0.0.0-next-20241118060105",
"author": "zhouxiao <codingzx@gmail.com>",

@@ -53,5 +53,6 @@ "main": "./dist/index.cjs.js",

"dependencies": {
"@module-federation/sdk": "0.0.0-next-20241117192957",
"@module-federation/error-codes": "0.0.0-next-20241117192957"
"@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"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc