Socket
Socket
Sign inDemoInstall

@vue/compiler-dom

Package Overview
Dependencies
2
Maintainers
1
Versions
210
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/compiler-dom


Version published
Maintainers
1
Install size
3.12 MB
Created

Package description

What is @vue/compiler-dom?

The @vue/compiler-dom package is part of the Vue.js ecosystem, specifically designed for compiling Vue template syntax into render functions directly in the browser or on the server. It is a core utility for Vue's template compilation, enabling developers to pre-compile templates or compile them on the fly, optimizing performance and enhancing the development experience with Vue.js applications.

What are @vue/compiler-dom's main functionalities?

Compiling Template Strings

This feature allows developers to compile Vue template strings into render functions. The compiled code can then be used to render Vue components dynamically. This is particularly useful for applications that need to compile templates on the fly, such as those that receive template code from a server.

import { compile } from '@vue/compiler-dom';
const { code } = compile('<div>{{ message }}</div>');
console.log(code);

Parsing Template Options

The package provides functionality to parse template strings into Abstract Syntax Trees (ASTs). This is useful for tools and libraries that need to analyze or manipulate Vue templates at a syntactic level, enabling advanced use cases like static analysis, linting, and custom transformations.

import { parse, baseParse } from '@vue/compiler-dom';
const ast = baseParse('<div>{{ message }}</div>');
console.log(ast);

Transforming AST Nodes

After parsing a template into an AST, @vue/compiler-dom allows developers to apply transformations to the AST nodes. This feature is powerful for creating custom directives or modifying the behavior of existing ones, enabling a high degree of customization and optimization for Vue applications.

import { transform } from '@vue/compiler-dom';
transform(ast, {
  nodeTransforms: [/* array of node transform functions */]
});

Other packages similar to @vue/compiler-dom

Changelog

Source

3.3.9 (2023-11-25)

Bug Fixes

  • compiler-core: avoid rewriting scope variables in inline for loops (#7245) (a2d810e), closes #7238
  • compiler-core: fix resolveParserPlugins decorators check (#9566) (9d0eba9), closes #9560
  • compiler-sfc: consistently escape type-only prop names (#8654) (3e08d24), closes #8635 #8910 vitejs/vite-plugin-vue#184
  • compiler-sfc: malformed filename on windows using path.posix.join() (#9478) (f18a174), closes #8671 #9583 #9446 #9473
  • compiler-sfc: support :is and :where selector in scoped css rewrite (#8929) (3227e50)
  • compiler-sfc: support resolve extends interface for defineEmits (#8470) (9e1b74b), closes #8465
  • hmr/transition: fix kept-alive component inside transition disappearing after hmr (#7126) (d11e978), closes #7121
  • hydration: force hydration for v-bind with .prop modifier (364f319), closes #7490
  • hydration: properly hydrate indeterminate prop (34b5a5d), closes #7476
  • reactivity: clear method on readonly collections should return undefined (#7316) (657476d)
  • reactivity: onCleanup also needs to be cleaned (#8655) (73fd810), closes #5151 #7695
  • ssr: hydration __vnode missing for devtools (#9328) (5156ac5)
  • types: allow falsy value types in StyleValue (#7954) (17aa92b), closes #7955
  • types: defineCustomElement using defineComponent return type with emits (#7937) (5d932a8), closes #7782
  • types: fix unref and toValue when input union type contains ComputedRef (#8748) (176d476), closes #8747 #8857
  • types: fix instance type when props type is incompatible with setup returned type (#7338) (0e1e8f9), closes #5885
  • types: fix shallowRef return type with union value type (#7853) (7c44800), closes #7852
  • types: more precise types for class bindings (#8012) (46e3374)
  • types: remove optional properties from defineProps return type (#6421) (94c049d), closes #6420
  • types: return type of withDefaults should be readonly (#8601) (f15debc)
  • types: revert class type restrictions (5d077c8), closes #8012
  • types: update jsx type definitions (#8607) (58e2a94)
  • types: widen ClassValue type (2424013)
  • v-model: avoid overwriting number input with same value (#7004) (40f4b77), closes #7003
  • v-model: unnecessary value binding error should apply to dynamic instead of static binding (2859b65), closes #3596

Readme

Source

@vue/compiler-dom

Keywords

FAQs

Last updated on 25 Nov 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc