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