@gondel/plugin-hot
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -0,0 +0,0 @@ /** |
/** | ||
* Add hot module replacement | ||
*/ | ||
import { findComponents, addGondelPluginEventListener } from "@gondel/core"; | ||
import { findComponents, addGondelPluginEventListener } from '@gondel/core'; | ||
var hotModeActivated = false; | ||
@@ -16,3 +16,3 @@ /** | ||
hotModeActivated = true; | ||
addGondelPluginEventListener("Hot", "register", function (registerComponent, _a, next) { | ||
addGondelPluginEventListener('Hot', 'register', function (registerComponent, _a, next) { | ||
var componentName = _a.componentName, namespace = _a.namespace; | ||
@@ -19,0 +19,0 @@ findComponents(document.documentElement, undefined, namespace) |
{ | ||
"name": "@gondel/plugin-hot", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "Hot module reloading for Gondel component development", | ||
"bugs": "https://github.com/namics/gondel/issues", | ||
"homepage": "https://github.com/namics/gondel", | ||
"repository": "https://github.com/namics/gondel.git", | ||
"bugs": "https://github.com/merkle-open/gondel/issues", | ||
"homepage": "https://github.com/merkle-open/gondel", | ||
"repository": "https://github.com/merkle-open/gondel.git", | ||
"main": "./dist/index.js", | ||
@@ -26,11 +26,11 @@ "module": "./dist/index.js", | ||
"devDependencies": { | ||
"@gondel/core": "^1.2.6", | ||
"@types/webpack-env": "1.15.2", | ||
"@gondel/core": "^1.2.7", | ||
"@types/webpack-env": "1.16.0", | ||
"npm-run-all": "4.1.5", | ||
"react": "16.13.1", | ||
"react-dom": "16.13.1", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"rimraf": "3.0.2", | ||
"typescript": "3.9.5" | ||
"typescript": "4.2.4" | ||
}, | ||
"gitHead": "c311a027df02b754d5f43e7d14cad7c721524dcb" | ||
"gitHead": "5b8501214310055ab61c837a2ba2a2cf9a8a6df5" | ||
} |
@@ -0,0 +0,0 @@ # Hot Loader |
@@ -5,3 +5,3 @@ /** | ||
import { findComponents, addGondelPluginEventListener } from "@gondel/core"; | ||
import { findComponents, addGondelPluginEventListener } from '@gondel/core'; | ||
@@ -14,21 +14,21 @@ let hotModeActivated = false; | ||
export function hot(module: __WebpackModuleApi.Module | NodeModule) { | ||
if (module.hot) { | ||
module.hot.accept(); | ||
if (hotModeActivated) { | ||
return; | ||
} | ||
hotModeActivated = true; | ||
addGondelPluginEventListener("Hot", "register", function ( | ||
registerComponent, | ||
{ componentName, namespace }, | ||
next | ||
) { | ||
findComponents(document.documentElement, undefined, namespace) | ||
.filter((oldComponent) => oldComponent._componentName === componentName) | ||
.forEach((oldComponent) => { | ||
(oldComponent as any).__proto__ = registerComponent.prototype; | ||
}); | ||
next(registerComponent); | ||
}); | ||
} | ||
if (module.hot) { | ||
module.hot.accept(); | ||
if (hotModeActivated) { | ||
return; | ||
} | ||
hotModeActivated = true; | ||
addGondelPluginEventListener( | ||
'Hot', | ||
'register', | ||
function (registerComponent, { componentName, namespace }, next) { | ||
findComponents(document.documentElement, undefined, namespace) | ||
.filter((oldComponent) => oldComponent._componentName === componentName) | ||
.forEach((oldComponent) => { | ||
(oldComponent as any).__proto__ = registerComponent.prototype; | ||
}); | ||
next(registerComponent); | ||
} | ||
); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
5366
7
1