Skip to content

feat: more compiler compat 20260419#157

Merged
ubugeeei merged 15 commits intomainfrom
more-compiler-compat-20260419
Apr 20, 2026
Merged

feat: more compiler compat 20260419#157
ubugeeei merged 15 commits intomainfrom
more-compiler-compat-20260419

Conversation

@ubugeeei
Copy link
Copy Markdown
Owner

@ubugeeei ubugeeei commented Apr 19, 2026

Summary

This PR improves compiler compatibility by incorporating and adapting compatibility fixes from several upstream PRs:

The changes focus on Vue compiler output parity, tokenizer/parser correctness, SFC malformed block diagnostics, and regression coverage through snapshots.

Changes

Compiler compatibility

  • Support dynamic slot outlet names such as <slot :name="tab.key" />.
  • Preserve patch flags and dynamic props for v-if branches.
  • Keep template refs in v-if branches compatible with script setup bindings.
  • Reuse imported custom directive bindings instead of resolving them at runtime.
  • Preserve event handler member expressions and rest params correctly.
  • Support nullable runtime prop types by emitting null in runtime type arrays.
  • Add regression coverage for:
    • dynamic slot outlet names
    • v-for template else interpolation
    • import meta asset URLs
    • imported custom directives
    • component event member handlers
    • event rest params
    • nullable runtime props
    • dynamic style/class patch flags
    • template refs inside v-if

Armature parser/tokenizer

  • Add tokenizer support for CDATA sections.
  • Parse CDATA as text in non-HTML namespaces such as SVG.
  • Report CdataInHtmlContent for CDATA in HTML content.
  • Add EOF diagnostics for unterminated comment/CDATA edge cases.

SFC parser diagnostics

  • Report MALFORMED_BLOCK for malformed SFC blocks instead of silently skipping them.
  • Detect incomplete opening tags.
  • Detect missing or incomplete closing tags.
  • Support closing block tags with whitespace before >, including script/style/custom blocks.
  • Add snapshot coverage for malformed block diagnostics.

Tests

Verified with:

  • mise exec -- vp run --workspace-root fmt:all
  • mise exec -- vp run --workspace-root clippy
  • mise exec -- vp run --workspace-root test
  • mise exec -- vp run --workspace-root bench:quick
  • mise exec -- vp run --workspace-root test:playground

Latest quick benchmark result:

  • Native single-thread: 3.3x faster than @vue/compiler-sfc
  • Native multi-thread quick comparison: 27.4x faster

Playground headless Chromium tests passed:

  • 9 test files
  • 92 tests

Notes

The playground still prints the existing Vue compiler warning:

[@vue/compiler-core] decodeEntities option is passed but will be ignored in non-browser builds.

ubugeeei and others added 14 commits April 19, 2026 23:51
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: ushironoko <30229874+ushironoko@users.noreply.github.com>
Co-authored-by: Jevon617 <25676701+Jevon617@users.noreply.github.com>
Co-authored-by: Jevon617 <25676701+Jevon617@users.noreply.github.com>
Co-authored-by: liangmiQwQ <121547620+liangmiQwQ@users.noreply.github.com>
@ubugeeei ubugeeei force-pushed the more-compiler-compat-20260419 branch 2 times, most recently from 96dd02e to 5218f9c Compare April 19, 2026 15:09
@liangmiQwQ
Copy link
Copy Markdown
Contributor

Thank you, that helps a lot ❤️

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.

2 participants