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
650
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-20241118095355 to 0.0.0-next-20241118100312

dist/src/utils.d.ts

34

dist/helpers.cjs.js
'use strict';
var share = require('./share.cjs.js');
var polyfills = require('./polyfills.cjs.js');
var runtimeCore = require('@module-federation/runtime-core');
var utils = require('./utils.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
global: polyfills._extends({}, runtimeCore.helpers.global, {
getGlobalFederationInstance: utils.getGlobalFederationInstance
}),
share: runtimeCore.helpers.share
};
module.exports = helpers;

@@ -14,16 +14,2 @@ 'use strict';

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;
}
exports._extends = _extends;
exports._object_without_properties_loose = _object_without_properties_loose;

@@ -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,26 @@

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;
}
import { getGlobalFederationInstance } from './utils';
export type { IGlobalUtils, IShareUtils, } from '@module-federation/runtime-core';
declare const _default: {
global: IGlobalUtils;
share: IShareUtils;
global: {
getGlobalFederationInstance: typeof getGlobalFederationInstance;
Global: typeof import("@module-federation/runtime-core").Global;
nativeGlobal: typeof global;
resetFederationGlobalInfo: typeof import("@module-federation/runtime-core").resetFederationGlobalInfo;
setGlobalFederationInstance: typeof import("@module-federation/runtime-core").setGlobalFederationInstance;
getGlobalFederationConstructor: typeof import("@module-federation/runtime-core").getGlobalFederationConstructor;
setGlobalFederationConstructor: typeof import("@module-federation/runtime-core").setGlobalFederationConstructor;
getInfoWithoutType: typeof import("@module-federation/runtime-core").getInfoWithoutType;
getGlobalSnapshot: typeof import("@module-federation/runtime-core").getGlobalSnapshot;
getTargetSnapshotInfoByModuleInfo: typeof import("packages/runtime-core/dist/src/global").getTargetSnapshotInfoByModuleInfo;
getGlobalSnapshotInfoByModuleInfo: typeof import("packages/runtime-core/dist/src/global").getGlobalSnapshotInfoByModuleInfo;
setGlobalSnapshotInfoByModuleInfo: typeof import("packages/runtime-core/dist/src/global").setGlobalSnapshotInfoByModuleInfo;
addGlobalSnapshot: typeof import("@module-federation/runtime-core").addGlobalSnapshot;
getRemoteEntryExports: typeof import("packages/runtime-core/dist/src/global").getRemoteEntryExports;
registerGlobalPlugins: typeof import("@module-federation/runtime-core").registerGlobalPlugins;
getGlobalHostPlugins: typeof import("packages/runtime-core/dist/src/global").getGlobalHostPlugins;
getPreloaded: typeof import("packages/runtime-core/dist/src/global").getPreloaded;
setPreloaded: typeof import("packages/runtime-core/dist/src/global").setPreloaded;
};
share: import("@module-federation/runtime-core").IShareUtils;
};
export default _default;
export type { IGlobalUtils, IShareUtils };

@@ -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-20241118095355",
"version": "0.0.0-next-20241118100312",
"author": "zhouxiao <codingzx@gmail.com>",

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

"dependencies": {
"@module-federation/sdk": "0.0.0-next-20241118095355",
"@module-federation/error-codes": "0.0.0-next-20241118095355"
"@module-federation/sdk": "0.0.0-next-20241118100312",
"@module-federation/error-codes": "0.0.0-next-20241118100312",
"@module-federation/runtime-core": "0.0.0-next-20241118100312"
}
}

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

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