Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@vue/compiler-core

Package Overview
Dependencies
5
Maintainers
2
Versions
209
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vue/compiler-core

@vue/compiler-core


Version published
Maintainers
2
Install size
3.03 MB
Created

Package description

What is @vue/compiler-core?

The @vue/compiler-core package is a lower-level utility for compiling Vue.js templates into render functions. It is part of the Vue.js framework and is used internally by higher-level tools like vue-loader or @vue/compiler-sfc. It provides the core algorithms for parsing template syntax and generating JavaScript code from templates.

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

Parsing Template Syntax

This feature allows you to parse Vue template syntax into an Abstract Syntax Tree (AST). The AST can then be manipulated or compiled into render functions.

import { baseParse } from '@vue/compiler-core';
const ast = baseParse('<div>Hello, {{ world }}</div>');

Compiling AST to Render Functions

This feature takes an AST and compiles it into JavaScript render functions, which can be used to render Vue components.

import { baseCompile } from '@vue/compiler-core';
const { code } = baseCompile('<div>Hello, {{ world }}</div>');

Transforming AST Nodes

This feature allows you to apply custom transformations to AST nodes. In this example, we're changing the content of an interpolation from 'world' to 'universe'.

import { transform } from '@vue/compiler-core';
import { createSimpleExpression } from '@vue/compiler-core';

const ast = baseParse('<div>Hello, {{ world }}</div>');
transform(ast, {
  nodeTransforms: [
    (node) => {
      if (node.type === 5 /* INTERPOLATION */) {
        node.content = createSimpleExpression('universe', false);
      }
    }
  ]
});

Other packages similar to @vue/compiler-core

Changelog

Source

3.4.28 (2024-06-14)

Bug Fixes

  • compat: correctly transform non-identifier expressions in legacy filter syntax (#10896) (07b3c4b), closes #10852
  • compat: ensure proper handling of render fuction from SFC using Vue.extend (#7781) (c73847f), closes #7766
  • compat: only warn ATTR_FALSE_VALUE when enabled (04729ba), closes #11126
  • compile-sfc: register props destructure rest id as setup bindings (#10888) (b2b5f57), closes #10885
  • compile-sfc: Support project reference with folder, (#10908) (bdeac37), closes #10907
  • compiler-core: allow unicode to appear in simple identifiers (#6765) (3ea9644), closes #6367
  • compiler-core: change v-for key type to match Object.keys (#10963) (9fead52), closes #8819
  • compiler-core: emit TS-compatible function declaration when requested (#9363) (5d25850)
  • compiler-core: fix :key shorthand on v-for (#10942) (29425df), closes #10882 #10939
  • compiler-core: make ForIteratorExpression's returns property optional (#11011) (5b8c1af)
  • compiler-core: should set <math> tag as block to retain MathML namespace after patching (#10891) (87c5443)
  • compiler-core: v-for expression missing source with spaces should emit error (#5821) (b9ca202), closes #5819
  • compiler-sfc: improve type resolving for the keyof operator (#10921) (293cf4e), closes #10920 #11002
  • compiler-sfc: support as keyword with template literal types (#11100) (2594b1d), closes #10962
  • compiler-sfc: support type resolve for keyof for intersection & union types (#11132) (495263a), closes #11129
  • compiler-sfc: throw error when import macro as alias (#11041) (34a97ed)
  • correct the type of <details>'s onToggle event handler (#10938) (fd18ce7), closes #10928
  • custom-element: disconnect MutationObserver in nextTick in case that custom elements are moved (#10613) (bbb5be2), closes #10610
  • custom-elements: compatibility of createElement in older versions of Chrome (#9615) (a88295d), closes #9614
  • hmr: avoid infinite recursion when reloading hmr components (#6936) (36bd9b0), closes #6930
  • hydration: log hydration error even when using async components (#9403) (5afc76c), closes #9369
  • KeepAlive: properly cache nested Suspense subtree (#10912) (07764fe)
  • npm: explicitly add @vue/reactivity as dependency of @vue/runtime-dom (#10468) (ec424f6)
  • reactivity: pass oldValue in debug info when triggering refs (#8210) (3b0a56a), closes vuejs/pinia#2061
  • runtime-core: avoid traversing static children for vnodes w/ PatchFlags.BAIL (#11115) (b557d3f), closes #10547
  • runtime-core: do not fire mount/activated hooks if unmounted before mounted (#9370) (aa156ed), closes #8898 #9264 #9617
  • runtime-core: ensure suspense creates dep component's render effect with correct optimized flag (#7689) (c521f95), closes #7688
  • runtime-core: fix missed updates when passing text vnode to <component :is> (#8304) (b310ec3), closes #8298
  • runtime-core: fix stale v-memo after v-if toggle (#6606) (edf2638), closes #6593
  • runtime-core: fix Transition for components with root-level v-if (#7678) (ef2e737), closes #7649
  • runtime-dom: also set attribute for form element state (537a571), closes #6007 #6012
  • runtime-dom: support Symbol for input value bindings (#10608) (188f3ae), closes #10597
  • shared: ensure invokeArrayFns handles undefined arguments (#10869) (9b40d0f), closes #10863
  • ssr: directive binding.instance should respect exposed during ssr (df686ab), closes #7499 #7502
  • ssr: fix hydration for node with empty text node (#7216) (d1011c0)
  • ssr: fix the bug that multi slot scope id does not work on component (#6100) (4c74302), closes #6093
  • teleport: do not throw target warning when teleport is disabled (#9818) (15ee43f)
  • transition: ensure Transition enterHooks are updated after clone (#11066) (671cf29), closes #11061
  • types/apiWatch: correct type inference for reactive array (#11036) (aae2d78), closes #9416
  • types: improve app.provide type checking (#10603) (612bbf0), closes #10602
  • types: support generic argument in setup context expose method (#8507) (635a59b)
  • v-model: fix the lazy modifier is not reset by other modifications (#8547) (a52a02f), closes #8546 #6564 #6773
  • watch: support traversing symbol properties in deep watcher (#10969) (a3e8aaf), closes #402

Readme

Source

@vue/compiler-core

Keywords

FAQs

Last updated on 14 Jun 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