Evan You
157cfcb796
refactor: restore isSelfClosing as optional property
2023-11-25 22:55:39 +08:00
Evan You
bab5bd375b
chore: fix tests with rawExp
2023-11-25 22:50:40 +08:00
Evan You
e48cbf02be
refactor: restore SourceLocation.source
...
this is used extensively in @vue/language-tools and does not have
noticeable impact on performance
2023-11-25 19:22:39 +08:00
Evan You
08f0baa2ad
refactor: preserve source location convention in sfc mode for base parser
...
For compatibility w/ usage like https://github.com/vue-macros/vue-macros/blob/main/packages/setup-block/src/core/index.ts
2023-11-25 18:07:29 +08:00
Evan You
be6cae7dac
chore: remove isSelfClosing property
2023-11-25 18:03:22 +08:00
Evan You
6ec85ae872
chore: restructure parser files
2023-11-25 16:18:29 +08:00
Evan You
c11002f16a
perf(codegen): optimize source map generation
2023-11-25 16:18:29 +08:00
Evan You
3be53d9b97
perf(codegen): optimize line / column calculation during codegen
...
Previously, many CodegenContext.push() calls were unnecessarily
iterating through the entire pushed string to find newlines, when we
already know the newline positions for most of calls. Providing fast
paths for these calls significantly improves codegen performance when
source map is needed.
In benchmarks, this PR improves full SFC compilation performance by ~6%.
2023-11-25 16:18:29 +08:00
Evan You
20732366b9
perf: optimize position cloning
2023-11-25 16:18:29 +08:00
Evan You
3ee343928a
wip: parser v2 compat
2023-11-25 16:18:29 +08:00
Evan You
6022ac05c4
chore: document rationale for ignoring some parsing errors
2023-11-25 16:18:29 +08:00
Evan You
e702b278d4
wip: shorten some method names
2023-11-25 16:18:29 +08:00
Evan You
59227d4124
wip: parse error tests
2023-11-25 16:18:29 +08:00
Evan You
1b4efc30c3
wip: should parse sfc template with lang=html
2023-11-25 16:18:29 +08:00
Evan You
e41cf8dc59
refactor: better naming for baseCompile argument
2023-11-25 16:18:29 +08:00
Evan You
94c86269d0
refactor: fix v-bind no-exp shorthand for new parser
2023-11-25 16:18:29 +08:00
Evan You
e5afca6c1e
wip: treat template with preprocessor as plain text
2023-11-25 16:18:29 +08:00
Evan You
fc4f801070
wip: decodeEntities test
2023-11-25 16:18:29 +08:00
Evan You
059caafc13
wip: pass all compiler-sfc tests
2023-11-25 16:18:29 +08:00
Evan You
dda4fd526e
wip: pass all compiler-ssr tests
2023-11-25 16:18:29 +08:00
Evan You
5a44b84cde
wip: pass all compiler-dom tests
2023-11-25 16:18:29 +08:00
Evan You
40f72d5e50
feat(compiler-core): support specifying root namespace when parsing
2023-11-25 16:18:29 +08:00
Evan You
a1b10a21ac
wip: pass more compiler-dom tests
2023-11-25 16:18:29 +08:00
Evan You
1912af04e3
wip: entities parsing in browser
2023-11-25 16:18:29 +08:00
Evan You
caabba7590
wip: tune perf
2023-11-25 16:18:29 +08:00
Evan You
082b5a71c6
wip: pass all compiler-core tests
2023-11-25 16:18:29 +08:00
Evan You
c4e50e46bb
wip: more tests passing
2023-11-25 16:18:29 +08:00
Evan You
e05ba29555
wip: pass all non-error parsing tests
2023-11-25 16:18:29 +08:00
Evan You
a60ad9180d
refactor: swap to new template parser
...
- get rid of SourceLocation.source for memory efficiency
- move source location generation logic transform phase into the parser
itself so that SourceLocation.source is no longer needed
- move v-for expression parsing into the parser itself
- added nameLoc on AttributeNode for use in transformElement
Tests are not passing yet.
2023-11-25 16:18:29 +08:00
Evan You
65b44045ef
wip: parse mode
2023-11-25 16:18:29 +08:00
Evan You
66c0ed0a3c
perf: optimize away isBuiltInType
2023-11-25 16:18:29 +08:00
Evan You
bc170c49fc
chore: disable parser tests for now
2023-11-25 16:18:29 +08:00
Evan You
59e38f18d8
wip: parseMode
2023-11-25 16:18:29 +08:00
Evan You
81e941da5b
wip: getting ready for textmode handling
2023-11-25 16:18:29 +08:00
Evan You
5a855c57d7
wip: comments
2023-11-25 16:18:29 +08:00
Evan You
a12abe72bc
wip: refine element type
2023-11-25 16:18:29 +08:00
Evan You
c342433cb5
wip: v-pre handling
2023-11-25 16:18:29 +08:00
Evan You
1a1f680536
wip: pre tag handling
2023-11-25 16:18:29 +08:00
Evan You
5762288bdf
wip: parse interpolation
2023-11-25 16:18:29 +08:00
Evan You
70edd1c61e
wip: check duplicated attributes
2023-11-25 16:18:29 +08:00
Evan You
ec33e61e87
wip: remove htmlMode
2023-11-25 16:18:29 +08:00
Evan You
db085b4a79
wip: remove foreignContext check
2023-11-25 16:18:29 +08:00
Evan You
65c0b31148
wip: modifiers
2023-11-25 16:18:29 +08:00
Evan You
b81415ceac
wip: source location for props
2023-11-25 16:18:29 +08:00
Evan You
08038a938c
wip: parse directive in tokenizer
2023-11-25 16:18:29 +08:00
Evan You
622d34efe1
wip: optimize condenseWhitespace
2023-11-25 16:18:29 +08:00
Evan You
9aa8effec3
wip: parse directives
2023-11-25 16:18:29 +08:00
Evan You
f131a4723b
wip: loc for elements
2023-11-25 16:18:29 +08:00
Evan You
f7db16b9cf
wip: refactor line / column generation
2023-11-25 16:18:29 +08:00
Evan You
6311ebbf32
wip: save
2023-11-25 16:18:29 +08:00