Commit Graph

45 Commits

Author SHA1 Message Date
ᴜɴвʏтᴇ 3c05f8bbd6
fix(reactivity): unwrap non-index accessed refs on reactive arrays (#1859)
close #1846
2020-08-21 13:36:41 -04:00
Pick 44448fdd22
types(reactivity): add dts for proxyRefs & improve typings (#1786) 2020-08-14 17:37:36 -04:00
Evan You 7edfdf7e23 fix(reactivity): avoid tracking internal symbols in has trap
fix #1683
2020-07-22 21:23:32 -04:00
edison 178e89305d
chore(reactivity): use consistent naming for ReactiveFlags enum (#1428) 2020-06-26 09:32:09 -04:00
underfin c43a6e61a0
perf(reactivity): should not track `__v_isRef` (#1392) 2020-06-25 11:40:49 -04:00
Evan You d863ce721f refactor: improve base getter readability 2020-06-12 09:25:40 -04:00
Yang Mingshan 80e1693e1f
fix(reactivity): replaced ref in reactive object should be tracked (#1058) 2020-06-12 09:20:43 -04:00
Evan You 10bb34bb86 fix(reactivity): fix toRaw for objects prototype inherting reactive
fix #1246
2020-06-11 15:12:57 -04:00
Evan You 80c868aefe workflow: setup eslint for prohibited syntax and globals
fix #1285
2020-06-10 16:54:23 -04:00
doly mood d3c436ae2e
feat(types): mixins/extends support in TypeScript (#626) 2020-06-09 10:37:00 -04:00
龙腾道 037fa07113
fix(reactivity): fix __proto__ access on proxy objects (#1133) 2020-05-06 09:08:44 -04:00
Evan You f40f3a0e95 fix(reactivity): avoid polluting Object prototype 2020-05-04 08:51:17 -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
Evan You 3178504273 refactor(reactivity): make readonly non-tracking 2020-04-14 23:49:46 -04:00
Evan You 09b44e07cb refactor(reactivity): move array ref handling into getter 2020-04-14 22:18:58 -04:00
djy0 b13886b1ba
types(reactivity): remove this in get accessor, fix #800 (#806) 2020-03-09 16:01:49 -04:00
Evan You cc69fd72e3 fix(reactivity): Map/Set identity methods should work even if raw value contains reactive entries
fix #799
2020-03-06 11:10:02 -05:00
Evan You b36a76fe23 chore: remove debugger [ci skip] 2020-02-22 05:19:22 +01:00
Evan You 775a7c2b41 refactor: preserve refs in reactive arrays
BREAKING CHANGE: reactive arrays no longer unwraps contained refs

    When reactive arrays contain refs, especially a mix of refs and
    plain values, Array prototype methods will fail to function
    properly - e.g. sort() or reverse() will overwrite the ref's value
    instead of moving it (see #737).

    Ensuring correct behavior for all possible Array methods while
    retaining the ref unwrapping behavior is exceedinly complicated; In
    addition, even if Vue handles the built-in methods internally, it
    would still break when the user attempts to use a 3rd party utility
    functioon (e.g. lodash) on a reactive array containing refs.

    After this commit, similar to other collection types like Map and
    Set, Arrays will no longer automatically unwrap contained refs.

    The usage of mixed refs and plain values in Arrays should be rare in
    practice. In cases where this is necessary, the user can create a
    computed property that performs the unwrapping.
2020-02-21 17:48:39 +01:00
Evan You 33622d6360 perf(reactivity): only trigger all effects on Array length mutation if new length is shorter than old length 2020-02-21 15:05:16 +01:00
Dmitry Sharshakov 7f38c1e0ff
feat(reactivity): add shallowReactive function (#689) 2020-02-04 10:15:27 -05:00
Evan You 763faac182 wip(ssr): revert reactivity ssr paths
The perf gains are not worth the correctness issues these paths may lead to
2020-01-27 16:00:18 -05:00
Evan You aefb7d282e fix(reactivity): Array methods relying on identity should work with raw values 2020-01-23 13:42:31 -05:00
Evan You 755c7b581c chore: mark get/set create calls pure 2019-12-20 11:16:46 -05:00
Evan You 0a4f306492 fix: shallowReadonly should keep reactive properties reactive
ref #552
2019-12-20 11:14:07 -05:00
ztplz 02478b48eb chore: use const instead of let (#524) 2019-12-06 00:10:06 +01:00
Evan You 89a187b895 refactor(reactivity): separate track and trigger operation types 2019-12-03 11:30:24 -05:00
Evan You 57bbbb227c fix(core): propsProxy should not convert non-reactive nested values 2019-12-02 14:11:12 -05:00
ztplz 2d40466d35 chore: remove unused parameter type definitions (#481) 2019-11-22 15:35:58 -05:00
Evan You d9c6ff372c feat(core): allow passing explicit refs via props 2019-11-06 12:51:26 -05:00
Mayness 18a349ce8c fix(reactivity): account for NaN in value change checks (#361) 2019-10-23 11:53:43 -04:00
Evan You b5886189ba types: massive refactor 2019-10-22 11:53:32 -04:00
Evan You d69d3bf765 fix(reactivity): revert to Reflect.get and add test cases 2019-10-18 15:31:28 -04:00
Evan You e3b68972d8 perf: minor tweaks 2019-10-17 15:02:15 -04:00
edison b5209277de refactor(reactivity): define hadKey if necessary (#288) 2019-10-15 11:59:40 -04:00
terencez ff68db46ea fix(reactivity): avoid triggering effect when deleting property returns false (#168) 2019-10-09 11:55:57 -04:00
Cr b9a4d8d088 refactor(reactivity): use function isSymbol instead of typeof (#155) 2019-10-09 11:49:23 -04:00
月迷津渡 5eacfaf210 fix(reactivity): explicitly do type conversions in warning strings (#129) 2019-10-06 11:26:33 -04:00
Evan You 891f21b010 refactor: extract hasOwn helper 2019-09-05 20:48:14 -04:00
Evan You 589d3c2feb refactor: immutable -> readonly 2019-08-23 09:38:32 -04:00
Evan You caba6d5c9e wip: state -> reactive, value -> ref 2019-08-16 09:42:46 -04:00
Evan You 09141b56fd wip: proper handling of value assignment in reactive object 2019-08-13 11:30:28 -04:00
Evan You 2fc0d599db revert: "wip: handle value -> value assignment in reactive object"
This reverts commit 61ab483af1.
2019-08-13 11:27:48 -04:00
Evan You 61ab483af1 wip: handle value -> value assignment in reactive object 2019-08-13 11:13:26 -04:00
Evan You 471899af8b refactor: rename reactivity package name and APIs 2019-06-11 23:50:28 +08:00