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
670
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-20241212123451 to 0.0.0-next-20241213035213

32

dist/index.cjs.js

@@ -425,3 +425,3 @@ 'use strict';

let needAttach = true;
let timeout = 60000;
let timeout = 20000;
let timeoutId;

@@ -474,10 +474,4 @@ const scripts = document.getElementsByTagName('script');

event)=>{
var _info_cb;
clearTimeout(timeoutId);
const onScriptCompleteCallback = ()=>{
if (event.type === 'error') {
(info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(event));
} else {
(info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());
}
};
// Prevent memory leaks in IE.

@@ -494,13 +488,15 @@ if (script) {

if (prev && typeof prev === 'function') {
var _info_cb1;
const result = prev(event);
if (result instanceof Promise) {
var _info_cb2;
const res = await result;
onScriptCompleteCallback();
info == null ? void 0 : (_info_cb2 = info.cb) == null ? void 0 : _info_cb2.call(info);
return res;
}
onScriptCompleteCallback();
info == null ? void 0 : (_info_cb1 = info.cb) == null ? void 0 : _info_cb1.call(info);
return result;
}
}
onScriptCompleteCallback();
info == null ? void 0 : (_info_cb = info.cb) == null ? void 0 : _info_cb.call(info);
};

@@ -554,9 +550,2 @@ script.onerror = onScriptComplete.bind(null, script.onerror);

event)=>{
const onLinkCompleteCallback = ()=>{
if (event.type === 'error') {
(info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(event));
} else {
(info == null ? void 0 : info.cb) && (info == null ? void 0 : info.cb());
}
};
// Prevent memory leaks in IE.

@@ -575,7 +564,7 @@ if (link) {

const res = prev(event);
onLinkCompleteCallback();
info.cb();
return res;
}
}
onLinkCompleteCallback();
info.cb();
};

@@ -591,7 +580,6 @@ link.onerror = onLinkComplete.bind(null, link.onerror);

const { attrs = {}, createScriptHook } = info;
return new Promise((resolve, reject)=>{
return new Promise((resolve, _reject)=>{
const { script, needAttach } = createScript({
url,
cb: resolve,
onErrorCallback: reject,
attrs: polyfills._extends({

@@ -598,0 +586,0 @@ fetchpriority: 'high'

@@ -7,3 +7,2 @@ import { CreateScriptHookDom } from './types';

cb?: (value: void | PromiseLike<void>) => void;
onErrorCallback?: (error: Error) => void;
attrs?: Record<string, any>;

@@ -18,4 +17,3 @@ needDeleteScript?: boolean;

url: string;
cb?: (value: void | PromiseLike<void>) => void;
onErrorCallback?: (error: Error) => void;
cb: (value: void | PromiseLike<void>) => void;
attrs: Record<string, string>;

@@ -22,0 +20,0 @@ needDeleteLink?: boolean;

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

@@ -14,2 +14,7 @@ "description": "A sdk for support module federation",

],
"repository": {
"type": "git",
"url": "https://github.com/module-federation/core/",
"directory": "packages/sdk"
},
"publishConfig": {

@@ -16,0 +21,0 @@ "access": "public"

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