Skip to content
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

feat(compiler-core): add tagLoc and closeTagLoc to element ast node #12928

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

KazariEX
Copy link
Contributor

@KazariEX KazariEX commented Feb 22, 2025

Nowadays, language tools rely on string search to determine the offset of tags, which is not reliable and may cause some issues, like:

<img v-bind="imgAttrs">
        <!-- ^^^ is recognized as the close tag -->
<div></Div>
  <!-- ^^^ is not recognized as the close tag -->

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38.1 kB 34.3 kB
vue.global.prod.js 158 kB (+55 B) 58 kB (+25 B) 51.7 kB (+64 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.8 kB 23 kB 21 kB
defineCustomElement 59.4 kB 22.9 kB 20.8 kB
overall 68.6 kB 26.4 kB 24.1 kB

Copy link

pkg-pr-new bot commented Feb 22, 2025

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12928

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12928

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12928

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12928

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12928

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12928

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12928

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12928

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12928

vue

npm i https://pkg.pr.new/vue@12928

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12928

commit: 1c89b42

@KazariEX KazariEX marked this pull request as ready for review February 22, 2025 17:50
@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: compiler language-tools related to vue language-tools labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-tools related to vue language-tools ready to merge The PR is ready to be merged. scope: compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants