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

@module-federation/sdk

Package Overview
Dependencies
Maintainers
8
Versions
688
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/sdk - npm Package Compare versions

Comparing version 0.0.0-next-20240205101340 to 0.0.0-next-20240205220829

65

dist/index.cjs.js

@@ -493,7 +493,6 @@ 'use strict';

};
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) {
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type;
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
var prefetchInterface = manifest.metaData.prefetchInterface;
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
prefetchEntry: simpleJoinRemoteEntry(path, name),
prefetchEntryType: type
prefetchInterface: prefetchInterface
});

@@ -761,59 +760,2 @@ }

}
function createLink(url, cb, attrs, createLinkHook) {
// <link rel="preload" href="script.js" as="script">
// Retrieve the existing script element by its src attribute
var link = null;
var needAttach = true;
var links = document.getElementsByTagName("link");
for(var i = 0; i < links.length; i++){
var l = links[i];
var linkHref = l.getAttribute("href");
if (linkHref && isStaticResourcesEqual(linkHref, url)) {
link = l;
needAttach = false;
break;
}
}
if (!link) {
link = document.createElement("link");
link.setAttribute("href", url);
if (createLinkHook) {
var createLinkRes = createLinkHook(url);
if (_instanceof(createLinkRes, HTMLLinkElement)) {
link = createLinkRes;
}
}
}
if (attrs) {
Object.keys(attrs).forEach(function(name) {
if (link) {
link.setAttribute(name, attrs[name]);
}
});
}
var onLinkComplete = function(prev, // eslint-disable-next-line @typescript-eslint/no-explicit-any
event) {
// Prevent memory leaks in IE.
if (link) {
link.onerror = null;
link.onload = null;
safeWrapper(function() {
(link === null || link === void 0 ? void 0 : link.parentNode) && link.parentNode.removeChild(link);
});
if (prev) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var res = prev(event);
cb();
return res;
}
}
cb();
};
link.onerror = onLinkComplete.bind(null, link.onerror);
link.onload = onLinkComplete.bind(null, link.onload);
return {
link: link,
needAttach: needAttach
};
}
function loadScript(url, info) {

@@ -1150,3 +1092,2 @@ var attrs = info.attrs, createScriptHook = info.createScriptHook;

exports.composeKeyWithSeparator = composeKeyWithSeparator;
exports.createLink = createLink;
exports.createScript = createScript;

@@ -1153,0 +1094,0 @@ exports.createScriptNode = createScriptNode;

@@ -489,7 +489,6 @@ function _define_property$2(obj, key, value) {

};
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) {
var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type;
if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
var prefetchInterface = manifest.metaData.prefetchInterface;
basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
prefetchEntry: simpleJoinRemoteEntry(path, name),
prefetchEntryType: type
prefetchInterface: prefetchInterface
});

@@ -757,59 +756,2 @@ }

}
function createLink(url, cb, attrs, createLinkHook) {
// <link rel="preload" href="script.js" as="script">
// Retrieve the existing script element by its src attribute
var link = null;
var needAttach = true;
var links = document.getElementsByTagName("link");
for(var i = 0; i < links.length; i++){
var l = links[i];
var linkHref = l.getAttribute("href");
if (linkHref && isStaticResourcesEqual(linkHref, url)) {
link = l;
needAttach = false;
break;
}
}
if (!link) {
link = document.createElement("link");
link.setAttribute("href", url);
if (createLinkHook) {
var createLinkRes = createLinkHook(url);
if (_instanceof(createLinkRes, HTMLLinkElement)) {
link = createLinkRes;
}
}
}
if (attrs) {
Object.keys(attrs).forEach(function(name) {
if (link) {
link.setAttribute(name, attrs[name]);
}
});
}
var onLinkComplete = function(prev, // eslint-disable-next-line @typescript-eslint/no-explicit-any
event) {
// Prevent memory leaks in IE.
if (link) {
link.onerror = null;
link.onload = null;
safeWrapper(function() {
(link === null || link === void 0 ? void 0 : link.parentNode) && link.parentNode.removeChild(link);
});
if (prev) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var res = prev(event);
cb();
return res;
}
}
cb();
};
link.onerror = onLinkComplete.bind(null, link.onerror);
link.onload = onLinkComplete.bind(null, link.onload);
return {
link: link,
needAttach: needAttach
};
}
function loadScript(url, info) {

@@ -1135,2 +1077,2 @@ var attrs = info.attrs, createScriptHook = info.createScriptHook;

export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, NameTransformMap, NameTransformSymbol, SEPARATOR, assert, composeKeyWithSeparator, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, parseEntry, safeWrapper, simpleJoinRemoteEntry, warn };
export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, NameTransformMap, NameTransformSymbol, SEPARATOR, assert, composeKeyWithSeparator, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, parseEntry, safeWrapper, simpleJoinRemoteEntry, warn };

2

dist/package.json
{
"name": "@module-federation/sdk",
"version": "0.0.11",
"version": "0.0.10",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A sdk for support module federation",

@@ -7,6 +7,2 @@ export declare function safeWrapper<T extends (...args: Array<any>) => any>(callback: T, disableWarn?: boolean): Promise<ReturnType<T> | undefined>;

};
export declare function createLink(url: string, cb: (value: void | PromiseLike<void>) => void, attrs?: Record<string, any>, createLinkHook?: (url: string) => HTMLLinkElement | void): {
link: HTMLLinkElement;
needAttach: boolean;
};
export declare function loadScript(url: string, info: {

@@ -13,0 +9,0 @@ attrs?: Record<string, any>;

@@ -30,4 +30,3 @@ import { RemoteEntryType, StatsAssets } from './stats';

}>;
prefetchEntry?: string;
prefetchEntryType?: RemoteEntryType;
prefetchInterface?: boolean;
}

@@ -34,0 +33,0 @@ interface BasicProviderModuleInfoWithPublicPath extends BasicProviderModuleInfo {

@@ -17,3 +17,3 @@ import type { RemoteWithEntry, RemoteWithVersion } from './common';

remoteEntry: ResourceInfo;
prefetchEntry: ResourceInfo;
prefetchInterface: boolean;
types: Omit<ResourceInfo, 'type'>;

@@ -20,0 +20,0 @@ }

{
"name": "@module-federation/sdk",
"version": "0.0.0-next-20240205101340",
"version": "0.0.0-next-20240205220829",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A sdk for support module federation",

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