From 308c7f01dc27f2cba219c590124d0ddd09b5e780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Wed, 18 Jun 2025 21:27:41 +0800 Subject: [PATCH] refactor: opt-in --- .../__snapshots__/parse.spec.ts.snap | 1560 ----------------- .../compiler-core/__tests__/parse.spec.ts | 115 -- packages/compiler-core/src/ast.ts | 2 +- packages/compiler-core/src/options.ts | 5 + packages/compiler-core/src/parser.ts | 9 +- 5 files changed, 12 insertions(+), 1679 deletions(-) diff --git a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap index e2263c31a..942eed4c4 100644 --- a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap @@ -26,36 +26,10 @@ exports[`compiler: parse > Edge Cases > invalid html 1`] = ` "ns": 0, "props": [], "tag": "span", - "tagLoc": { - "end": { - "column": 6, - "line": 2, - "offset": 11, - }, - "source": "span", - "start": { - "column": 2, - "line": 2, - "offset": 7, - }, - }, "tagType": 0, "type": 1, }, ], - "closeTagLoc": { - "end": { - "column": 6, - "line": 3, - "offset": 18, - }, - "source": "div", - "start": { - "column": 3, - "line": 3, - "offset": 15, - }, - }, "codegenNode": undefined, "loc": { "end": { @@ -75,19 +49,6 @@ exports[`compiler: parse > Edge Cases > invalid html 1`] = ` "ns": 0, "props": [], "tag": "div", - "tagLoc": { - "end": { - "column": 5, - "line": 1, - "offset": 4, - }, - "source": "div", - "start": { - "column": 2, - "line": 1, - "offset": 1, - }, - }, "tagType": 0, "type": 1, }, @@ -205,19 +166,6 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` }, ], "tag": "div", - "tagLoc": { - "end": { - "column": 5, - "line": 1, - "offset": 4, - }, - "source": "div", - "start": { - "column": 2, - "line": 1, - "offset": 1, - }, - }, "tagType": 0, "type": 1, }, @@ -299,19 +247,6 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` }, ], "tag": "p", - "tagLoc": { - "end": { - "column": 3, - "line": 2, - "offset": 39, - }, - "source": "p", - "start": { - "column": 2, - "line": 2, - "offset": 38, - }, - }, "tagType": 0, "type": 1, }, @@ -427,19 +362,6 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` }, ], "tag": "p", - "tagLoc": { - "end": { - "column": 5, - "line": 2, - "offset": 39, - }, - "source": "p", - "start": { - "column": 4, - "line": 2, - "offset": 38, - }, - }, "tagType": 0, "type": 1, }, @@ -461,19 +383,6 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "type": 3, }, ], - "closeTagLoc": { - "end": { - "column": 6, - "line": 4, - "offset": 122, - }, - "source": "div", - "start": { - "column": 3, - "line": 4, - "offset": 119, - }, - }, "codegenNode": undefined, "loc": { "end": { @@ -552,19 +461,6 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` }, ], "tag": "div", - "tagLoc": { - "end": { - "column": 5, - "line": 1, - "offset": 4, - }, - "source": "div", - "start": { - "column": 2, - "line": 1, - "offset": 1, - }, - }, "tagType": 0, "type": 1, }, @@ -606,19 +502,6 @@ exports[`compiler: parse > Errors > CDATA_IN_HTML_CONTENT >