Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@vue/runtime-core
Advanced tools
The @vue/runtime-core package is a part of the Vue.js framework that provides the core runtime components necessary for Vue applications to function. It includes the logic for the virtual DOM, components, reactivity system, and other essential features that enable developers to build interactive user interfaces.
Reactivity System
The reactivity system allows developers to create reactive state objects that automatically update the DOM when the state changes.
{"import { reactive } from '@vue/runtime-core';\nconst state = reactive({ count: 0 });"}
Component Creation
This feature enables developers to define Vue components using the Composition API, which is a function-based approach to creating and managing component state and behavior.
{"import { defineComponent } from '@vue/runtime-core';\nconst MyComponent = defineComponent({\n setup() {\n // Component logic here\n }\n});"}
Custom Renderer API
The Custom Renderer API allows developers to create custom renderers for Vue, enabling the use of Vue's reactivity and component system with different rendering backends, such as canvas or WebGL.
{"import { createRenderer } from '@vue/runtime-core';\nconst { render } = createRenderer({\n patchProp,\n ...otherOptions\n});"}
React is a popular JavaScript library for building user interfaces. It also has a virtual DOM, component-based architecture, and its own reactivity system. React focuses on a declarative programming model and differs from Vue in syntax and the ecosystem of tools and extensions.
Preact is a fast, 3kB alternative to React with the same modern API. It provides a similar component-based architecture and virtual DOM system but aims to be smaller and faster. Preact is often used for performance-critical applications or when a smaller bundle size is needed.
Inferno is another React-like library for building high-performance user interfaces. It is heavily optimized for performance and claims to be one of the fastest JavaScript UI libraries available. Inferno shares some similarities with Vue's reactivity and component system but is more focused on performance.
Svelte is a radical new approach to building user interfaces. Unlike Vue, which updates the DOM in response to state changes, Svelte compiles components to highly optimized imperative code that surgically updates the DOM. This results in faster runtime performance and smaller bundle sizes.
This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
For full exposed APIs, see src/index.ts
.
import { createRenderer } from '@vue/runtime-core'
const { render, createApp } = createRenderer({
patchProp,
insert,
remove,
createElement
// ...
})
// `render` is the low-level API
// `createApp` returns an app instance with configurable context shared
// by the entire app tree.
export { render, createApp }
export * from '@vue/runtime-core'
See @vue/runtime-dom
for how a DOM-targeting renderer is implemented.
3.5.0-alpha.5 (2024-07-31)
FAQs
@vue/runtime-core
The npm package @vue/runtime-core receives a total of 2,668,730 weekly downloads. As such, @vue/runtime-core popularity was classified as popular.
We found that @vue/runtime-core demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.