Commit Graph

342 Commits

Author SHA1 Message Date
likui
810b3a3e2a feat(compiler-sfc): transform asset url (#500) 2019-12-01 12:02:53 -05:00
Evan You
0e3e07079a feat(transition): properly handle transition & transition-group in compiler 2019-11-29 12:42:04 -05:00
Evan You
4e8d57bdfb feat(compiler-core): options.isBuiltInComponent 2019-11-29 12:13:49 -05:00
Evan You
52134a88d0 fix(compiler-core): handle base-transition 2019-11-29 12:02:31 -05:00
Gabriel Loiácono
812a0626ce style(compiler): changed object-assign to spread (#507) 2019-11-28 10:49:39 -05:00
Gabriel Loiácono
009dc80674 perf(compiler-core): set simple expression outside map (#485) 2019-11-26 09:02:22 -05:00
Evan You
c6fb506fc0 feat(transition): compat with keep-alive 2019-11-25 17:35:15 -05:00
Evan You
08a3d95e52 fix: resolveDynamicComponent should use context instance 2019-11-25 11:41:28 -05:00
Evan You
1765985ec2 feat(transition): support in templates 2019-11-24 18:37:59 -05:00
Evan You
9e16ea3d30 test: update snapshots 2019-11-17 21:29:12 -05:00
Evan You
e89d009937 fix(compiler): include createTextVNode helper for hoisted static content (fix #465) 2019-11-17 21:26:25 -05:00
Evan You
1de072567d perf(compiler): pre-compute maxCRNameLength for perf 2019-11-16 16:19:47 -05:00
Gabriel Loiácono
2780e0df4c perf(compiler-core): add perf optimization to parseText (#458) 2019-11-15 17:48:01 -05:00
Evan You
353b06df77 perf(compiler): should only perform assertions during tests
Compiler assertions are made to ensure implementation correctness,
but they have performance costs that should not affect users
during development.
2019-11-15 17:29:08 -05:00
Evan You
51d57b4566 perf(compiler): minor perf tweaks 2019-11-15 16:47:55 -05:00
Evan You
4fef8f342a perf(compiler): improve perf of parseTextData 2019-11-15 16:17:52 -05:00
QuincyChen
d7d87622ce refactor: use isArray function from shared (#441) 2019-11-08 09:52:24 -05:00
Evan You
f178874ace fix(v-model): generate separate modifiers for v-model with args 2019-11-07 09:40:34 -05:00
Evan You
4b739e3bc0 fix(compiler-core): should not condense whitespace in RAWTEXT mode 2019-11-06 20:52:19 -05:00
Evan You
acbbe3298c refactor: move codeframe to @vue/shared 2019-11-06 15:13:15 -05:00
Evan You
98e9b769e6 feat(compiler): support keep-alive in templates 2019-11-05 10:26:56 -05:00
Dmitry Sharshakov
4b9483fd5e feat(compiler): compile suspense children as slots (#419) 2019-11-04 14:35:00 -05:00
Evan You
5eee1152ca types: (wip) improve dts output 2019-11-01 11:32:53 -04:00
likui
ea2e2ce5bd chore: fix typo (#409) 2019-10-29 13:51:48 -04:00
Cédric Exbrayat
36b7e4e52e chore: fix comments referencing renamed file [ci skip] (#404) 2019-10-28 12:04:04 -04:00
Evan You
34989ef7fe chore: license 2019-10-28 11:15:17 -04:00
Evan You
ed29af7bea fix: generate v-if fallback comment as block 2019-10-24 21:19:02 -04:00
Evan You
1c0a2c6d41 refactor(compiler): use shorter helpers for text and comment nodes 2019-10-24 17:55:00 -04:00
Evan You
eb20730a67 feat(compiler): preserve whitespace in pre tag, add tests 2019-10-24 16:42:09 -04:00
Evan You
9298f46f92 feat(compiler-core): whitespace handling 2019-10-24 16:22:48 -04:00
Evan You
516501e20e chore: remove unused util function 2019-10-24 15:39:31 -04:00
Evan You
f7a7e8d71d refactor(parser): remove ignoreSpaces option 2019-10-24 12:47:29 -04:00
Evan You
af5a8e1154 feat(compiler-core): re-implement v-once to use cache mechanism 2019-10-23 17:57:40 -04:00
Evan You
113339c7b6 fix(compiler-dom): style transform of static styles should not add STYLE patchFlag 2019-10-23 10:49:16 -04:00
Evan You
052febc127 feat(compiler): convert text mixed with elements into createVNode calls
This ensures they are tracked as dynamic children when inside blocks.
Also guaruntees compiled vnodes always have vnode children in arrays
so that they can skip normalizeVNode safely in optimized mode.
2019-10-21 15:52:29 -04:00
Evan You
a0d570b16d Revert "feat(compiler-core): hoist element with static ref (#344)"
Static refs still need to be tracked in dynamicChildren because unmount
also takes the fast path when dynamicChildren is present, and all refs
need to be properly unmounted.

This reverts commit 920773fc6b.
2019-10-21 15:17:29 -04:00
Evan You
4abd8d29ef chore: fix merge conflict 2019-10-21 10:33:10 -04:00
HcySunYang
920773fc6b feat(compiler-core): hoist element with static ref (#344) 2019-10-21 10:29:17 -04:00
Evan You
1b9bd6912e perf: v-for fragments do not need to track dynamicChildren 2019-10-21 10:00:45 -04:00
HcySunYang
71f3826f99 chore: rename & property missing (#335) 2019-10-21 10:00:23 -04:00
Evan You
6f9692dcdd chore: cache isStaticNode result for missing branch 2019-10-20 17:01:01 -04:00
Evan You
869ae19c41 fix(compiler): cache handlers should be per-instance, fix hoist w/ cached handlers 2019-10-20 17:00:11 -04:00
Dmitry Sharshakov
39157f7671 chore: fix ci (#338) 2019-10-19 20:03:15 -04:00
Evan You
58593c4714 feat(v-on): cache handlers 2019-10-18 21:51:34 -04:00
Evan You
e98a85f3cb refactor: applyDirectives -> withDirectives 2019-10-18 16:35:01 -04:00
Evan You
cba34453db refactor(v-on): avoid empty modifier guard with only key modifier 2019-10-18 16:20:45 -04:00
宋铄运
7f23eaf661 feat(core): support dynamic component via <component :is> (#320) 2019-10-18 12:09:04 -04:00
大江东去
bb9dca2047 test(compiler-core): add test for custom delimiter (#315) 2019-10-17 15:04:52 -04:00
Carlos Rodrigues
6c80e13986 chore: typos [ci-skip] (#323) 2019-10-17 15:01:51 -04:00
Evan You
4b2b29efa1 feat(compiler-core): support Suspense in templates 2019-10-16 17:43:41 -04:00
Evan You
e97951dd2e feat: emit compiler error for invalid JavaScript expressions 2019-10-16 17:43:41 -04:00
Evan You
b980ddb607 perf: skip hasScopeRef check if there are no scope vars 2019-10-16 15:35:04 -04:00
Evan You
d69db0b2fd feat(compiler-core/v-slot): only force dynamic slots when referencing scope vars
This feature is only applied with prefixIdentifiers: true.
2019-10-16 15:35:04 -04:00
Evan You
5e97643c85 feat(compiler-core/v-model): generate modelModifiers for component v-model 2019-10-16 15:35:04 -04:00
Evan You
25dd507f71 feat(compiler-core/v-model): error when v-model is used on scope variable 2019-10-16 15:35:04 -04:00
Evan You
5481f76ce8 feat(compiler-core/v-model): avoid patching v-model handler when possible 2019-10-16 15:35:04 -04:00
Evan You
6a75c3463b feat(compiler-core): do not generate TEXT flag if child is constant 2019-10-16 12:00:55 -04:00
Carlos Rodrigues
6607edab2d refactor(compiler-core): avoid has call (#314) 2019-10-16 10:46:41 -04:00
xiaoboost
32499b16e7 types: improve typing (#309) 2019-10-16 10:31:40 -04:00
Carlos Rodrigues
b54c05f751 types: improve typing (#313) 2019-10-16 10:15:03 -04:00
月迷津渡
f71bf2f1d3 feat: add isCustomElement option (#299) 2019-10-15 17:30:47 -04:00
HcySunYang
3385480ba7 fix(compiler-core): avoid prefixing empty interpolations (#290) 2019-10-15 16:58:01 -04:00
MichealXie
a3032b9b39 types: use Omit instead of Pick + Exclude (#296) 2019-10-15 12:24:16 -04:00
Evan You
74d501829c chore: use webpack-compatible pure annotation 2019-10-15 12:22:32 -04:00
Evan You
7de3aee317 fix: ensure makeMap calls are tree-shakable 2019-10-15 12:19:46 -04:00
Ayush Goyal
58fffcb987 refactor(core): use makeMap for faster string match checks (#282) 2019-10-15 12:11:08 -04:00
Evan You
4cee06ddab refactor(compiler-core): follow up on #276 2019-10-15 11:51:52 -04:00
HcySunYang
68a3879b88 feat(compiler-core): more hoisting optimizations (#276) 2019-10-15 11:41:24 -04:00
Evan You
004223ade6 chore: use consistent type signature 2019-10-14 17:12:02 -04:00
terencez
4547d85a38 feat(compiler-core): support <portal> in template (#203) 2019-10-14 15:11:04 -04:00
宋铄运
57a94b530d feat(dom): transform + runtime for v-on (#213) 2019-10-14 00:33:23 -04:00
likui
46e64b257c feat(compiler-core/runtime-core): show codeframe in runtime compile errors (#220) 2019-10-12 19:49:23 -04:00
Natalia Tepluhina
5d98c51b74 chore: use name const consistently (#249) 2019-10-12 19:43:36 -04:00
Sangeeth Sudheer
96681942c1 types: remove unnecessary types (#234) 2019-10-12 19:33:48 -04:00
HcySunYang
4587f4f7c9 chore: consistent call to the newline function (#222) 2019-10-12 10:30:39 -04:00
Evan You
acf406b779 fix(compiler-core): fix directive args with empty holes 2019-10-11 20:35:01 -04:00
Illya Klymov
584ac88b54 fix(compiler): update v-if directive to use Comment instead of Empty (#208) 2019-10-11 11:04:55 -04:00
Evan You
35d31a2ba2 chore: remove duplicate helperNameMap entry 2019-10-11 10:49:35 -04:00
Evan You
9ad7ae479e fix(compiler): export COMMENT instead EMPTY runtime helper 2019-10-11 10:47:59 -04:00
herochen
056764ce47 chore: typo (#198) 2019-10-11 09:59:52 -04:00
Evan You
e6d0d08a43 test(compiler): test for DirectiveTransform returning needRuntime: Symbol 2019-10-10 18:05:43 -04:00
Evan You
d376439167 wip(compiler-dom): v-model runtime 2019-10-10 18:02:51 -04:00
Adam Dorling
497ed19277 chore: remove copy-paste comment from v-cloak (#193) 2019-10-10 14:54:50 -04:00
月迷津渡
78f60347dc feat(compiler): add isNativeTag option for determining element type (#139) 2019-10-10 14:54:06 -04:00
月迷津渡
f71d252ffe fix(compiler-core): assest id (#190)
* fix(compile-core): asset id

* test(compile-core): asset id
2019-10-10 13:55:26 -04:00
Cédric Exbrayat
4ca32c537d test(compiler): fix copy paste in v-once spec (#191) 2019-10-10 13:54:22 -04:00
Illya Klymov
80f5cb2700 fix(compiler): do not hoist element with dynamic key (#187) 2019-10-10 11:19:17 -04:00
Evan You
f11dadc1d2 refactor(compiler): improve member expression check for v-on & v-model 2019-10-10 11:15:24 -04:00
Rahul Kadyan
87c3d2edae feat(compiler-core): create transform for v-model (#146) 2019-10-10 10:33:58 -04:00
二当家的
99bdc5a8c8 chore: correct typo (#188) 2019-10-10 10:26:13 -04:00
Evan You
2967745e7b refactor: use early return style in v-for 2019-10-09 22:31:27 -04:00
Evan You
93c6aa4c90 feat: v-once
Note: only compiler transform is tested - integration with runtime
still needs to be tested.
2019-10-09 17:32:58 -04:00
Evan You
5dfb271551 feat(compiler): implement support for v-pre 2019-10-09 16:00:08 -04:00
Evan You
b255f42ab3 types: fix error inference for public compile method 2019-10-09 11:30:56 -04:00
Evan You
f91d335e65 feat(compiler): v-text transform + move dom-specific errros codes to compiler-dom 2019-10-09 11:13:13 -04:00
Rahul Kadyan
19c65a61ea refactor(compiler-core): use directive name in error code identifier (#163) 2019-10-09 10:27:24 -04:00
Evan You
0615cf0108 refactor(compiler): flush transform onExit in reverse 2019-10-08 16:53:26 -04:00
Evan You
e8ee163fdd chore: remove unnecessary type cast 2019-10-08 15:58:35 -04:00
Evan You
eadcaead37 feat(compiler-dom): transform for v-html 2019-10-08 15:35:57 -04:00
Evan You
8da5b007b1 types: improve typing 2019-10-08 12:43:13 -04:00
Evan You
b68eb229c7 types: move scopeIds into PrefixMeta 2019-10-08 12:09:22 -04:00
Evan You
f15528350e test: test expression transform for reserved literals 2019-10-08 11:27:48 -04:00
Evan You
b4d375b0b8 fix(compiler): should not prefix reserved literals (close #142) 2019-10-08 11:25:38 -04:00
Evan You
16da9ae89f fix(compiler): handle block nodes with custom directives + improve ast types 2019-10-08 10:50:10 -04:00
Evan You
57a5c61320 test: tests for hoistStatic 2019-10-07 17:12:22 -04:00
Evan You
802ecccc49 refactor: give runtimeHelper symbols more readable names during dev 2019-10-07 13:32:29 -04:00
Evan You
3146e6b942 fix(compiler/v-if): avoid incorrect transform application on v-else/else-if branch children 2019-10-07 12:48:43 -04:00
Evan You
c4f9b6d592 test: fix import 2019-10-05 23:20:02 -04:00
Evan You
82bd9eb1db refactor(compiler): refine codegen node types 2019-10-05 22:48:13 -04:00
Evan You
bfecf2cdce refactor(compiler): use symbols for runtime helpers 2019-10-05 22:48:13 -04:00
Andrey Sukhonosov
de9507b6ff fix(compiler/codegen): add simple expression node opening bracket for ConditionalExpression (#110) 2019-10-05 15:42:49 -04:00
Vladimir
f48a2ffc76 chore: fix typos (#103) 2019-10-05 10:48:54 -04:00
Carlos Rodrigues
fbabae0c0a chore: replace some type casts and fix variable and filename typos (#93) 2019-10-05 10:38:02 -04:00
Carlos Rodrigues
23ff681418 chore: fix comment typos (#94) 2019-10-05 10:35:19 -04:00
zrh122
12abcba2c5 chore: fix typo in codegen (#92) 2019-10-05 10:29:50 -04:00
taiyop
a84a2b252d chore: fix typo in vBind.ts (#91) 2019-10-05 10:26:32 -04:00
夜宴
eaf4f67c62 chore: spelling mistake in ast.ts (#88) 2019-10-05 10:23:25 -04:00
Reed Jones
ca70aff860 chore: fix docs typo in vOn.ts (#86) 2019-10-04 23:12:49 -04:00
Evan You
21666243e9 fix(compiler): props hoist should also work on elements w/ TEXT flag 2019-10-04 22:51:51 -04:00
Evan You
9c9ef609d8 fix: import patchFlags from @vue/shared in compiler instead
Otherwise this imports unnecessary stuff from the runtime.
2019-10-04 22:47:09 -04:00
Martin Rojo
ea4a352ee6 fix(typo): transformSlotOutlet name correction (#83) 2019-10-04 22:12:51 -04:00
Evan You
0873254c6c workflow: improve template explorer 2019-10-04 17:43:20 -04:00
Evan You
277651ce89 fix(compiler): avoid hoisting components and directive calls 2019-10-04 14:34:26 -04:00
Evan You
5047bc8dbe workflow: basic template explorer 2019-10-04 13:08:17 -04:00
Evan You
b61d9652dd chore: shorten option name 2019-10-04 09:03:00 -04:00
Evan You
caccf92721 test: fix vbind tests 2019-10-04 08:38:53 -04:00
Evan You
6059fe69e8 fix(compiler): patchFlag analysis should factor in props returned by directive transforms 2019-10-04 08:37:10 -04:00
Evan You
095f5edf8d feat(compiler): hoist static trees 2019-10-03 23:30:25 -04:00
Evan You
2e2b6924da feat(compiler): v-on inline statement handling 2019-10-03 17:47:00 -04:00
Evan You
3354837ce1 refactor: move transformStyle to compiler-dom 2019-10-03 16:55:14 -04:00
Evan You
c2fc7e3347 feat(compiler): force dynamicSlots flag when inside v-for or v-slot 2019-10-03 16:27:46 -04:00
Evan You
4dea23f79e fix(compiler): exclude BAIL flag in annotations 2019-10-03 15:17:45 -04:00
Evan You
05db2a9c6c wip(compiler): adjust renderSlot() signature 2019-10-03 14:29:12 -04:00
Evan You
306c22efe1 feat(compiler): mark compiler-generated slots for runtime 2019-10-03 14:08:14 -04:00
Evan You
aa9245d55c feat(compiler): render <slot/> as block fragments 2019-10-03 12:03:14 -04:00
Evan You
fc47029ed3 feat(compiler): support v-for on named slots 2019-10-02 23:10:41 -04:00
Evan You
f401ac6b88 refactor: improve vSlot.ts readability 2019-10-02 18:03:42 -04:00
Evan You
3d14265102 feat(compiler): handle conditional v-slot 2019-10-02 17:18:11 -04:00
Evan You
e90b83600a test(compiler): tests for RootNode codegen transform 2019-10-02 14:03:28 -04:00
Evan You
24bd6c27e0 feat(compiler): block optimization codegen for RootNode 2019-10-02 13:11:07 -04:00
Evan You
b33f0ceff1 refactor(compiler): switch to acorn 2019-10-02 11:05:56 -04:00
Evan You
bec01c93bd fix(compiler): v-for fragments should be blocks 2019-10-02 10:47:01 -04:00
Evan You
191db785bd refactor: use global whitelist for render proxy has check 2019-10-02 10:37:06 -04:00
Evan You
fe36555d9e feat(compiler): generate TEXT patchFlag 2019-10-02 00:19:23 -04:00
Evan You
3a95a2f148 fix(compiler): generate correct fragment children when it contains single text node or slot outlet 2019-10-01 23:53:52 -04:00
Evan You
a477594d65 feat(compiler): v-for codegen w/ correct blocks optimization + key flags 2019-10-01 23:19:48 -04:00
Evan You
07955e6c96 test(compiler): tests for v-for codegen w/ block optimization 2019-10-01 21:00:55 -04:00
Evan You
65661b5ec0 test: restructure v-if & v-for tests 2019-10-01 17:58:09 -04:00
Evan You
4fc963bc5a feat(compiler): annotate patchFlags in generated code 2019-10-01 17:53:57 -04:00
Evan You
e5bc17967d wip(compiler): codegen node w/ block optimization for v-for 2019-10-01 16:48:20 -04:00