HcySunYang
7715c49af9
fix(compiler-core): avoid generating useless createVNode helper ( #2938 )
...
close #2739
2021-03-25 17:01:50 -04:00
HcySunYang
b4b82159e2
fix(compiler-core): should not condense whitespace in RCDATA text mode ( #3482 )
...
fix #3479
2021-03-25 15:53:03 -04:00
HcySunYang
4bf7ba19bf
fix(compiler-core): detect v-if branch root with comment as dev fragment ( #2785 )
...
fix #2780
2021-03-25 15:43:44 -04:00
HcySunYang
602b58ebd1
fix(compiler-core): fix the detection of forwarded slots with v-if or v-for ( #3353 )
...
fix #3347
2021-03-22 16:34:46 -04:00
Evan You
ff4d4ec249
chore: fix all test cases
2021-03-05 18:28:12 -05:00
Evan You
02cbbb718c
perf: support only attaching slot scope ids when necessary
...
This is done by adding the `slotted: false` option to:
- compiler-dom
- compiler-ssr
- compiler-sfc (forwarded to template compiler)
At runtime, only slotted component will render slot fragments with
slot scope Ids. For SSR, only slotted component will add slot scope Ids
to rendered slot content. This should improve both runtime performance
and reduce SSR rendered markup size.
Note: requires SFC tooling (e.g. `vue-loader` and `vite`) to pass on
the `slotted` option from the SFC descriptoer to the `compileTemplate`
call.
2021-03-05 18:28:12 -05:00
Evan You
aea88c3280
refactor: fix implementation of SFC :slotted id handling
...
fix #2892
2021-03-05 18:28:12 -05:00
Evan You
338d869c70
test(compiler-core): test expression transform w/ bindingMetadata
2020-12-04 16:46:00 -05:00
Evan You
11a76ebd94
chore: fix snapshot
2020-12-01 09:21:39 -05:00
Evan You
e4f09c1419
fix(compiler-core/v-on): handle falsy values when caching v-on handlers
...
fix #2605
2020-11-30 16:30:36 -05:00
Evan You
9db7095962
fix(compiler-core): fix scope var reference check for v-on expressions
...
fix #2564
2020-11-30 15:19:32 -05:00
Evan You
e41b46c396
chore: annotate generated slot flag
2020-11-30 15:19:32 -05:00
Evan You
67d1aac6ae
feat(sfc): allow sfcs to recursively self-reference in template via name inferred from filename
...
e.g. A file named `FooBar.vue` can refer to itself as `<FooBar/>`. This gets rid of the need for the `name` option.
2020-11-30 12:30:51 -05:00
Evan You
3bc2914e32
fix(attr-fallthrough): ensure consistent attr fallthrough for root fragments with comments
...
fix #2549
2020-11-27 18:04:26 -05:00
edison
ef59a30cab
fix(compiler-core): transform kebab case props to camelcase on slots ( #2490 )
...
fix #2488
2020-11-27 09:48:30 -05:00
Evan You
90bdf59f4c
refactor(compiler): better constant hoist/stringify checks
2020-11-20 19:26:07 -05:00
Evan You
8ac2241b22
wip: more consistent compiler-sfc usage + inline mode for ssr
2020-11-20 14:23:09 -05:00
Hunter
6d2a1cb64d
fix(compiler-core): fix multiline member expression check ( #2436 )
...
fix #2426
2020-10-20 09:31:08 -04:00
ᴜɴвʏтᴇ
052a621762
feat(compile-core): handle falsy dynamic args for v-on and v-bind ( #2393 )
...
fix #2388
2020-10-19 17:15:53 -04:00
meteorlxy
e2c9ab1991
test(compiler-core): more test cases for baseParse ( #2211 )
2020-10-13 16:03:33 -04:00
ᴜɴвʏтᴇ
692197be33
fix(compiler-core): fix v-if key injection with v-on object syntax ( #2368 )
...
fix #2366
2020-10-13 12:04:52 -04:00
ᴜɴвʏтᴇ
89c5909a6f
fix(compiler-core): allow spaces between if-else branches ( #2305 )
...
fix #2299
2020-10-07 20:57:17 -04:00
Evan You
f9566f00df
test(compiler-core): add test case for v-on event case conversion
2020-10-06 18:31:04 -04:00
Evan You
f4119249f2
fix(compiler-core): consistently remove comment nodes for pre tags in production
...
close #2217
2020-10-05 17:53:34 -04:00
HcySunYang
9499871582
fix(compiler-core): make v-once work with v-if/else-if/else ( #2182 )
...
Partial fix for #2035
2020-10-05 11:58:37 -04:00
meteorlxy
64f44c671a
chore(compiler-core): fix typo in tests ( #2209 )
2020-09-23 12:25:52 +02:00
Evan You
be946ea549
fix(compiler-core): fix prefixing for <template v-for>
key expressions
...
fix #2085
2020-09-14 17:04:27 -04:00
Evan You
a096a58e41
fix(compiler-core): fix v-if block handling for components that fail to resolve
...
fix #2058
2020-09-14 12:41:35 -04:00
Evan You
52e45a9850
fix(v-once): fix v-once usage with v-if and v-for
...
fix #2035
2020-09-02 12:30:37 -04:00
Evan You
91700fbec2
refactor(compiler-core): simplify hoistStatic check for nodes without patchFlag
...
close #1912
2020-08-20 11:43:34 -04:00
underfin
69cfed6b31
fix(compiler-core): should attach key to single element child of <template v-for>
( #1910 )
2020-08-20 10:09:57 -04:00
Evan You
24041b7ac1
fix(compiler-core): generate NEED_PATCH flag for element with vnode hooks
2020-08-19 17:30:44 -04:00
Barthélémy Ledoux
62b9d02f6f
feat(compiler-core): add comments
parser option ( #1858 )
2020-08-17 11:20:28 -04:00
Evan You
b0d01e9db9
dx(compiler-core): warn on <template v-for>
key misplacement
...
Note: the behavior is different from Vue 2. `<template v-for>` are compiled
into an array of Fragment vnodes so the key should be placed the `<template>`
for v-for to use it for diffing.
2020-08-04 12:20:32 -04:00
Evan You
de0c8a7e3e
fix(compiler-core): v-if key error should only be checking same key on different branches
2020-08-04 12:01:18 -04:00
Evan You
58b4a382f9
refactor(compiler-core): emit error on v-if key usage
2020-07-28 15:18:41 -04:00
underfin
d4527230e4
fix(compiler-core): prevent generating invalid code for v-bind with empty expression ( #1720 )
2020-07-27 18:31:08 -04:00
Evan You
af7e100ef2
fix(compiler-core): fix v-if + v-for on <template>
...
fix #1637
2020-07-19 14:36:01 -04:00
HcySunYang
f9826fa963
fix(compiler-core/v-on): fix codegen for event handler with newlines ( #1640 )
2020-07-19 11:48:26 -04:00
Evan You
aab99abd28
fix(slots): properly force update on forwarded slots
...
fix #1594
2020-07-15 20:12:49 -04:00
HcySunYang
64c7b2f9ce
fix(compiler-core): generate incremental keys for v-if/else-if/else chains ( #1589 )
...
fix #1587
2020-07-15 09:21:40 -04:00
Evan You
380c6792d8
fix(v-on): refactor DOM event options modifer handling
...
fix #1567
Previously multiple `v-on` handlers with different event attach option
modifers (`.once`, `.capture` and `.passive`) are generated as an array
of objects in the form of `[{ handler, options }]` - however, this
makes it pretty complex for `runtime-dom` to properly handle all
possible value permutations, as each handler may need to be attached
with different options.
With this commit, they are now generated as event props with different
keys - e.g. `v-on:click.capture` is now generated as a prop named
`onClick.capture`. This allows them to be patched as separate props
which makes the runtime handling much simpler.
2020-07-14 11:48:05 -04:00
Evan You
65beba98fe
fix(slots): differentiate dynamic/static compiled slots
...
fix #1557
2020-07-13 12:36:41 -04:00
Evan You
b51b79f5c4
refactor: rename optimizeBindings -> optimizeImports
2020-07-10 20:43:52 -04:00
Evan You
87c2a1e50f
fix(compiler-core/v-on): bail caching for member expression handlers on components
...
to preserve correct arity when it is passed down.
fix #1541
2020-07-08 11:48:12 -04:00
Evan You
4b5ce8b456
refactor(compiler-core): remove unnecessary arg in cached handler codegen
2020-07-08 11:48:12 -04:00
Felix Rilling
829b35e426
chore: typo fixes ( #1546 )
...
* chore: fix typos in comments/JSDoc.
* chore: fix typo in internal function name.
* chore: fix typos in test comments/descriptions/variable names.
2020-07-08 12:32:42 +02:00
Evan You
7777473ddd
chore: fix missed snapshots
2020-06-26 17:00:50 -04:00
HcySunYang
8a2cf21b71
perf(compiler-core): treat v-for with constant exp as a stable fragment ( #1394 )
2020-06-17 16:13:14 -04:00
Joseph Xia
d57749cbf7
test(compiler-core): add v-if with comments test case ( #1389 )
2020-06-17 16:01:12 -04:00