Commit Graph

943 Commits

Author SHA1 Message Date
Evan You 34989ef7fe chore: license 2019-10-28 11:15:17 -04:00
likui 8454e7e004 refactor: remove unnecessary variable (#401) 2019-10-28 10:13:26 -04:00
Dmitry Sharshakov db7666d0f3 fix(warning): handle errors in warn handler (#396) 2019-10-27 20:55:50 -04:00
Dmitry Sharshakov e7e3eb8662 refactor(VNode): improve helper types (#392) 2019-10-27 20:54:54 -04:00
Dmitry Sharshakov e581b14dff feat(apiApp): return app from provide method for chaining (#393) 2019-10-27 20:54:33 -04:00
Evan You a8aa328907 chore: comment on cloneVNode implementation [ci skip] 2019-10-27 20:45:59 -04:00
djy0 8d7a186def chore: fix typo (#395) 2019-10-27 20:44:24 -04:00
Evan You 43f4bd3aaa chore: fix typing for withDirectives 2019-10-26 16:32:27 -04:00
Evan You 07ce2c5fa7 perf: improve directive runtime performance 2019-10-26 16:00:07 -04:00
Evan You 6c7787db7b perf: use makeMap for reserved prop check 2019-10-26 11:24:37 -04:00
Dmitry Sharshakov 7394f7ec42 fix(apiInject): fix stringifying of symbol injection key (#383) 2019-10-26 10:52:29 -04:00
Dmitry Sharshakov 134e932322 fix(types): fix VNodeTypes unique symbols (#387) 2019-10-26 10:51:55 -04:00
Dmitry Sharshakov 49914efc9e fix(Portal): add ability to use element as target (#380) 2019-10-26 10:32:16 -04:00
Evan You b788c03992 test: fix context.attrs test case 2019-10-26 10:31:36 -04:00
Evan You b3282028bb chore: remove it.only 2019-10-26 10:27:49 -04:00
Evan You 8edfbf9df9 feat(core): adjust attrs fallthrough behavior 2019-10-25 12:12:17 -04:00
Junyan d76cfba7fb refactor(reactivity): reduce code of type check (#377) 2019-10-25 11:15:04 -04:00
Ayush Goyal a489f98a66 perf(compiler-dom): use makeMap instead of RegEx (#354) 2019-10-25 10:35:44 -04:00
likui 532b5eebd7 feat(runtime-core): support array in watch option (#376) 2019-10-25 10:25:52 -04:00
大江东去 a75077569e test(dom): test using innerHTML as template. (#372) 2019-10-25 10:18:46 -04:00
夜宴 57276f9dcb test(effect): add test for json methods (#371) 2019-10-25 10:17:31 -04:00
Evan You 8c1638da33 feat(runtime-core): warn access of undefined property during render 2019-10-25 10:12:58 -04:00
Cr 3f73b8b6cf chore: fix composition example (#369) 2019-10-25 10:00:55 -04:00
Evan You fd4845c52c chore: include todomvc examples (need tests!) 2019-10-24 22:23:08 -04:00
Evan You 6a92bbd9c0 feat(runtime-dom): support using mount target innerHTML as template 2019-10-24 21:58:34 -04:00
Evan You ed29af7bea fix: generate v-if fallback comment as block 2019-10-24 21:19:02 -04:00
Evan You 7b637319a8 fix: export missing createCommentVNode fn 2019-10-24 21:08:28 -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
相学长 abfb2ec8ed types(reactivity): computed types remove `as` (#367) 2019-10-24 11:37:52 -04:00
Evan You 42bf9ca3e5 feat(props): enable case conversion in all builds, preserve casing for attrs 2019-10-24 10:59:57 -04:00
Evan You e2917fef96 feat(props): kebab -> camel prop case support in full build 2019-10-23 21:51:01 -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 9291011456 chore: comments [ci skip] 2019-10-23 15:19:55 -04:00
Dmitry Sharshakov 3b613cbecd test(template-refs): add tests for function refs (#359) 2019-10-23 11:54:50 -04:00
Mayness 18a349ce8c fix(reactivity): account for NaN in value change checks (#361) 2019-10-23 11:53:43 -04:00
Cr 246cad7459 fix(reactivity): Map.set should trigger when adding new entry with undefined value (#364) 2019-10-23 11:00:55 -04:00
Evan You 09c248ae87 chore: fix snapshot 2019-10-23 10:57:05 -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
大江东去 7cd1b7fcaf test(compiler-dom): test namespace parsing (#356) 2019-10-23 10:35:45 -04:00
edison 9dcbf17f3a perf(runtime-core): use `makeMap` instead of `RE` (#350) 2019-10-23 10:34:58 -04:00
likui e34d2bd853 types: improve slots type (#366) 2019-10-23 09:29:09 -04:00
Evan You 590e4e0ba9 chore: fix DebuggerEvent export 2019-10-22 11:53:32 -04:00
Evan You af57ad110f chore: revert prettier 2019-10-22 11:53:32 -04:00
Evan You b5886189ba types: massive refactor 2019-10-22 11:53:32 -04:00
Cr a23e03f01e feat(apiOptions): add warning for duplicated properties declared by options (#329) 2019-10-21 23:47:16 -04:00
Evan You a25b1371ab types: improve types 2019-10-21 23:37:03 -04:00
Evan You bc0ec27739 chore: reference link 2019-10-21 16:46:47 -04:00
Evan You 5023dff60c feat: update svg tag list 2019-10-21 16:39:37 -04:00
Evan You bb85aefc03 chore: move dom element config to compiler-dom 2019-10-21 16:25: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
likui f85ba092ce types: improve emit type (#345) 2019-10-21 14:04:42 -04:00
Jooger 67eb29f63b refactor(errorHandlling): handle array in callWithAsyncErrorHandling (#332) 2019-10-21 13:59:10 -04:00
Dmitry Sharshakov 74d8c5919d types: improve computed types (#343) 2019-10-21 13:57:20 -04:00
Dmitry Sharshakov 1f4937c2fd types: use RenderFunction type (#342) 2019-10-21 13:44:01 -04:00
Evan You 520af9787b perf: skip normalizeVNode in optimized mode 2019-10-21 12:24:19 -04:00
Evan You 8be578b6b6 perf: micro optimizations for vnode creation 2019-10-21 11:30:45 -04:00
Evan You 40ccbdeaac chore: remove refs from setupContext
explicit refs should be preferred
2019-10-21 10:36:38 -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
Dmitry Sharshakov 27f3c2d751 chore: fix typo (#339) 2019-10-21 10:04:34 -04:00
Evan You f241c92917 chore: remove todo 2019-10-21 10:04:02 -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 39ea67a2d2 chore: rename v-on guard constants 2019-10-18 16:36:42 -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
Evan You d69d3bf765 fix(reactivity): revert to Reflect.get and add test cases 2019-10-18 15:31:28 -04:00
Dmitry Sharshakov 068902abec types: fix createComponent type when using simple function (#334) 2019-10-18 14:58:15 -04:00
Evan You b5194b16bf refactor: rename vnode hooks
So that they can be used as @vnodeMounted="..." in templates
2019-10-18 14:54:35 -04:00
扩散性百万甜面包 3cd2f7e68e types: fix ref unwrapping when nested inside arrays (#331) 2019-10-18 14:54:05 -04:00
Dmitry Sharshakov 2238925fbe feat(core): validate directives names (#326) 2019-10-18 12:34:45 -04:00
edison 60961ef5b6 perf(reactivity): optimize the performance of the `canObserve` (#330) 2019-10-18 12:11:58 -04:00
宋铄运 7f23eaf661 feat(core): support dynamic component via <component :is> (#320) 2019-10-18 12:09:04 -04:00
Evan You d179918001 perf: further tweak accessCache 2019-10-17 22:29:51 -04:00
Dmitry Sharshakov 7305f693b1 refactor(runtime-core): extract promise check into shared (#325) 2019-10-17 15:47:26 -04:00
大江东去 bb9dca2047 test(compiler-core): add test for custom delimiter (#315) 2019-10-17 15:04:52 -04:00
Evan You e3b68972d8 perf: minor tweaks 2019-10-17 15:02:15 -04:00
Evan You 4771319a15 perf(core): cache property access types on renderProxy 2019-10-17 15:02:15 -04:00
Evan You cdee65aa1b perf: revert to _isRef for perf
Benchmarking shows checking for a plain property is about 4~5x faster
than checking for a Symbol, likely because the Symbol does not fit well
into V8's hidden class model.
2019-10-17 15:02:14 -04:00
Carlos Rodrigues 6c80e13986 chore: typos [ci-skip] (#323) 2019-10-17 15:01:51 -04:00
Evan You 1722dc05c5 fix(runtime-core): handle dynamicChildren when portal is used as a block 2019-10-16 17:43:41 -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
Carlos Rodrigues 48b79d02e8 perf(runtime-core): use faster diff map population (#319) 2019-10-16 15:34:51 -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
Evan You b20b922d99 perf(v-for): use faster array population in renderList 2019-10-16 10:42:25 -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
Ruijia Tang 3e51200bae chore: Remove unnecessary console.log (#312) 2019-10-16 10:11:13 -04:00
Dmitry Sharshakov 0bac763f5a feat(directives): add support for function directives (#252) 2019-10-16 02:12:26 -04:00
Tidyzq a72652f6e6 refactor(reactivity): immediate return (#301) 2019-10-16 01:58:11 -04:00
likui 29811d1fe8 test(compiler-dom): add test for vModel transform (#289) 2019-10-16 01:47:58 -04:00
Evan You 6f3e768d52 refactor: use makeMap in v-on dom transform 2019-10-15 22:29:52 -04:00
Evan You 65a0207c7b test: test runtime compilation error warning 2019-10-15 22:19:19 -04:00
Jian Zhang cf12d18b4b refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (#307) 2019-10-15 22:18:55 -04:00
月迷津渡 f71bf2f1d3 feat: add isCustomElement option (#299) 2019-10-15 17:30:47 -04:00
宋铄运 db5c343c33 test(runtime-dom): add test coverage for v-on runtime guards, fix "exact" guard (#298) 2019-10-15 17:08:43 -04:00
HcySunYang 3385480ba7 fix(compiler-core): avoid prefixing empty interpolations (#290) 2019-10-15 16:58:01 -04:00
Adam Lewkowicz 555e3be69d types(watch): allow readonly arrays for watching multiple sources (#281) 2019-10-15 16:44:14 -04:00
Carlos Rodrigues 0b2573f3d1 types(runtime-dom): cast to the correct eventType instead of any (#292) 2019-10-15 12:26:19 -04:00
MichealXie a3032b9b39 types: use `Omit` instead of `Pick + Exclude` (#296) 2019-10-15 12:24:16 -04:00
Cr 8eba1aba08 feat(vModel): warn if v-model is used on file input (#295) 2019-10-15 12:23:38 -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 e3b14f5904 chore: comments grammar 2019-10-15 12:02:12 -04:00
edison b5209277de refactor(reactivity): define hadKey if necessary (#288) 2019-10-15 11:59:40 -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
夜宴 9a37c4b2c3 refactor(effect): use includes instead of indexOf (#286) 2019-10-15 11:18:26 -04:00
fisker Cheung 1fbb4d22fa chore: use `const` instead of `let` (#283) 2019-10-14 23:15:36 -04:00
fisker Cheung e5d60a0f7a types: use hook type in options (#284) 2019-10-14 23:15:09 -04:00
Evan You c7074c703e refactor(v-on): do not generate persistent flag when no listener modifier is present 2019-10-14 23:06:51 -04:00
Evan You 2d6d5d4517 chore: move events.spec.ts 2019-10-14 17:46:30 -04:00
Evan You 2b3d5b3f96 chore: move vModel.spec.ts 2019-10-14 17:45:15 -04:00
Evan You 8df3e0a41e refactor: move looseEqual to vModel 2019-10-14 17:40:56 -04:00
Evan You 004223ade6 chore: use consistent type signature 2019-10-14 17:12:02 -04:00
Stanislav Lashmanov b4eeb2fa1b test(runtime-dom): vModel tests (#255) 2019-10-14 17:07:34 -04:00
月迷津渡 66023a8886 feat: runtime component name validation (#217) 2019-10-14 15:36:29 -04:00
Dmitry Sharshakov fd209f5a66 feat(core): export version (#254) 2019-10-14 15:31:43 -04:00
terencez 4547d85a38 feat(compiler-core): support <portal> in template (#203) 2019-10-14 15:11:04 -04:00
Evan You 37cbd0098d chore: lint + include tsx files for lint 2019-10-14 15:07:43 -04:00
Evan You 6b3ad95fa4 fix(watch): type inference for computed refs 2019-10-14 12:15:09 -04:00
Cr 6bd26636c3 test: add test for resolveAsset (#273) 2019-10-14 11:56:02 -04:00
Evan You 1c56d1bf19 test: test unwrapping computed refs 2019-10-14 11:21:09 -04:00
Jooger d8b2b9eb9c types(ref): improve UnwrapRef types (#266) 2019-10-14 11:02:49 -04:00
Cr d2bcedb213 feat(apiOptions): warn invalid computed options (#225) 2019-10-14 02:15:31 -04:00
Evan You 82b5978e9c build: further shave off runtime compile only code 2019-10-14 01:08:00 -04:00
宋铄运 57a94b530d feat(dom): transform + runtime for v-on (#213) 2019-10-14 00:33:23 -04:00
Jooger 312907c9d8 refactor(scheduler): replace try catch with callWithErrorHandling (#264) 2019-10-14 00:32:01 -04:00
fisker Cheung 70a142c203 refactor(runtime-core): programmatically create lifecycle APIs for DRYness (#246) 2019-10-13 23:18:34 -04:00
Dmitry Sharshakov 7fd1fdde28 refactor(scheduler): minor refactors (#240) 2019-10-13 22:41:23 -04:00
Dmitry Sharshakov 374a85b861 types: improve directive typing (#253) 2019-10-13 22:40:29 -04:00
Evan You 8e5ea98ccd
Revert "chore: remove useless else (#245)" (#257)
This reverts commit 971cebc61c.
2019-10-12 22:52:11 -04:00
fisker Cheung 971cebc61c chore: remove useless else (#245) 2019-10-12 20:12:09 -04:00