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

@module-federation/dev-kit

Package Overview
Dependencies
Maintainers
8
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/dev-kit - npm Package Compare versions

Comparing version 0.0.0-next-20240326102030 to 0.0.0-next-20240401040901

dist/chunk-6SVIUQNL.mjs

48

dist/forkDevWorker.js
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
var _chunkVMMH576Hjs = require('./chunk-VMMH576H.js');
var _chunkJOW6LDNXjs = require('./chunk-JOW6LDNX.js');

@@ -47,19 +47,25 @@ // packages/dev-kit/src/lib/forkDevWorker.ts

const { mapRemotesToDownload } = _dtskit.retrieveHostConfig.call(void 0, options);
return Object.keys(mapRemotesToDownload).reduce((sum, remoteModuleName) => {
const remoteInfo = mapRemotesToDownload[remoteModuleName];
const name = encodeNameIdentifier ? _sdk.decodeName.call(void 0, remoteInfo.name, encodeNameIdentifier) : remoteInfo.name;
const ip = getIpFromEntry(remoteInfo.url);
if (!ip) {
return Object.keys(mapRemotesToDownload).reduce(
(sum, remoteModuleName) => {
const remoteInfo = mapRemotesToDownload[remoteModuleName];
const name = encodeNameIdentifier ? _sdk.decodeName.call(void 0, remoteInfo.name, encodeNameIdentifier) : remoteInfo.name;
const ip = getIpFromEntry(remoteInfo.url);
if (!ip) {
return sum;
}
sum.push({
name,
entry: remoteInfo.url,
ip
});
return sum;
}
sum.push({
name,
entry: remoteInfo.url,
ip
});
return sum;
}, []);
},
[]
);
}
async function updateCallback(options) {
const { updateMode, name, remoteTypeTarPath } = options;
async function updateCallback({
updateMode,
name,
remoteTypeTarPath
}) {
const { disableHotTypesReload, disableLiveReload } = cacheOptions || {};

@@ -123,3 +129,3 @@ _devserver.fileLog.call(void 0,

moduleServer = new (0, _devserver.ModuleFederationDevServer)({
name: options.name,
name,
remotes: getLocalRemoteNames(host, extraOptions == null ? void 0 : extraOptions.encodeNameIdentifier),

@@ -138,3 +144,3 @@ updateCallback,

if (!cacheOptions.disableLiveReload) {
moduleServer && moduleServer.update({
moduleServer == null ? void 0 : moduleServer.update({
updateKind: _devserver.UpdateKind.RELOAD_PAGE,

@@ -145,7 +151,7 @@ updateMode: _devserver.UpdateMode.POSITIVE

if (!cacheOptions.disableHotTypesReload) {
typesManager && typesManager.updateTypes({
typesManager == null ? void 0 : typesManager.updateTypes({
updateMode: _devserver.UpdateMode.POSITIVE,
remoteName: cacheOptions.name
}).then(() => {
moduleServer && moduleServer.update({
moduleServer == null ? void 0 : moduleServer.update({
updateKind: _devserver.UpdateKind.UPDATE_TYPE,

@@ -174,5 +180,5 @@ updateMode: _devserver.UpdateMode.POSITIVE

});
_chunkVMMH576Hjs.exposeRpc.call(void 0, forkDevWorker);
_chunkJOW6LDNXjs.exposeRpc.call(void 0, forkDevWorker);
exports.forkDevWorker = forkDevWorker;

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

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-VMMH576H.js');
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-JOW6LDNX.js');

@@ -111,6 +111,4 @@ // packages/dev-kit/src/lib/createDevWorker.ts

var _process = require('process'); var process2 = _interopRequireWildcard(_process);
var _crypto = require('crypto');
var FEDERATION_WORKER_DATA_ENV_KEY = "VMOK_WORKER_DATA_ENV";
function uuid() {
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
}
function createRpcWorker(modulePath, data, memoryLimit, once) {

@@ -129,3 +127,3 @@ const options = {

let childProcess, remoteMethod;
const id = uuid();
const id = _crypto.randomUUID.call(void 0, );
const worker = {

@@ -190,10 +188,7 @@ connect(...args) {

}
// moduleFederationConfig.manifest may have un serialization options
removeUnSerializationOptions() {
var _a, _b, _c, _d, _e, _f, _g, _h;
if ((_b = (_a = this._options.remote) == null ? void 0 : _a.moduleFederationConfig) == null ? void 0 : _b.manifest) {
(_d = (_c = this._options.remote) == null ? void 0 : _c.moduleFederationConfig) == null ? true : delete _d.manifest;
}
if ((_f = (_e = this._options.host) == null ? void 0 : _e.moduleFederationConfig) == null ? void 0 : _f.manifest) {
(_h = (_g = this._options.host) == null ? void 0 : _g.moduleFederationConfig) == null ? true : delete _h.manifest;
}
var _a, _b, _c, _d;
(_b = (_a = this._options.host) == null ? void 0 : _a.moduleFederationConfig) == null ? true : delete _b.manifest;
(_d = (_c = this._options.remote) == null ? void 0 : _c.moduleFederationConfig) == null ? true : delete _d.manifest;
}

@@ -204,4 +199,4 @@ get controlledPromise() {

update() {
var _a;
((_a = this._rpcWorker.process) == null ? void 0 : _a.send) && this._rpcWorker.process.send({
var _a, _b;
(_b = (_a = this._rpcWorker.process) == null ? void 0 : _a.send) == null ? void 0 : _b.call(_a, {
type: "mf_call" /* CALL */,

@@ -213,5 +208,4 @@ id: this._rpcWorker.id,

exit() {
if (this._rpcWorker) {
this._rpcWorker.terminate();
}
var _a;
(_a = this._rpcWorker) == null ? void 0 : _a.terminate();
}

@@ -223,6 +217,6 @@ };

try {
const logDir = path2.resolve(process.cwd(), ".vmok/typesGenerate.log");
const logDir = path2.resolve(process.cwd(), ".mf/typesGenerate.log");
await fse.remove(logDir);
} catch (err) {
console.log("removeLogFile error", "forkDevWorker", "error");
console.error("removeLogFile error", "forkDevWorker", err);
}

@@ -232,4 +226,3 @@ }

removeLogFile();
const dtsWorker = new DevWorker({ ...options });
return dtsWorker;
return new DevWorker({ ...options });
}

@@ -236,0 +229,0 @@

{
"name": "@module-federation/dev-kit",
"version": "0.0.0-next-20240326102030",
"version": "0.0.0-next-20240401040901",
"files": [

@@ -29,5 +29,5 @@ "dist/",

"lodash.clonedeepwith": "4.5.0",
"@module-federation/dev-server": "0.0.0-next-20240326102030",
"@module-federation/dts-kit": "0.0.0-next-20240326102030",
"@module-federation/sdk": "0.0.0-next-20240326102030"
"@module-federation/dev-server": "0.0.0-next-20240401040901",
"@module-federation/dts-kit": "0.0.0-next-20240401040901",
"@module-federation/sdk": "0.0.0-next-20240401040901"
},

@@ -34,0 +34,0 @@ "peerDependencies": {

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