Socket
Socket
Sign inDemoInstall

@vue/language-core

Package Overview
Dependencies
7
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/language-core


Version published
Weekly downloads
1.2M
decreased by-17.18%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @vue/language-core?

The @vue/language-core package is designed to provide core functionalities for handling Vue.js component files (.vue files) in development tools. It offers APIs for parsing, analyzing, and manipulating Vue component code, making it easier for developers to create or enhance development tools such as IDEs, linters, and compilers that work with Vue.js projects.

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

Parsing Vue Files

This feature allows the parsing of Vue component files, breaking down the structure into an understandable format for further processing. The code sample demonstrates how to parse a simple Vue file to access its descriptor.

import { parse } from '@vue/language-core';
const { descriptor } = parse('<template><div>Hello World</div></template>');

Analyzing Script Setup

Analyzes the script setup block of a Vue component, providing insights such as defined props. The code sample shows how to analyze a script setup block after parsing a Vue file.

import { parse, analyzeScriptSetup } from '@vue/language-core';
const { descriptor } = parse('<script setup>defineProps()</script>');
const analysis = analyzeScriptSetup(descriptor);

Transforming Vue Components

Enables the transformation of Vue component code based on specified options, which can be used for code optimization or to apply custom modifications. The code sample illustrates transforming a parsed Vue component.

import { parse, transform } from '@vue/language-core';
const { descriptor } = parse('<template><div>{{ msg }}</div></template>');
const transformed = transform(descriptor, { /* transformation options */ });

Other packages similar to @vue/language-core

Changelog

Source

2.0.20 (2024-06-08)

Features

  • feat(language-service): add localization support for zh-hk/zh-tw
  • feat(vscode): enable syntax highlighting of cue code blocks in MDX (#4425) - Thanks @remcohaszing

Bug Fixes

  • fix(vscode): fix "as"/"instanceof" expressions syntax highlight (#4412)
  • fix(language-core): ForIteratorExpression's returns property may be undefined (#4418) - Thanks @so1ve
  • fix(language-core): use defineEmits calls instead of type infer (#4430) - Thanks @zhiyuanzmj
  • fix(tsc): log catched errors to console (#4451) - Thanks @mik3ybark3r
  • fix(typescript-plugin): TS not working in template when tsconfig missing (#4452)
  • fix(language-core): use type infer instead of await import (#4436) - Thanks @zhiyuanzmj
  • feat(language-core): ignore type error for new functional component (#4445) - Thanks @zhiyuanzmj
  • fix(language-core): ignore type error for possible component name (#4446) - Thanks @zhiyuanzmj
  • fix(language-service): filter internal props in template completion
  • fix(language-service): sort component props in template completion
  • fix(language-core): duplicate completion appears at the beginning of script setup block

Other Changes

  • Upgrade Volar from v2.2.4 to v2.3.0-alpha.14.
    • LSP server performance improved
    • Language server now responds with the exact server capabilities for initialization requests
    • Auto insertion requests can now exit early in the language client
  • The following extensions have been added to Hybrid Mode’s compatibility whitelist:
    • kimuson.ts-type-expand - Thanks @zcf0508

FAQs

Package last updated on 08 Jun 2024

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