Commit Graph

812 Commits

Author SHA1 Message Date
ysj16
1f2926a33c
perf: optimize LRU access in keep-alive (#1316) 2020-06-11 17:24:50 -04:00
underfin
0b93440146
chore: better warning when remounting a mounted app (#1297) 2020-06-11 17:20:38 -04:00
Evan You
3fafc3b3ac
types(runtime-core): improve types for transition hook (#1009)
* types(runtime-core): improve types for transition hook

fix #1000

* Update packages/runtime-core/src/components/BaseTransition.ts

Co-Authored-By: Carlos Rodrigues <david-181@hotmail.com>

* fix: run ci

Co-authored-by: Carlos Rodrigues <david-181@hotmail.com>
2020-06-11 16:39:18 -04:00
underfin
419b86d190
feat(types): support typing directive value via generic argument (#1007)
close #998
2020-06-11 16:37:14 -04:00
Evan You
80c868aefe workflow: setup eslint for prohibited syntax and globals
fix #1285
2020-06-10 16:54:23 -04:00
Evan You
e4dc03a8b1 feat(types): adjust type exports for manual render function and tooling usage
- v-model and v-show directives are now exposed as public
- compiler-used runtime helpers are now exposed for TS tooling, but marked as @private

close #1329
2020-06-10 14:57:21 -04:00
Evan You
2417a0cb30 fix(runtime-core): respect props from mixins and extends
fix #1236, close #1250
2020-06-09 11:27:40 -04:00
doly mood
d3c436ae2e
feat(types): mixins/extends support in TypeScript (#626) 2020-06-09 10:37:00 -04:00
Carlos Rodrigues
97dedebd80
feat(types): update to Typescript 3.9 (#1106) 2020-06-09 10:17:42 -04:00
Alexandre Bonaventure Geissmann
4a5021e763
fix(runtime-core): use array destructuring instead of object for edge compat (#1302)
fix #1294
2020-06-05 10:57:44 -04:00
Evan You
2408a65662 fix(hmr): force full update in child component on slot update 2020-05-29 10:50:01 -04:00
Evan You
38f2d23a60 feat(runtime-core): add inheritRef option + make <transition> & <keep-alive> inherit refs 2020-05-22 10:26:17 -04:00
Evan You
0a7932c6b3 fix(ssr): should set ref on hydration 2020-05-21 17:37:23 -04:00
Evan You
24168bbb33 chore: improve comments 2020-05-18 11:17:57 -04:00
Yang Mingshan
ba62ccd55d
feat(watch): support directly watching reactive object in multiple sources with deep default (#1201) 2020-05-18 11:02:51 -04:00
Evan You
b26976b6d8 wip: fix tests 2020-05-15 17:05:26 -04:00
Evan You
dc229bcda4 wip(hydration): hydrate multi-element static nodes 2020-05-15 16:30:20 -04:00
Evan You
1184118d23 wip(runtime): test for static vnode handling 2020-05-15 16:11:53 -04:00
Evan You
dbf627f136 wip(runtime): support multi-element static vnode in renderer 2020-05-15 15:12:26 -04:00
Evan You
2bc6a8c1cf fix(hmr): static child traversal should only affect elements 2020-05-11 15:46:30 -04:00
Evan You
1b946c85df fix(hmr): always force full child component props update in HMR mode 2020-05-11 14:17:35 -04:00
Evan You
5b8883a846 fix(runtime-core): should not take unmount children fast path for v-for fragments
fix #1153
2020-05-11 13:53:28 -04:00
Evan You
66c5a556dc fix(hmr): ensure static nodes inherit DOM element in hmr mode
fix #1156
2020-05-11 11:34:42 -04:00
Evan You
a165d8293d feat(runtime-core): expose isVNode 2020-05-11 11:09:36 -04:00
susiwen8
df4150dc4c
chore: LegacyOptions doesn't need to be exported (#1134) 2020-05-06 11:07:11 -04:00
Evan You
40166a8637 feat(types): re-expose trasnformVNodeArgs 2020-05-05 10:45:33 -04:00
Evan You
ff97be15c3 chore: ensure warn is dev only 2020-05-04 10:17:40 -04:00
Evan You
6b33cc4229 feat(watch): support directly watching reactive object with deep default
Also warn invalid watch sources

close #1110
2020-05-04 09:27:28 -04:00
Evan You
64ef7c76bf feat(types): re-expose resolve asset utitlies and registerRuntimeCompiler in type definitions
close #1109
2020-05-04 08:52:59 -04:00
Evan You
01b7e90eac fix(hmr): handle cases where instances with same id having different definitions 2020-05-03 13:52:09 -04:00
Evan You
d901b6bea8 refactor(reactivity): use more efficient reactive checks
WeakSets and WeakMaps shows degrading performance as the amount of
observed objects increases. Using hidden keys result in better
performance especially when repeatedly creating large amounts of
reactive proxies.

This also makes it possible to more efficiently declare non-reactive
objects in userland.
2020-05-02 16:58:17 -04:00
Eduardo San Martin Morote
71a942b25a
fix(warn): cast symbols to strings (#1103) 2020-05-02 10:26:32 -04:00
Evan You
583ba0c172 feat(types): re-expose withDirectives as public type 2020-05-02 10:19:40 -04:00
underfin
8b85aaeea9
fix(runtime-core): should call Suspense fallback unmount hook (#1061)
fix #1059
2020-05-01 16:20:16 -04:00
Evan You
b40fcbc4c6 fix(types): augment ref unwrap bail types in appropriate packages
Packages can now augment the ref unwrap bail types in their own `d.ts`.
Also updated the build script to auto concat any files in a package's
`types` directory to the final generated `d.ts`.

- `@vue/reactivity` should no longer require `libs: ["DOM"]` in tsconfig
- Properly bail on `VNode` and `ComponentPublicInstance` in runtime-core
2020-05-01 16:14:30 -04:00
Evan You
7f23555356 fix(teleport): teleport should always be tracked as dynamic child for unmount
fix #1088
2020-05-01 15:12:07 -04:00
Evan You
08bf7e3607 fix(runtime-core): cloned vnodes with extra props should de-opt 2020-05-01 14:55:27 -04:00
Evan You
ac6a6f11ac fix(runtime-core): fix slot fragment bail check 2020-05-01 14:16:55 -04:00
Evan You
11f38d8a85 perf: instance public proxy should never be observed 2020-05-01 13:24:38 -04:00
Evan You
62336085f4 fix(runtime-core): avoid infinite warning loop for isRef check on component public proxy
fix #1091
2020-05-01 13:23:59 -04:00
Evan You
1bddeea247 feat(runtime-core): warn against user properties with reserved prefixes 2020-05-01 11:23:22 -04:00
Evan You
68e1ce8b66 refactor(types): mark more internal APIs 2020-05-01 10:37:40 -04:00
HiiTea
22717772dd
chore: fix typos (#1090) 2020-05-01 09:42:58 -04:00
Evan You
127e96a993 types: fix internal exports from @vue/shared 2020-05-01 09:19:30 -04:00
Evan You
c9bf7ded2e refactor(types): mark internal API exports and exclude from d.ts
BREAKING CHANGE: Internal APIs are now excluded from type decalrations.
2020-04-30 17:04:35 -04:00
Bas van Meurs
ba240eb497
feat(runtime-core): export queuePostFlushCb (#1078) 2020-04-30 14:58:50 -04:00
Carlos Rodrigues
239270c38a
fix(keep-alive): do not invoke onVnodeBeforeUnmount if is KeepAlive component (#1079) 2020-04-30 14:52:03 -04:00
Evan You
352c369704 chore: remove stale _isVue checks 2020-04-30 14:45:25 -04:00
Evan You
386b093554 fix(hmr): support hmr for static nodes 2020-04-30 14:45:25 -04:00
Evan You
e087b4e024 fix(hydration): fix text mismatch warning 2020-04-29 17:07:41 -04:00
Evan You
a0e2c12874 fix(warning): always check for component instance presence when formatting traces 2020-04-29 14:41:22 -04:00
Evan You
892fb6d229 types: use more consistent naming for apiWatch type exports
BREAKING CHANGE: Some watch API types are renamed.

    - `BaseWatchOptions` -> `WatchOptionsBase`
    - `StopHandle` -> `WatchStopHandle`
2020-04-27 13:33:57 -04:00
Evan You
8ab44e1f80 types: expose ComponentOptionsBase 2020-04-27 13:31:40 -04:00
Evan You
ca84f46cd0 chore: add tip about Suspense being experimental 2020-04-24 16:13:44 -04:00
Evan You
ded92f93b4 fix(runtime-core): dynamic component should support falsy values without warning 2020-04-24 15:32:47 -04:00
Carlos Rodrigues
f3a9b516bd
fix(types): make return type of defineComponent assignable to Component type (#1032)
fix #993
2020-04-24 13:22:58 -04:00
Carlos Rodrigues
28b4c317b4
feat(types): expose ToRefs type (#1037) 2020-04-24 13:10:16 -04:00
Evan You
c9f10be9de refactor(runtime-core): extract key/ref normalization logic 2020-04-24 13:06:56 -04:00
Evan You
d7379c7647 fix(runtime-core): fix key/ref resolution for cloneVNode
fix #1041
2020-04-24 12:42:46 -04:00
Evan You
dcf2458fa8 fix(runtime-core): fix dynamic node tracking in dynamic component that resolves to plain elements
fix #1039
2020-04-24 12:18:51 -04:00
underfin
63c8444d4a
Update packages/runtime-core/src/components/BaseTransition.ts
Co-Authored-By: Carlos Rodrigues <david-181@hotmail.com>
2020-04-23 06:53:46 +08:00
Evan You
2acf3e84b9 feat(reactivity): add triggerRef API
Also make shallowRef assignment behavior consistent with normal ref
2020-04-22 18:00:10 -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
ff4d1fcd81 fix(runtime-core): mixin options that rely on this context should be deferred
Also ensure consistent option apply order with Vue 2, close #1016, close #1029
2020-04-22 16:36:18 -04:00
Evan You
e422b8b082 fix(runtime-core): only infer component name for object components
close #1023
2020-04-22 04:39:12 -04:00
likui
9bddf3820e types(runtime-core): improve types for transition hook
fix #1000
2020-04-21 12:06:10 +08:00
Andrew Talbot
cebad64d22
feat(runtime-core): improve warning for extraneous event listeners (#1005)
fix #1001
2020-04-20 16:40:59 -04:00
Evan You
dece6102aa feat(warn): infer anonymous component named based on resolve name 2020-04-20 16:17:29 -04:00
Evan You
0278992f78 fix(warn): fix component name inference in warning trace 2020-04-20 16:06:51 -04:00
Andrew Talbot
054ccecd58
perf(core): use startsWith instead of indexOf (#989) 2020-04-20 15:44:20 -04:00
Evan You
ab844fd169 feat(runtime-core): more specific warning for failed v-on fallthrough
close #1001
2020-04-20 15:32:21 -04:00
Evan You
e954ba21f0 feat(build): provide more specific warnings for runtime compilation
close #1004
2020-04-20 15:23:26 -04:00
Evan You
171cfa404f fix(runtime-core): should not cast prop value if prop did not change
fix #999
2020-04-20 14:16:25 -04:00
Evan You
36d77f9a9e refactor(hmr): simplify usage 2020-04-20 13:39:47 -04:00
Evan You
19223f5462 build: remove __BUNLDER__ flag so that HMR is available for all builds 2020-04-20 13:39:47 -04:00
Jian Zhang
a51b052672
chore: remove a dead if branch (#986) 2020-04-17 18:41:33 -04:00
Evan You
d7ca1c5c6e fix(runtime-core): fix user attched public instance properties that start with "$" 2020-04-17 10:23:10 -04:00
Carlos Rodrigues
99fd158d09
fix(watch): fix deep watchers on refs containing primitives (#984) 2020-04-17 09:55:41 -04:00
Evan You
c0adb67c2e feat(types): expose ComponentCustomOptions for declaring custom options 2020-04-17 09:41:36 -04:00
Evan You
be21cfb1db feat(types): feat(types): add ComponentCustomProperties interface (#982) 2020-04-17 09:12:50 -04:00
Cédric Exbrayat
4cf5e07608
feat(types): expose ExtractPropTypes (#983) 2020-04-17 09:00:25 -04:00
Evan You
370fc820cc refactor(runtime-core): refactor instance public proxy context object 2020-04-16 12:49:50 -04:00
Evan You
b2662a62c5 wip: separate setupState 2020-04-16 11:50:33 -04:00
Evan You
0709380c5f feat(runtime-core): skip emit warn if has equivalent onXXX prop 2020-04-16 11:27:52 -04:00
Evan You
bfd6744fb1 perf(runtime-core): use raw context on component options init 2020-04-16 10:39:51 -04:00
Evan You
24e5ab33f5 refactor(runtime-core): remove need for internal instance sink 2020-04-16 10:09:20 -04:00
Evan You
09b4202a22 refactor(reactivity): adjust APIs
BREAKING CHANGE: Reactivity APIs adjustments:

- `readonly` is now non-tracking if called on plain objects.
  `lock` and `unlock` have been removed. A `readonly` proxy can no
  longer be directly mutated. However, it can still wrap an already
  reactive object and track changes to the source reactive object.

- `isReactive` now only returns true for proxies created by `reactive`,
   or a `readonly` proxy that wraps a `reactive` proxy.

- A new utility `isProxy` is introduced, which returns true for both
  reactive or readonly proxies.

- `markNonReactive` has been renamed to `markRaw`.
2020-04-15 16:45:20 -04:00
Evan You
3178504273 refactor(reactivity): make readonly non-tracking 2020-04-14 23:49:46 -04:00
Evan You
486dc188fe feat(reactivity): add support for toRef API 2020-04-14 20:49:18 -04:00
Evan You
b83c580131 feat(reactivity): add support for customRef API 2020-04-14 20:45:46 -04:00
Evan You
4046f0bc03 chore: revert debugging dev flag 2020-04-14 18:32:27 -04:00
Evan You
8ae362400e types: fix public instance $root and $parent type 2020-04-14 18:13:53 -04:00
Evan You
2e06f5bbe8 feat(runtime-core): detect and warn against components made reactive
close #962
2020-04-14 18:07:47 -04:00
Evan You
3e7bb7d110 feat(runtime-core): warn async data() 2020-04-14 17:40:41 -04:00
Evan You
78977c3997 fix(scheduler): sort jobs before flushing
This fixes the case where a child component is added to the queue before
its parent, but should be invalidated by its parent's update. Same logic
was present in Vue 2.

Properly fixes #910
ref: https://github.com/vuejs/vue-next/issues/910#issuecomment-613097539
2020-04-14 17:31:35 -04:00
Evan You
c80b857eb5 fix(runtime-core): should resolve value instead of delete for dynamic props with options 2020-04-14 16:17:35 -04:00
Evan You
e8a866ec99 refactor(reactivity): remove stale API markReadonly
BREAKING CHANGE: `markReadonly` has been removed.
2020-04-13 17:39:48 -04:00
Evan You
9e9d264412
Revert "feat(reactivity): add effect to public api (#909)" (#961)
This reverts commit 6fba241850.
2020-04-13 17:13:06 -04:00
Evan You
7cbf684611 fix(runtime-core): fix kebab-case props update
fix #955
2020-04-13 12:37:31 -04:00
Evan You
5968cff3a8 refactor: make sure setupContext.emit always reference current emit on instance
This is dev only and for internal use by vue-test-utils.
2020-04-13 10:06:51 -04:00