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
625
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-20241010063233 to 0.0.0-next-20241010084324

2

dist/embedded.cjs.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function getRuntime() {

@@ -4,0 +6,0 @@ // @ts-ignore

'use strict';
var share = require('./share.cjs.js');
require('@module-federation/sdk');
require('./polyfills.cjs.js');
require('@module-federation/sdk');
var pluginHelper = /*#__PURE__*/Object.freeze({
__proto__: null,
SyncHook: share.SyncHook,
AsyncHook: share.AsyncHook,
SyncWaterfallHook: share.SyncWaterfallHook,
AsyncWaterfallHook: share.AsyncWaterfallHook,
PluginSystem: share.PluginSystem
});
const ShareUtils = {

@@ -29,3 +38,5 @@ getRegisteredShare: share.getRegisteredShare,

getPreloaded: share.getPreloaded,
setPreloaded: share.setPreloaded
setPreloaded: share.setPreloaded,
registerPlugins: share.registerPlugins,
pluginHelper
};

@@ -32,0 +43,0 @@ var helpers = {

@@ -1,5 +0,14 @@

import { g as getRegisteredShare, a as getGlobalShareScope, G as Global, n as nativeGlobal, r as resetFederationGlobalInfo, b as getGlobalFederationInstance, s as setGlobalFederationInstance, c as getGlobalFederationConstructor, d as setGlobalFederationConstructor, e as getInfoWithoutType, f as getGlobalSnapshot, h as getTargetSnapshotInfoByModuleInfo, i as getGlobalSnapshotInfoByModuleInfo, j as setGlobalSnapshotInfoByModuleInfo, k as addGlobalSnapshot, l as getRemoteEntryExports, m as registerGlobalPlugins, o as getGlobalHostPlugins, p as getPreloaded, q as setPreloaded } from './share.esm.js';
import { y as SyncHook, A as AsyncHook, S as SyncWaterfallHook, r as AsyncWaterfallHook, P as PluginSystem, l as getRegisteredShare, w as getGlobalShareScope, G as Global, J as nativeGlobal, K as resetFederationGlobalInfo, E as getGlobalFederationInstance, H as setGlobalFederationInstance, F as getGlobalFederationConstructor, C as setGlobalFederationConstructor, j as getInfoWithoutType, t as getGlobalSnapshot, L as getTargetSnapshotInfoByModuleInfo, n as getGlobalSnapshotInfoByModuleInfo, q as setGlobalSnapshotInfoByModuleInfo, o as addGlobalSnapshot, b as getRemoteEntryExports, I as registerGlobalPlugins, M as getGlobalHostPlugins, k as getPreloaded, s as setPreloaded, z as registerPlugins } from './share.esm.js';
import '@module-federation/sdk';
import './polyfills.esm.js';
import '@module-federation/sdk';
var pluginHelper = /*#__PURE__*/Object.freeze({
__proto__: null,
SyncHook: SyncHook,
AsyncHook: AsyncHook,
SyncWaterfallHook: SyncWaterfallHook,
AsyncWaterfallHook: AsyncWaterfallHook,
PluginSystem: PluginSystem
});
const ShareUtils = {

@@ -27,3 +36,5 @@ getRegisteredShare,

getPreloaded,
setPreloaded
setPreloaded,
registerPlugins,
pluginHelper
};

@@ -30,0 +41,0 @@ var helpers = {

4

dist/package.json
{
"name": "@module-federation/runtime",
"version": "0.6.9",
"version": "0.6.6",
"author": "zhouxiao <codingzx@gmail.com>",

@@ -55,2 +55,2 @@ "main": "./index.cjs.js",

}
}
}

@@ -25,2 +25,2 @@ function _extends() {

export { _object_without_properties_loose as _, _extends as a };
export { _extends as _, _object_without_properties_loose as a };
'use strict';
var sdk = require('@module-federation/sdk');
var polyfills = require('./polyfills.cjs.js');
var sdk = require('@module-federation/sdk');

@@ -90,2 +90,16 @@ function getBuilderId() {

}
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;
};

@@ -179,3 +193,3 @@ const nativeGlobal = (()=>{

globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.9";
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.6";
}

@@ -280,5 +294,212 @@ }

function registerPlugins(plugins, hookInstances) {
const globalPlugins = getGlobalHostPlugins();
// Incorporate global plugins
if (globalPlugins.length > 0) {
globalPlugins.forEach((plugin)=>{
if (plugins == null ? void 0 : plugins.find((item)=>item.name !== plugin.name)) {
plugins.push(plugin);
}
});
}
if (plugins && plugins.length > 0) {
plugins.forEach((plugin)=>{
hookInstances.forEach((hookInstance)=>{
hookInstance.applyPlugin(plugin);
});
});
}
return plugins;
}
const DEFAULT_SCOPE = 'default';
const DEFAULT_REMOTE_TYPE = 'global';
class SyncHook {
on(fn) {
if (typeof fn === 'function') {
this.listeners.add(fn);
}
}
once(fn) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
this.on(function wrapper(...args) {
self.remove(wrapper);
// eslint-disable-next-line prefer-spread
return fn.apply(null, args);
});
}
emit(...data) {
let result;
if (this.listeners.size > 0) {
// eslint-disable-next-line prefer-spread
this.listeners.forEach((fn)=>{
result = fn(...data);
});
}
return result;
}
remove(fn) {
this.listeners.delete(fn);
}
removeAll() {
this.listeners.clear();
}
constructor(type){
this.type = '';
this.listeners = new Set();
if (type) {
this.type = type;
}
}
}
class AsyncHook extends SyncHook {
emit(...data) {
let result;
const ls = Array.from(this.listeners);
if (ls.length > 0) {
let i = 0;
const call = (prev)=>{
if (prev === false) {
return false; // Abort process
} else if (i < ls.length) {
return Promise.resolve(ls[i++].apply(null, data)).then(call);
} else {
return prev;
}
};
result = call();
}
return Promise.resolve(result);
}
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function checkReturnData(originalData, returnedData) {
if (!isObject(returnedData)) {
return false;
}
if (originalData !== returnedData) {
// eslint-disable-next-line no-restricted-syntax
for(const key in originalData){
if (!(key in returnedData)) {
return false;
}
}
}
return true;
}
class SyncWaterfallHook extends SyncHook {
emit(data) {
if (!isObject(data)) {
error(`The data for the "${this.type}" hook should be an object.`);
}
for (const fn of this.listeners){
try {
const tempData = fn(data);
if (checkReturnData(data, tempData)) {
data = tempData;
} else {
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
break;
}
} catch (e) {
warn(e);
this.onerror(e);
}
}
return data;
}
constructor(type){
super();
this.onerror = error;
this.type = type;
}
}
class AsyncWaterfallHook extends SyncHook {
emit(data) {
if (!isObject(data)) {
error(`The response data for the "${this.type}" hook must be an object.`);
}
const ls = Array.from(this.listeners);
if (ls.length > 0) {
let i = 0;
const processError = (e)=>{
warn(e);
this.onerror(e);
return data;
};
const call = (prevData)=>{
if (checkReturnData(data, prevData)) {
data = prevData;
if (i < ls.length) {
try {
return Promise.resolve(ls[i++](data)).then(call, processError);
} catch (e) {
return processError(e);
}
}
} else {
this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
}
return data;
};
return Promise.resolve(call(data));
}
return Promise.resolve(data);
}
constructor(type){
super();
this.onerror = error;
this.type = type;
}
}
class PluginSystem {
applyPlugin(plugin) {
assert(isPlainObject(plugin), 'Plugin configuration is invalid.');
// The plugin's name is mandatory and must be unique
const pluginName = plugin.name;
assert(pluginName, 'A name must be provided by the plugin.');
if (!this.registerPlugins[pluginName]) {
this.registerPlugins[pluginName] = plugin;
Object.keys(this.lifecycle).forEach((key)=>{
const pluginLife = plugin[key];
if (pluginLife) {
this.lifecycle[key].on(pluginLife);
}
});
}
}
removePlugin(pluginName) {
assert(pluginName, 'A name is required.');
const plugin = this.registerPlugins[pluginName];
assert(plugin, `The plugin "${pluginName}" is not registered.`);
Object.keys(plugin).forEach((key)=>{
if (key !== 'name') {
this.lifecycle[key].remove(plugin[key]);
}
});
}
// eslint-disable-next-line @typescript-eslint/no-shadow
inherit({ lifecycle, registerPlugins }) {
Object.keys(lifecycle).forEach((hookName)=>{
assert(!this.lifecycle[hookName], `The hook "${hookName}" has a conflict and cannot be inherited.`);
this.lifecycle[hookName] = lifecycle[hookName];
});
Object.keys(registerPlugins).forEach((pluginName)=>{
assert(!this.registerPlugins[pluginName], `The plugin "${pluginName}" has a conflict and cannot be inherited.`);
this.applyPlugin(registerPlugins[pluginName]);
});
}
constructor(lifecycle){
this.registerPlugins = {};
this.lifecycle = lifecycle;
this.lifecycleKeys = Object.keys(lifecycle);
}
}
// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts

@@ -324,9 +545,2 @@ // those constants are based on https://www.rubydoc.info/gems/semantic_range/3.0.0/SemanticRange#BUILDIDENTIFIER-constant

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseRegex(source) {

@@ -353,9 +567,2 @@ return new RegExp(source);

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseHyphen(range) {

@@ -587,9 +794,2 @@ return range.replace(parseRegex(hyphenRange), (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease)=>{

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseComparatorString(range) {

@@ -876,5 +1076,10 @@ return pipe(// handle caret

exports.AsyncHook = AsyncHook;
exports.AsyncWaterfallHook = AsyncWaterfallHook;
exports.DEFAULT_REMOTE_TYPE = DEFAULT_REMOTE_TYPE;
exports.DEFAULT_SCOPE = DEFAULT_SCOPE;
exports.Global = Global;
exports.PluginSystem = PluginSystem;
exports.SyncHook = SyncHook;
exports.SyncWaterfallHook = SyncWaterfallHook;
exports.addGlobalSnapshot = addGlobalSnapshot;

@@ -902,8 +1107,8 @@ exports.addUniqueItem = addUniqueItem;

exports.globalLoading = globalLoading;
exports.isObject = isObject;
exports.isPlainObject = isPlainObject;
exports.isPureRemoteEntry = isPureRemoteEntry;
exports.isRemoteInfoWithEntry = isRemoteInfoWithEntry;
exports.nativeGlobal = nativeGlobal;
exports.processModuleAlias = processModuleAlias;
exports.registerGlobalPlugins = registerGlobalPlugins;
exports.registerPlugins = registerPlugins;
exports.resetFederationGlobalInfo = resetFederationGlobalInfo;

@@ -914,2 +1119,1 @@ exports.setGlobalFederationConstructor = setGlobalFederationConstructor;

exports.setPreloaded = setPreloaded;
exports.warn = warn;

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

import { _ as _object_without_properties_loose, a as _extends } from './polyfills.esm.js';
import { isBrowserEnv, isDebugMode } from '@module-federation/sdk';
import { a as _object_without_properties_loose, _ as _extends } from './polyfills.esm.js';

@@ -88,2 +88,16 @@ function getBuilderId() {

}
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;
};

@@ -177,3 +191,3 @@ const nativeGlobal = (()=>{

globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.9";
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.6";
}

@@ -278,5 +292,212 @@ }

function registerPlugins(plugins, hookInstances) {
const globalPlugins = getGlobalHostPlugins();
// Incorporate global plugins
if (globalPlugins.length > 0) {
globalPlugins.forEach((plugin)=>{
if (plugins == null ? void 0 : plugins.find((item)=>item.name !== plugin.name)) {
plugins.push(plugin);
}
});
}
if (plugins && plugins.length > 0) {
plugins.forEach((plugin)=>{
hookInstances.forEach((hookInstance)=>{
hookInstance.applyPlugin(plugin);
});
});
}
return plugins;
}
const DEFAULT_SCOPE = 'default';
const DEFAULT_REMOTE_TYPE = 'global';
class SyncHook {
on(fn) {
if (typeof fn === 'function') {
this.listeners.add(fn);
}
}
once(fn) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
this.on(function wrapper(...args) {
self.remove(wrapper);
// eslint-disable-next-line prefer-spread
return fn.apply(null, args);
});
}
emit(...data) {
let result;
if (this.listeners.size > 0) {
// eslint-disable-next-line prefer-spread
this.listeners.forEach((fn)=>{
result = fn(...data);
});
}
return result;
}
remove(fn) {
this.listeners.delete(fn);
}
removeAll() {
this.listeners.clear();
}
constructor(type){
this.type = '';
this.listeners = new Set();
if (type) {
this.type = type;
}
}
}
class AsyncHook extends SyncHook {
emit(...data) {
let result;
const ls = Array.from(this.listeners);
if (ls.length > 0) {
let i = 0;
const call = (prev)=>{
if (prev === false) {
return false; // Abort process
} else if (i < ls.length) {
return Promise.resolve(ls[i++].apply(null, data)).then(call);
} else {
return prev;
}
};
result = call();
}
return Promise.resolve(result);
}
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function checkReturnData(originalData, returnedData) {
if (!isObject(returnedData)) {
return false;
}
if (originalData !== returnedData) {
// eslint-disable-next-line no-restricted-syntax
for(const key in originalData){
if (!(key in returnedData)) {
return false;
}
}
}
return true;
}
class SyncWaterfallHook extends SyncHook {
emit(data) {
if (!isObject(data)) {
error(`The data for the "${this.type}" hook should be an object.`);
}
for (const fn of this.listeners){
try {
const tempData = fn(data);
if (checkReturnData(data, tempData)) {
data = tempData;
} else {
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
break;
}
} catch (e) {
warn(e);
this.onerror(e);
}
}
return data;
}
constructor(type){
super();
this.onerror = error;
this.type = type;
}
}
class AsyncWaterfallHook extends SyncHook {
emit(data) {
if (!isObject(data)) {
error(`The response data for the "${this.type}" hook must be an object.`);
}
const ls = Array.from(this.listeners);
if (ls.length > 0) {
let i = 0;
const processError = (e)=>{
warn(e);
this.onerror(e);
return data;
};
const call = (prevData)=>{
if (checkReturnData(data, prevData)) {
data = prevData;
if (i < ls.length) {
try {
return Promise.resolve(ls[i++](data)).then(call, processError);
} catch (e) {
return processError(e);
}
}
} else {
this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
}
return data;
};
return Promise.resolve(call(data));
}
return Promise.resolve(data);
}
constructor(type){
super();
this.onerror = error;
this.type = type;
}
}
class PluginSystem {
applyPlugin(plugin) {
assert(isPlainObject(plugin), 'Plugin configuration is invalid.');
// The plugin's name is mandatory and must be unique
const pluginName = plugin.name;
assert(pluginName, 'A name must be provided by the plugin.');
if (!this.registerPlugins[pluginName]) {
this.registerPlugins[pluginName] = plugin;
Object.keys(this.lifecycle).forEach((key)=>{
const pluginLife = plugin[key];
if (pluginLife) {
this.lifecycle[key].on(pluginLife);
}
});
}
}
removePlugin(pluginName) {
assert(pluginName, 'A name is required.');
const plugin = this.registerPlugins[pluginName];
assert(plugin, `The plugin "${pluginName}" is not registered.`);
Object.keys(plugin).forEach((key)=>{
if (key !== 'name') {
this.lifecycle[key].remove(plugin[key]);
}
});
}
// eslint-disable-next-line @typescript-eslint/no-shadow
inherit({ lifecycle, registerPlugins }) {
Object.keys(lifecycle).forEach((hookName)=>{
assert(!this.lifecycle[hookName], `The hook "${hookName}" has a conflict and cannot be inherited.`);
this.lifecycle[hookName] = lifecycle[hookName];
});
Object.keys(registerPlugins).forEach((pluginName)=>{
assert(!this.registerPlugins[pluginName], `The plugin "${pluginName}" has a conflict and cannot be inherited.`);
this.applyPlugin(registerPlugins[pluginName]);
});
}
constructor(lifecycle){
this.registerPlugins = {};
this.lifecycle = lifecycle;
this.lifecycleKeys = Object.keys(lifecycle);
}
}
// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts

@@ -322,9 +543,2 @@ // those constants are based on https://www.rubydoc.info/gems/semantic_range/3.0.0/SemanticRange#BUILDIDENTIFIER-constant

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseRegex(source) {

@@ -351,9 +565,2 @@ return new RegExp(source);

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseHyphen(range) {

@@ -585,9 +792,2 @@ return range.replace(parseRegex(hyphenRange), (_range, from, fromMajor, fromMinor, fromPatch, _fromPreRelease, _fromBuild, to, toMajor, toMinor, toPatch, toPreRelease)=>{

// fork from https://github.com/originjs/vite-plugin-federation/blob/v1.1.12/packages/lib/src/utils/semver/index.ts
// Copyright (c)
// vite-plugin-federation is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
function parseComparatorString(range) {

@@ -874,2 +1074,2 @@ return pipe(// handle caret

export { isPlainObject as A, isRemoteInfoWithEntry as B, isPureRemoteEntry as C, DEFAULT_REMOTE_TYPE as D, getRemoteEntryInfoFromSnapshot as E, arrayOptions as F, Global as G, formatShareConfigs as H, getTargetSharedOptions as I, addUniqueItem as J, getBuilderId as K, getGlobalShareScope as a, getGlobalFederationInstance as b, getGlobalFederationConstructor as c, setGlobalFederationConstructor as d, getInfoWithoutType as e, getGlobalSnapshot as f, getRegisteredShare as g, getTargetSnapshotInfoByModuleInfo as h, getGlobalSnapshotInfoByModuleInfo as i, setGlobalSnapshotInfoByModuleInfo as j, addGlobalSnapshot as k, getRemoteEntryExports as l, registerGlobalPlugins as m, nativeGlobal as n, getGlobalHostPlugins as o, getPreloaded as p, setPreloaded as q, resetFederationGlobalInfo as r, setGlobalFederationInstance as s, globalLoading as t, DEFAULT_SCOPE as u, assert as v, getFMId as w, isObject as x, error as y, warn as z };
export { AsyncHook as A, getBuilderId as B, setGlobalFederationConstructor as C, DEFAULT_REMOTE_TYPE as D, getGlobalFederationInstance as E, getGlobalFederationConstructor as F, Global as G, setGlobalFederationInstance as H, registerGlobalPlugins as I, nativeGlobal as J, resetFederationGlobalInfo as K, getTargetSnapshotInfoByModuleInfo as L, getGlobalHostPlugins as M, PluginSystem as P, SyncWaterfallHook as S, DEFAULT_SCOPE as a, getRemoteEntryExports as b, assert as c, getFMId as d, isPureRemoteEntry as e, getRemoteEntryInfoFromSnapshot as f, globalLoading as g, error as h, isRemoteInfoWithEntry as i, getInfoWithoutType as j, getPreloaded as k, getRegisteredShare as l, arrayOptions as m, getGlobalSnapshotInfoByModuleInfo as n, addGlobalSnapshot as o, processModuleAlias as p, setGlobalSnapshotInfoByModuleInfo as q, AsyncWaterfallHook as r, setPreloaded as s, getGlobalSnapshot as t, formatShareConfigs as u, getTargetSharedOptions as v, getGlobalShareScope as w, addUniqueItem as x, SyncHook as y, registerPlugins as z };
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';
import * as pluginHelper from './utils/hooks';
import { registerPlugins } from './utils';
interface IShareUtils {

@@ -26,2 +28,4 @@ getRegisteredShare: typeof getRegisteredShare;

setPreloaded: typeof setPreloaded;
registerPlugins: typeof registerPlugins;
pluginHelper: typeof pluginHelper;
}

@@ -28,0 +32,0 @@ declare const _default: {

@@ -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'];

@@ -60,3 +60,3 @@ import { ModuleInfo, GlobalModuleInfo } from '@module-federation/sdk';

from: CallFrom;
lifecycle: "onLoad" | "beforeRequest" | "beforeLoadShare";
lifecycle: "onLoad" | "beforeRequest";
origin: FederationHost;

@@ -63,0 +63,0 @@ }], unknown>;

@@ -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;

@@ -26,6 +26,7 @@ import { FederationHost } from '../core';

}>;
export type FederationRuntimePlugin = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial & {
type LifeCycle = CoreLifeCyclePartial & SnapshotLifeCycleCyclePartial & SharedLifeCycleCyclePartial & RemoteLifeCycleCyclePartial & ModuleLifeCycleCyclePartial & {
name: string;
version?: string;
};
export type FederationRuntimePlugin<T = LifeCycle> = LifeCycle & T;
export {};
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;
import { PluginSystem } from './hooks';
export declare function registerPlugins<Y extends Record<string, any>, T extends PluginSystem<Y>>(plugins: UserOptions['plugins'], hookInstances: Array<T | FederationHost['hooks'] | FederationHost['snapshotHandler']['hooks'] | FederationHost['sharedHandler']['hooks'] | FederationHost['remoteHandler']['hooks'] | Module['host']['loaderHook']>): 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-20241010063233",
"version": "0.0.0-next-20241010084324",
"author": "zhouxiao <codingzx@gmail.com>",

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

"dependencies": {
"@module-federation/sdk": "0.0.0-next-20241010063233"
"@module-federation/sdk": "0.0.0-next-20241010084324"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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