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

dist/share.cjs.js

34

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

@@ -14,2 +14,16 @@ '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("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,26 +0,32 @@

import { getGlobalFederationInstance } from './utils';
export type { IGlobalUtils, IShareUtils, } from '@module-federation/runtime-core';
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: {
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;
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-20241118100312",
"version": "0.0.0-next-20241119071808",
"author": "zhouxiao <codingzx@gmail.com>",

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

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

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