Skip to content

perf(language-core): drop internal component #5532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

KazariEX
Copy link
Member

No description provided.

Copy link

pkg-pr-new bot commented Jul 18, 2025

Open in StackBlitz

vue-component-meta

npm i https://pkg.pr.new/vuejs/language-tools/vue-component-meta@5532

vue-component-type-helpers

npm i https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@5532

@vue/language-core

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-core@5532

@vue/language-plugin-pug

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@5532

@vue/language-server

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-server@5532

@vue/language-service

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-service@5532

vue-tsc

npm i https://pkg.pr.new/vuejs/language-tools/vue-tsc@5532

@vue/typescript-plugin

npm i https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@5532

commit: 6f87f71

@KazariEX KazariEX requested a review from Copilot July 19, 2025 01:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a performance improvement by dropping the __VLS_self internal component variable and refactoring the component type system to use __VLS_export instead. The changes streamline template type checking and improve TypeScript compilation performance by reducing redundant internal component representations.

Key changes:

  • Replace __VLS_self with __VLS_export throughout the codebase
  • Refactor component type generation to use direct exports instead of internal proxy components
  • Update test fixtures to reflect improved type inference (removing unnecessary | undefined unions)

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/language-core/lib/codegen/script/componentSelf.ts Complete file removal - eliminates internal component self-reference generation
packages/typescript-plugin/lib/requests/utils.ts Updates component type resolution to use __VLS_export instead of __VLS_self
packages/language-core/lib/codegen/script/index.ts Refactors script generation to use const exports and direct component references
packages/language-core/lib/codegen/script/template.ts Major restructuring of template context generation and binding logic
Test fixtures Multiple test files updated to reflect improved type inference
Comments suppressed due to low confidence (1)

packages/tsc/tests/typecheck.spec.ts:15

  • The removal of the withScript.vue test case suggests that a previously failing test scenario is no longer being covered. This could indicate that error handling for a specific edge case is no longer being validated.
			  "test-workspace/tsc/failureFixtures/#5071/withoutScript.vue(2,26): error TS1005: ';' expected.",

Comment on lines 351 to +354
return {
name: ts.isVariableDeclaration(parent) ? _getNodeText(parent.name) : undefined,
name: ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name)
? _getNodeText(parent.name)
: undefined,
Copy link
Preview

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition checks for both ts.isVariableDeclaration(parent) and ts.isIdentifier(parent.name) but only returns the result of the second check. This could cause a runtime error if parent is not a variable declaration but the first condition passes, leading to accessing .name on an incompatible node type.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant