Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
vue-hot-reload-api
Advanced tools
Readme
Note:
vue-hot-reload-api@2.x
only works withvue@2.x
Hot reload API for Vue components. This is what vue-loader and vueify use under the hood.
You will only be using this if you are writing some build toolchain based on Vue components. For normal application usage, just use vue-loader
or vueify
.
// 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('vue-hot-reload-api')
const Vue = require('vue')
// make the API aware of the Vue that you are using.
// also checks compatibility.
api.install(Vue)
// compatibility can be checked via api.compatible after installation
if (!api.compatible) {
throw new Error('vue-hot-reload-api is not compatible with the version of Vue 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 *.vue components
We found that vue-hot-reload-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.