Socket
Socket
Sign inDemoInstall

@vue/compiler-dom

Package Overview
Dependencies
6
Maintainers
2
Versions
206
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vue/compiler-dom

@vue/compiler-dom


Version published
Weekly downloads
4.3M
decreased by-17.57%
Maintainers
2
Install size
3.61 MB
Created
Weekly downloads
 

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.4.22 (2024-04-15)

Bug Fixes

  • compat: fix $options mutation + adjust private API initialization (d58d133), closes #10626 #10636
  • compile-sfc: analyze v-bind shorthand usage in template (#10518) (e5919d4), closes #10515
  • compiler-core: fix loc.source for end tags with whitespace before > (16174da), closes #10694 #10695
  • compiler-core: fix v-bind shorthand for component :is (04af950), closes #10469 #10471
  • compiler-sfc: :is() and :where() in compound selectors (#10522) (660cadc), closes #10511
  • compiler-sfc: also search for .tsx when type import's extension is omitted (#10637) (34106bc), closes #10635
  • compiler-sfc: fix defineModel coercion for boolean + string union types (#9603) (0cef65c), closes #9587 #10676
  • compiler-sfc: fix universal selector scope (#10551) (54a6afa), closes #10548
  • compiler-sfc: use options module name if options provide runtimeModuleName options (#10457) (e76d743), closes #10454
  • custom-element: avoid setting attr to null if it is removed (#9012) (b49306a), closes #9006 #10324
  • hydration: properly handle optimized mode during hydrate node (#10638) (2ec06fd), closes #10607
  • reactivity: computed should not be detected as true by isProxy (#10401) (9da34d7)
  • reactivity: fix hasOwnProperty key coercion edge cases (969c5fb)
  • reactivity: fix tracking when hasOwnProperty is called with non-string value (c3c5dc9), closes #10455 #10464
  • runtime-core: fix errorHandler causes an infinite loop during execution (#9575) (ab59bed)
  • runtime-core: handle invalid values in callWithAsyncErrorHandling (53d15d3)
  • runtime-core: show hydration mismatch details for non-rectified mismatches too when PROD_HYDRATION_MISMATCH_DETAILS is set (#10599) (0dea7f9)
  • runtime-dom: v-model string/number coercion for multiselect options (#10576) (db374e5)
  • runtime-dom: fix css v-bind for suspensed components (#8523) (67722ba), closes #8520
  • runtime-dom: force update v-model number with leading 0 (#10506) (15ffe8f), closes #10503 #10615
  • runtime-dom: sanitize wrongly passed string value as event handler (#8953) (7ccd453), closes #8818
  • ssr: don't render v-if comments in TransitionGroup (#6732) (5a96267), closes #6715
  • Transition: ensure the KeepAlive children unmount w/ out-in mode (#10632) (fc99e4d), closes #10620
  • TransitionGroup: avoid set transition hooks for comment nodes and text nodes (#9421) (140a768), closes #4621 #4622 #5153 #5168 #7898 #9067
  • types: avoid merging object union types when using withDefaults (#10596) (37ba93c), closes #10594

Performance Improvements

  • add __NO_SIDE_EFFECTS__ comments (#9053) (d46df6b)
  • optimize component props/slots internal object checks (6af733d)
  • ssr: avoid calling markRaw on component instance proxy (4bc9f39)
  • ssr: optimize setup context creation for ssr in v8 (ca84316)

Readme

Source

@vue/compiler-dom

Keywords

FAQs

Last updated on 15 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc