Socket
Socket
Sign inDemoInstall

@module-federation/runtime

Package Overview
Dependencies
Maintainers
8
Versions
524
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-20240903063427 to 0.0.0-next-20240903075658

15

dist/helpers.cjs.js
'use strict';
var share = require('./share.cjs.js');
require('@swc/helpers/_/_extends');
require('@swc/helpers/_/_object_without_properties_loose');
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 = {

@@ -30,3 +37,5 @@ getRegisteredShare: share.getRegisteredShare,

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

@@ -33,0 +42,0 @@ var helpers = {

17

dist/helpers.esm.js

@@ -1,6 +0,13 @@

import { o as getRegisteredShare, y as getGlobalShareScope, G as Global, I as nativeGlobal, J as resetFederationGlobalInfo, C as getGlobalFederationInstance, F as setGlobalFederationInstance, E as getGlobalFederationConstructor, B as setGlobalFederationConstructor, m as getInfoWithoutType, u as getGlobalSnapshot, K as getTargetSnapshotInfoByModuleInfo, q as getGlobalSnapshotInfoByModuleInfo, t as setGlobalSnapshotInfoByModuleInfo, r as addGlobalSnapshot, c as getRemoteEntryExports, H as registerGlobalPlugins, g as getGlobalHostPlugins, n as getPreloaded, s as setPreloaded } from './share.esm.js';
import '@swc/helpers/_/_extends';
import '@swc/helpers/_/_object_without_properties_loose';
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';
var pluginHelper = /*#__PURE__*/Object.freeze({
__proto__: null,
SyncHook: SyncHook,
AsyncHook: AsyncHook,
SyncWaterfallHook: SyncWaterfallHook,
AsyncWaterfallHook: AsyncWaterfallHook,
PluginSystem: PluginSystem
});
const ShareUtils = {

@@ -28,3 +35,5 @@ getRegisteredShare,

getPreloaded,
setPreloaded
setPreloaded,
registerPlugins,
pluginHelper
};

@@ -31,0 +40,0 @@ var helpers = {

@@ -37,7 +37,2 @@ {

},
"./embedded": {
"types": "./dist/embedded.cjs.d.ts",
"import": "./dist/embedded.esm.js",
"require": "./dist/embedded.cjs.js"
},
"./*": "./*"

@@ -44,0 +39,0 @@ },

'use strict';
var _extends = require('@swc/helpers/_/_extends');
function _extends() {
_extends = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
const defaultRetries = 3;

@@ -49,3 +61,3 @@ async function fetchWithRetry({ url, options = {}, retryTimes = defaultRetries, fallbackUrl = '' }) {

url,
options: _extends._({}, options, params == null ? void 0 : params.options),
options: _extends({}, options, params == null ? void 0 : params.options),
retryTimes: params == null ? void 0 : params.retryTimes,

@@ -52,0 +64,0 @@ fallbackUrl: params == null ? void 0 : params.fallbackUrl

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

import { _ } from '@swc/helpers/_/_extends';
function _extends() {
_extends = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
const defaultRetries = 3;

@@ -47,3 +59,3 @@ async function fetchWithRetry({ url, options = {}, retryTimes = defaultRetries, fallbackUrl = '' }) {

url,
options: _({}, options, params == null ? void 0 : params.options),
options: _extends({}, options, params == null ? void 0 : params.options),
retryTimes: params == null ? void 0 : params.retryTimes,

@@ -50,0 +62,0 @@ fallbackUrl: params == null ? void 0 : params.fallbackUrl

'use strict';
var _extends = require('@swc/helpers/_/_extends');
var _object_without_properties_loose = require('@swc/helpers/_/_object_without_properties_loose');
var sdk = require('@module-federation/sdk');

@@ -91,3 +89,43 @@

}
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;
};
function _extends$1() {
_extends$1 = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
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;
}
const nativeGlobal = (()=>{

@@ -228,3 +266,3 @@ try {

if ('version' in moduleInfo && moduleInfo['version']) {
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose._(moduleInfo, [
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [
"version"

@@ -247,3 +285,3 @@ ]);

const addGlobalSnapshot = (moduleInfos)=>{
nativeGlobal.__FEDERATION__.moduleInfo = _extends._({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
return ()=>{

@@ -282,5 +320,212 @@ const keys = Object.keys(moduleInfos);

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

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

function _extends() {
_extends = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function formatShare(shareArgs, from, name, shareStrategy) {

@@ -659,3 +918,3 @@ let get;

var _shareArgs_version, _shareArgs_scope, _shareArgs_strategy;
return _extends._({
return _extends({
deps: [],

@@ -666,3 +925,3 @@ useIn: [],

}, shareArgs, {
shareConfig: _extends._({
shareConfig: _extends({
requiredVersion: `^${shareArgs.version}`,

@@ -693,3 +952,3 @@ singleton: false,

}, {});
const shared = _extends._({}, globalOptions.shared);
const shared = _extends({}, globalOptions.shared);
Object.keys(shareInfos).forEach((shareKey)=>{

@@ -858,5 +1117,10 @@ if (!shared[shareKey]) {

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;

@@ -884,8 +1148,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;

@@ -896,2 +1160,1 @@ exports.setGlobalFederationConstructor = setGlobalFederationConstructor;

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

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

import { _ as _$1 } from '@swc/helpers/_/_extends';
import { _ } from '@swc/helpers/_/_object_without_properties_loose';
import { isBrowserEnv, isDebugMode } from '@module-federation/sdk';

@@ -89,3 +87,43 @@

}
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;
};
function _extends$1() {
_extends$1 = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
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;
}
const nativeGlobal = (()=>{

@@ -226,3 +264,3 @@ try {

if ('version' in moduleInfo && moduleInfo['version']) {
const { version } = moduleInfo, resModuleInfo = _(moduleInfo, [
const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [
"version"

@@ -245,3 +283,3 @@ ]);

const addGlobalSnapshot = (moduleInfos)=>{
nativeGlobal.__FEDERATION__.moduleInfo = _$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
return ()=>{

@@ -280,5 +318,212 @@ const keys = Object.keys(moduleInfos);

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

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

function _extends() {
_extends = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function formatShare(shareArgs, from, name, shareStrategy) {

@@ -657,3 +916,3 @@ let get;

var _shareArgs_version, _shareArgs_scope, _shareArgs_strategy;
return _$1({
return _extends({
deps: [],

@@ -664,3 +923,3 @@ useIn: [],

}, shareArgs, {
shareConfig: _$1({
shareConfig: _extends({
requiredVersion: `^${shareArgs.version}`,

@@ -691,3 +950,3 @@ singleton: false,

}, {});
const shared = _$1({}, globalOptions.shared);
const shared = _extends({}, globalOptions.shared);
Object.keys(shareInfos).forEach((shareKey)=>{

@@ -856,2 +1115,2 @@ if (!shared[shareKey]) {

export { getBuilderId as A, setGlobalFederationConstructor as B, getGlobalFederationInstance as C, DEFAULT_REMOTE_TYPE as D, getGlobalFederationConstructor as E, setGlobalFederationInstance as F, Global as G, registerGlobalPlugins as H, nativeGlobal as I, resetFederationGlobalInfo as J, getTargetSnapshotInfoByModuleInfo as K, globalLoading as a, DEFAULT_SCOPE as b, getRemoteEntryExports as c, assert as d, getFMId as e, error as f, getGlobalHostPlugins as g, isPlainObject as h, isObject as i, isRemoteInfoWithEntry as j, isPureRemoteEntry as k, getRemoteEntryInfoFromSnapshot as l, getInfoWithoutType as m, getPreloaded as n, getRegisteredShare as o, arrayOptions as p, getGlobalSnapshotInfoByModuleInfo as q, addGlobalSnapshot as r, setPreloaded as s, setGlobalSnapshotInfoByModuleInfo as t, getGlobalSnapshot as u, formatShareConfigs as v, warn as w, getTargetSharedOptions as x, getGlobalShareScope as y, addUniqueItem 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'];

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

export { isBrowserEnv, isDebugMode } from '@module-federation/sdk';
export declare function isDevelopmentMode(): boolean;
export declare function getBuilderId(): 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;
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-20240903063427",
"version": "0.0.0-next-20240903075658",
"author": "zhouxiao <codingzx@gmail.com>",

@@ -37,7 +37,2 @@ "main": "./dist/index.cjs.js",

},
"./embedded": {
"types": "./dist/embedded.cjs.d.ts",
"import": "./dist/embedded.esm.js",
"require": "./dist/embedded.cjs.js"
},
"./*": "./*"

@@ -62,4 +57,4 @@ },

"dependencies": {
"@module-federation/sdk": "0.0.0-next-20240903063427"
"@module-federation/sdk": "0.0.0-next-20240903075658"
}
}

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