Commit Graph

264 Commits

Author SHA1 Message Date
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
Evan You
605953a154 refactor: only inject rest args for member expression handlers + fix tests 2020-06-15 15:24:46 -04:00
Cathrine Vaage
7e28173312
fix(compiler-core/v-on): pass noninitial arguments in cached event handlers (#1265) 2020-06-15 15:04:03 -04:00
underfin
35dbef268c
fix(compiler-core): should not prefix object method (#1375) 2020-06-15 11:20:00 -04:00
Evan You
825ec1500f fix(compiler-core): support static slot names containing dots for 2.x compat
close #1241
2020-06-12 16:09:27 -04:00
Evan You
0d26413433 fix(compiler-core): fix parsing for directive with dynamic argument containing dots 2020-06-12 15:59:13 -04:00
Carlos Rodrigues
958b6c80cf
fix(compiler-core): allow multiline expression on v-model and v-on (#1234) 2020-06-09 17:24:48 -04:00
Evan You
e58beecc97 refactor(compiler/types): convert compiler options documentation to jsdoc
BREAKING CHANGE: `getTextMode` compiler option signature has changed from

  ```ts
  (tag: string, ns: string, parent: ElementNode | undefined) => TextModes
  ```

  to

  ```ts
  (node: ElementNode, parent: ElementNode | undefined) => TextModes
  ```
2020-05-07 11:01:36 -04:00
Evan You
c5e7d8b532 fix(compiler-core): hoist pure annotations should apply to all nested calls 2020-05-01 18:36:34 -04:00
Evan You
cad25d95a3 fix(compiler-core): hoisted vnode calls and scoped id calls should be marked pure
Otherwise they cannot be tree-shaken
2020-05-01 17:34:11 -04:00
HiiTea
22717772dd
chore: fix typos (#1090) 2020-05-01 09:42:58 -04:00
underfin
2b19965bcf
fix(slots): compiled slot fallback should be functions (#1030)
This avoids it being collected as dynamic children when it's not used.

fix #1021
2020-04-22 16:52:41 -04:00
Evan You
7d858a9001 test(compiler-core): test dynamic component block 2020-04-22 14:47:31 -04:00
扩散性百万甜面包
70c8c58be2
test(compiler-core): expect onError to be called (#976) 2020-04-17 08:58:38 -04:00
Evan You
1068212cb2 chore: run prettier 2020-04-15 10:51:07 -04:00
Evan You
a6e2b1052a fix(compiler-core): should not generate CLASS/STYLE patch flags on components
ref #677
2020-04-10 10:19:26 -04:00
Evan You
1f6e72b110 fix(compiler): support full range of entity decoding in browser builds
BREAKING CHANGE: compiler options have been adjusted.
    - new option `decodeEntities` is added.
    - `namedCharacterReferences` option has been removed.
    - `maxCRNameLength` option has been rmeoved.
2020-04-08 18:51:25 -04:00