@module-federation/fmr
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "@module-federation/fmr", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"license": "MIT", | ||
"main": "./src/index.js", | ||
"description": "Hot reloading for Federated Modules", | ||
"keywords": [ | ||
"hmr", | ||
"live reload", | ||
"module federation", | ||
"federated module", | ||
"fmr" | ||
], | ||
"repository": { | ||
"url": "https://github.com/module-federation/FMR-issues/" | ||
}, | ||
"dependencies": { | ||
@@ -7,0 +18,0 @@ "chalk": "^4.1.1", |
@@ -119,6 +119,6 @@ const tcpPortUsed = require("tcp-port-used"); | ||
prepareSocket() { | ||
async prepareSocket(callback) { | ||
// if the socket server has mounted to the port, | ||
// open a connection to it | ||
return tcpPortUsed.waitUntilUsed(40001, "127.0.0.1").then( | ||
await tcpPortUsed.waitUntilUsed(40001, "127.0.0.1").then( | ||
() => { | ||
@@ -143,3 +143,6 @@ this.liveReload = new WebSocket("ws://localhost:40001"); | ||
); | ||
}); | ||
}, | ||
@@ -150,2 +153,5 @@ (err) => { | ||
); | ||
callback() | ||
} | ||
@@ -164,5 +170,5 @@ | ||
// so that we can send afterEmit events to the socket later | ||
compiler.hooks.environment.tap("CreateSocketConnectionPlugin", () => { | ||
compiler.hooks.beforeRun.tapAsync("CreateSocketConnectionPlugin", (params, callback) => { | ||
try { | ||
this.prepareSocket(); | ||
this.prepareSocket(callback); | ||
} catch (e) { | ||
@@ -211,3 +217,3 @@ this.infrastructureLogger && this.infrastructureLogger.error(e); | ||
try { | ||
if (this.liveReload.readyState) { | ||
if (this.liveReload && this.liveReload.readyState) { | ||
this.liveReload.send( | ||
@@ -214,0 +220,0 @@ JSON.stringify({ |
@@ -36,6 +36,6 @@ const chalk = require("chalk"); | ||
let returnObject = { | ||
data: data ?? undefined, | ||
sender: sender ?? "UNKNOWN_SENDER", | ||
type: type ?? "UNKNOWN_TYPE", | ||
timestamp: timestamp ?? undefined, | ||
data: data || undefined, | ||
sender: sender || "UNKNOWN_SENDER", | ||
type: type || "UNKNOWN_TYPE", | ||
timestamp: timestamp || undefined, | ||
}; | ||
@@ -42,0 +42,0 @@ if (!sender) handleNoSender(socket, message); |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
25905
723