Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@vue/runtime-core
Advanced tools
Package description
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.
Changelog
3.4.1 (2023-12-30)
Read this blog post for an overview of the release highlights.
To fully leverage new features in 3.4, it is recommended to also update the following dependencies when upgrading to 3.4:
If using TSX with Vue, check actions needed in Removed: Global JSX Namespace.
Make sure you are no longer using any deprecated features (if you are, you should have warnings in the console telling you so). They may have been removed in 3.4.
once
option to watch (#9034) (a645e7a)using
syntax (#8786) (5b2bd1d)defineModel
support local mutation by default, remove local option (f74785b), closes /github.com/vuejs/rfcs/discussions/503#discussioncomment-7566278__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
feature flag (#9550) (bc7698d)FunctionalComponent
(#8644) (927ab17)AriaAttributes
type (#8909) (fd0b6ba)ObjectPlugin
and FunctionPlugin
types (#8946) (fa4969e), closes #8577DefineProps
type (096ba81)PublicProps
type (#2403) (44135dc)h
with native elements (#9756) (a625376)ComponentInstance
type (#5408) (bfb8565)Starting in 3.4, Vue no longer registers the global JSX
namespace by default. This is necessary to avoid global namespace collision with React so that TSX of both libs can co-exist in the same project. This should not affect SFC-only users with latest version of Volar.
If you are using TSX, there are two options:
Explicitly set jsxImportSource to 'vue'
in tsconfig.json
before upgrading to 3.4. You can also opt-in per file by adding a /* @jsxImportSource vue */
comment at the top of the file.
If you have code that depends on the presence of the global JSX
namespace, e.g. usage of types like JSX.Element
etc., you can retain the exact pre-3.4 global behavior by explicitly referencing vue/jsx
, which registers the global JSX
namespace.
Note that this is a type-only breaking change in a minor release, which adheres to our release policy.
app.config.unwrapInjectedRef
has been removed. It was deprecated and enabled by default in 3.3. In 3.4 it is no longer possible to disable this behavior.@vnodeXXX
event listeners in templates are now a compiler error instead of a deprecation warning. Use @vue:XXX
listeners instead.v-is
directive has been removed. It was deprecated in 3.3. Use the is
attribute with vue:
prefix instead.Readme
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.
FAQs
@vue/runtime-core
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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).