
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
kdu-reload-api
Advanced tools
Note:
kdu-reload-api@2.xonly works withkdu@2.x
Hot reload API for Kdu components. This is what kdu-loader and kdurial use under the hood.
You will only be using this if you are writing some build toolchain based on Kdu components. For normal application usage, just use kdu-loader or kdurial.
// define a component as an options object
const myComponentOptions = {
data () { ... },
created () { ... },
render () { ... }
}
// assuming Webpack's HMR API.
// https://webpack.js.org/guides/hot-module-replacement/
if (module.hot) {
const api = require('kdu-reload-api')
const Kdu = require('kdu')
// make the API aware of the Kdu that you are using.
// also checks compatibility.
api.install(Kdu)
// compatibility can be checked via api.compatible after installation
if (!api.compatible) {
throw new Error('kdu-reload-api is not compatible with the version of Kdu you are using.')
}
// indicate this module can be hot-reloaded
module.hot.accept()
if (!module.hot.data) {
// for each component option object to be hot-reloaded,
// you need to create a record for it with a unique id.
// do this once on startup.
api.createRecord('very-unique-id', myComponentOptions)
} else {
// if a component has only its template or render function changed,
// you can force a re-render for all its active instances without
// destroying/re-creating them. This keeps all current app state intact.
api.rerender('very-unique-id', myComponentOptions)
// --- OR ---
// if a component has non-template/render options changed,
// it needs to be fully reloaded. This will destroy and re-create all its
// active instances (and their children).
api.reload('very-unique-id', myComponentOptions)
}
}
FAQs
hot reload api for *.kdu components
We found that kdu-reload-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.