Commit Graph

506 Commits

Author SHA1 Message Date
Rizumu Ayaka 2cce436aaf
feat(runtime-vapor): lifecycle beforeUpdate and updated hooks (#89) 2024-01-13 03:25:57 +08:00
Doctorwu 8d04205041
fix(reactivity): correct dirty assign in render function (#10091)
close #10082
2024-01-12 21:13:17 +08:00
LiuSeen 03b54962dc
chore(types): use EffectScheduler type for its queue (#10023) 2024-01-09 15:27:17 +08:00
LiuSeen 96fffe6ec3
chore(comments): dep changed from set to map (#10019) [ci skip] 2024-01-08 14:19:07 +08:00
Rizumu Ayaka 26fee414ff
feat: compound expression for `v-on` (#60) 2024-01-08 14:07:49 +08:00
Rizumu Ayaka bdf28de8e8
feat(runtime-core, reactivity): `onEffectCleanup` and `baseWatch` (#82)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
2024-01-04 23:22:55 +08:00
三咲智子 Kevin Deng bfe6b459d3
style: update format & lint config (#9162)
Co-authored-by: 丶远方 <yangpanteng@gmail.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
Co-authored-by: Guo Xingjun <99574369+Plumbiu@users.noreply.github.com>
2023-12-26 19:39:47 +08:00
Evan You cda74beceb chore: Merge branch 'main' into minor 2023-12-26 15:45:49 +08:00
yangxiuxiu 0695c69e0d
fix(types): fix distribution of union types when unwrapping setup bindings (#9909)
close #9903
2023-12-26 11:57:50 +08:00
Evan You 95f6fffea2 chore: Merge branch 'main' into minor 2023-12-19 18:16:16 +08:00
Eduardo San Martin Morote 24b1c1dd57
fix(types): extract properties from extended collections (#9854)
close #9852
2023-12-19 17:05:29 +08:00
Evan You 9f64d2b681 chore: Merge branch 'main' into minor 2023-12-16 14:37:21 +08:00
丶远方 9a571582b5
fix(types): fix `shallowRef` type error (#9839) 2023-12-16 13:45:01 +08:00
Evan You 982a145d38 chore: Merge branch 'main' into minor 2023-12-11 22:03:28 +08:00
Evan You ef432bda77 refactor(reactivity): improve nested readonly ref set check
ref #9094
2023-12-11 18:40:55 +08:00
丶远方 cdac12161e
fix(types): ref() return type should not be any when initial value is any (#9768) 2023-12-07 16:28:16 +08:00
Evan You 6ecbd5ce2a fix(reactivity): fix mutation on user proxy of reactive Array
close #9742
close #9751
close #9750
2023-12-07 13:26:30 +08:00
Evan You e12b10ac3e chore: Merge branch 'main' into minor 2023-12-04 23:17:41 +08:00
三咲智子 Kevin Deng ad27473701
fix(types): fix reactive collection types (#8960)
close #8904
2023-12-01 02:33:09 +08:00
ZHAO Jin-Xiang fff7b864f4
feat: use enum to replace const enum (#9261)
close #1228
2023-11-29 12:24:50 +08:00
Evan You 1ea775633d chore: Merge branch 'main' into minor 2023-11-21 09:48:26 +08:00
renovate[bot] 16a6438236
chore(deps): update lint (#9627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2023-11-18 10:33:24 +08:00
丶远方 176d476712
fix(types): fix `unref` and `toValue` when input union type contains ComputedRef (#8748)
close #8747
close #8857
2023-11-10 16:56:29 +08:00
Simon Lévesque 7c448000b0
fix(types): fix shallowRef return type with union value type (#7853)
close #7852
2023-11-10 13:40:47 +08:00
657476dcdb
fix(reactivity): clear method on readonly collections should return undefined (#7316) 2023-11-09 17:32:21 +08:00
Johnson Chu 48b47a1ab6
feat(reactivity): expose last result for computed getter (#9497) 2023-10-31 22:19:40 +08:00
Johnson Chu 16e06ca08f
feat(reactivity): more efficient reactivity system (#5912)
fix #311, fix #1811, fix #6018, fix #7160, fix #8714, fix #9149, fix #9419, fix #9464
2023-10-27 23:28:40 +09:00
skirtle e9e2778e9e
fix(reactivity): assigning array.length while observing a symbol property (#7568) 2023-10-21 09:48:59 +08:00
chenfan e33d554cae
refactor(reactivity): add instance check for effect (#9055) 2023-09-05 03:27:54 -05:00
Waleed Khaled 02c6924bcd
refactor(reactivity): encapsulate reactive handlers in class (#8586)
reactive obj create has a huge positive impact (200% - 700%)
get/set reactive obj props has a small negative impact (1% - 5%)
2023-08-22 16:50:27 +08:00
三咲智子 Kevin Deng 623ba514ec
chore: format code 2023-08-11 17:30:04 +08:00
丶远方 3decc57d0c
chore: remove unnecessary type assertions (#8386) 2023-07-10 18:18:53 +08:00
13b72317c5
refactor(reactivity): use hasChanged to avoid tracking NaN key twice (#7378) 2023-07-10 18:17:26 +08:00
丶远方 3798c5480b
chore: remove unnecessary type assertions (#8311) 2023-05-19 07:49:28 +08:00
丶远方 2ce23f0e09
chore(reactivity): remove unnecessary type assertions. (#8046) 2023-04-10 14:06:56 +08:00
丶远方 cac1512390
chore(reactive): remove unref type assertion (#8007) 2023-04-06 17:15:27 +08:00
Evan You 59e828448e
feat(reactivity): improve support of getter usage in reactivity APIs (#7997) 2023-04-02 10:17:51 +08:00
Roland Hummel c346af2b6a
docs: comments on reactivity functions (fixes #4832) (#4836)
close #4832
2023-03-31 17:06:10 +08:00
Evan You eb0c1e7025 build: remove api-extractor 2023-02-03 15:57:00 +08:00
Evan You 6213b73cd2 build: custom const enum processing 2023-02-03 09:54:15 +08:00
Evan You 53e3533b75 chore: bump deps 2023-02-03 05:47:40 +08:00
Evan You 124373db50 wip: isolatedModules + use rollup-plugin-esbuild 2023-02-03 04:30:19 +08:00
Anthony Fu e64c9ae957
fix(reactivity): `triggerRef` working with `toRef` from reactive (#7507)
* fix(reactivity): `triggerRef` working with `toRef` from reactive

* chore: refactor
2023-02-01 03:20:47 -05:00
13dc28aeff
refactor(reactivity): hasOwnProperty add this parameter (#7233)
hasOwnProperty adds this parameter and delete @ts-ignore
2023-01-09 15:21:32 +01:00
Evan You 588bd44f03 fix(reactivity): track hasOwnProperty
fix #2619
close #2621
2022-11-14 17:17:35 +08:00
Evan You efa2ac54d9 refactor: use Number constructor when coercing array length 2022-11-14 16:10:05 +08:00
webfansplz 59ffe5ee1f
fix(types/effectScope): re-expose `active` as readonly property (#6187)
close #6186
2022-11-13 20:27:52 -05:00
三咲智子 Kevin Deng e9172db68b
fix(types): export `Raw` type (#6380)
fix #7048
2022-11-07 21:03:49 -05:00
三咲智子 (Kevin) bbb66d7ac7
ci: check prettier format (#6830) 2022-10-28 09:39:34 +08:00
HeYunfei e816812f10
fix(types): should unwrap tuple correctly (#3820)
fix #3819
2022-10-26 04:27:42 -04:00
Evan You d9de6caecd refactor: move toNumber call out of loop 2022-10-26 15:17:25 +08:00
bcq028 e6224f4256
fix(reactivity): enable trigger when use str to set length of arr (#6810)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2022-10-21 09:25:06 +02:00
Evan You a71f9ac41a fix(effectScope): calling off() of a detached scope should not break currentScope 2022-10-14 10:53:23 +08:00
Evan You a95554d35c fix(reactivity): fix shallow/readonly edge cases 2022-07-22 11:16:06 +08:00
Carlos Rodrigues 17c50ce18d
build(deps-dev): bump typescript to 4.7.4 (#6215) 2022-07-06 04:27:30 -04:00
Marcos Dantas cd92654510
chore: comments (#5332) [ci skip] 2022-05-12 20:23:28 -04:00
descire b87dc06193
fix(reactivity): ios10.x compatibility (#4900) 2022-05-10 04:10:40 -04:00
那里好脏不可以 6042ab0f2f
chore: type [ci skip] 2022-05-09 22:51:51 -04:00
Evan You 30c33af839 chore: use explicit type import to avoid Rollup warning 2022-05-10 10:05:24 +08:00
zhangenming b9484543db
refactor(reactivity): make some expression simpler (#5131) 2022-05-06 06:42:22 -04:00
Carlos Rodrigues 32e53bfd47
fix(types): keep the original type when unwrapping `markRaw` (#3791) 2022-05-06 05:07:49 -04:00
Evan You 82bdf86254 fix(reactivity): ensure computed is invalidated before other effects
fix #5720
2022-04-15 16:43:17 +08:00
宋铄运 (Alan Song) c6eb3cccce
build: improve treeshakeability (#5682) 2022-04-13 05:39:02 -04:00
Code_xxmyyds 711c826c68
chore(reactivity): use warn (#5548) 2022-04-13 05:21:38 -04:00
Evan You 154233abdb fix(reactivity): fix ref tracking of self-stopping effects
close #5707
2022-04-13 17:00:31 +08:00
Evan You ea6fc845f2 chore: trim non-public properties on EffectScope type 2022-04-12 15:57:07 +08:00
Wei 0a301d4dab
fix(reactivity): fix currentScope loss when running detached effect scope (#5575) 2022-04-12 03:51:05 -04:00
Evan You 7efb9dba30 refactor: remove use of Object.assign
TS already transpiles spread to Object.assign with target:es2016
2022-04-12 15:22:11 +08:00
Evan You a51f935b72 refactor: remove isTracking() method 2022-01-30 18:53:43 +08:00
Evan You 81a6708739 chore: simplify effectScope 2022-01-28 21:02:09 +08:00
Evan You 2993a24618 perf(reactivity): optimize effect/effectScope active state tracking 2022-01-28 18:35:09 +08:00
Thorsten Lünborg 4be1037f31
fix(reactivity): ensure readonly refs can be replaced with new refs in reactive objects (#5310)
fix #5307
2022-01-23 08:08:27 -05:00
HcySunYang c64907d261
fix(types): calling readonly() with ref() should return Readonly<Ref<T>> (#5212) 2022-01-21 02:33:30 -05:00
Thorsten Lünborg 171f5e9c60
fix(reactivity): mutating a readonly ref nested in a reactive object should fail. (#5048)
fix: #5042
2022-01-21 02:33:18 -05:00
Evan You 2f91872e7b fix(ssr): only cache computed getters during render phase
fix #5300
2022-01-21 12:31:54 +08:00
Evan You 25bc6549eb perf(reactivity): optimize effect run condition 2022-01-21 09:41:58 +08:00
Evan You 9c304bfe79 fix(reactivity): differentiate shallow/deep proxies of same target when nested in reactive
fix #5271
2022-01-18 09:22:41 +08:00
Evan You 9fda9411ec feat(reactivity): add isShallow api 2022-01-18 09:22:41 +08:00
Evan You f4f0966b33 fix(ssr): make computed inactive during ssr, fix memory leak
fix #5208
2022-01-16 18:22:18 +08:00
Evan You 5ac703055f fix(types): handle ToRef<any>
fix #5188
2022-01-16 15:47:00 +08:00
Evan You 92f11d6740 fix(types): fix shallowReadonly type 2022-01-10 15:05:09 +08:00
Evan You db729ce99e feat(reactivity-transform/types): restructure macro types + export types for all shorthand methods 2021-12-11 18:15:44 +08:00
Evan You 2db9c909c2 feat(reactivity): support default value in toRef() 2021-12-11 16:41:58 +08:00
三咲智子 523b4b78f5
fix(types/reactivity): export ShallowRef type (#5026)
close #5205
2021-12-05 23:18:21 -05:00
Evan You 6d46b36e7c revert: "fix(types): use proper array type when unwrapping reactive array (#4807)"
This reverts commit 89c54ee2b9.
2021-11-26 10:54:12 +08:00
Cheese 89c54ee2b9
fix(types): use proper array type when unwrapping reactive array (#4807) 2021-11-25 05:41:25 -05:00
JensDll c6cd6a7938
fix (types): do not unwrap refs in `toRefs` (#4966) 2021-11-25 04:39:09 -05:00
Evan You d145128ab4 fix(reactivity): retain readonly proxies when setting as reactive property
fix #4986
2021-11-25 12:14:39 +08:00
Jeet Mandaliya 61720231b4
chore: typo [skip ci] (#4961) 2021-11-18 11:01:11 +01:00
Marvin Rudolph d56f115f71
chore(reactivity): fix typo in types (#4889) 2021-11-02 20:19:39 +01:00
Evan You c803eb15ec chore: avoid rollup plugin ts warning 2021-10-09 18:34:54 -04:00
Evan You 20a361541c fix(types): fix ref unwrapping type inference for nested shallowReactive & shallowRef
fix #4771
2021-10-09 17:51:15 -04:00
Che Guevara 925bc346fe
fix(types): make `toRef` return correct type(fix #4732) (#4734)
* fix(types): make `toRef` return correct type(fix #4732)

* chore: use correct test

Co-authored-by: Evan You <yyx990803@gmail.com>
2021-10-08 11:57:49 -04:00
Thorsten Lünborg ed0071ac1a
fix(types): ensure that DeepReadonly handles Ref type properly (#4714) 2021-10-07 18:30:54 -04:00
zhangenming 52e4ea732d
refactor(reactivity): reuse toReactive helper (#4641) 2021-09-22 10:11:54 -04:00
zhangenming b264551c9b
refactor(reactivity): reuse computed getter check (#4623) 2021-09-21 13:03:09 -04:00
n2ptune 2361ca4fc2
chore(reactivity): fix typo in dep (#4534) [ci skip] 2021-09-07 11:31:12 -04:00
Evan You 815bfcffae fix(types): fix ref macro types
fix #4499
2021-09-04 16:42:46 -04:00
zhangenming a6e6253319
types(reactivity): adjust type exports (#4407) 2021-09-01 16:49:12 -04:00
zhangenming 9043d0dca7
refactor(reactivity): use explicit assignments. (#4401) 2021-08-23 18:32:58 -04:00
Evan You 951fbb197b Revert "chore: add missing space in warning message (#4359) [ci skip]"
This reverts commit c68cba82ea.
2021-08-17 12:18:54 -04:00
zhangenming d8da4214fc
refactor(reactivity): reduce variable access (#4366) 2021-08-17 12:11:52 -04:00
okbug c68cba82ea
chore: add missing space in warning message (#4359) [ci skip] 2021-08-17 11:28:33 -04:00
Haoqun Jiang 7c4e4514d1
chore: rename `onDispose` to `onScopeDispose` in warnings and tests (#4355) 2021-08-16 18:19:06 -04:00
webfansplz e04680b0aa
test(reactivity): add test case for effectScope (#4239) 2021-08-10 13:59:58 -04:00
Amour1688 d3d5ad204d
fix(types): remove explicit return type annotation requirement for `this` inference in computed options (#4221) 2021-08-02 09:18:35 -04:00
Evan You 13c69469f2 refactor: simplify for size 2021-07-29 10:45:05 -04:00
Bas van Meurs 91f29540fe
refactor(reactivity): optimize child effect scope dereferencing (#4184) 2021-07-29 10:26:24 -04:00
Evan You 1867591e7c fix(reactivity): dereference nested effect scopes on manual stop 2021-07-28 12:08:01 -04:00
Pick da6c055b19
types(reactivity): simplify UnwrapNestedRefs (#4194) 2021-07-28 11:15:08 -04:00
Pick b79e4ca717
types(reactivity): Simplify the SymbolExtract (#4162) 2021-07-28 11:12:46 -04:00
Evan You 2581cfb707 fix(types): fix types for readonly ref
fix #4180
2021-07-23 15:24:58 -04:00
Evan You 14ca881a1b feat(reactivity): deferredComputed
Note: this is not exposed as part of Vue API, only as
a lower-level API specific to @vue/reactivity
2021-07-20 17:39:19 -04:00
Evan You 33c2fbfdc8 fix(reactivity): revert computed scheduler change
fix #4157
2021-07-20 16:45:29 -04:00
Evan You 47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Evan You 6eb47f000a fix(reactivity): computed should not trigger scheduler if stopped
fix #4149
2021-07-19 13:37:03 -04:00
Evan You 5cea9a1d4e feat(reactivity): support onTrack/onTrigger debug options for computed 2021-07-16 14:30:49 -04:00
Evan You 2dd4739089 test: more test cases for computed w/ scheduler 2021-07-16 14:30:49 -04:00
Evan You 1fe2239270 refactor: sync value access for chained computed w/ scheduler 2021-07-16 14:30:49 -04:00
Evan You 979a841946 chore: use consistent file naming 2021-07-16 14:30:49 -04:00
Evan You eae7c247af refactor: reduce bundle size 2021-07-16 14:30:49 -04:00
Bas van Meurs 6cf2377cd4 perf(reactivity): use bitwise dep markers to optimize re-tracking (#4017) 2021-07-16 14:30:49 -04:00
Evan You cc09772d55 chore: remove unncessary property on ComputedRef interface 2021-07-16 14:30:49 -04:00
Evan You ebaac9a56d perf(reactivity): avoid triggering re-render if computed value did not change 2021-07-16 14:30:49 -04:00
Anthony Fu f5617fc3bb feat(reactivity): new effectScope API (#2195) 2021-07-16 14:30:49 -04:00
Evan You 87f69fd0bb perf(reactivity): improve reactive effect memory usage (#4001)
Based on #2345 , but with smaller API change

- Use class implementation for `ReactiveEffect`
- Switch internal creation of effects to use the class constructor
- Avoid options object allocation
- Avoid creating bound effect runner function (used in schedulers) when not necessary.
- Consumes ~17% less memory compared to last commit
- Introduces a very minor breaking change: the `scheduler` option passed to `effect` no longer receives the runner function.
2021-07-16 14:30:49 -04:00
Evan You b2554aefba refactor: small bundle size / readability optimization 2021-07-16 14:30:49 -04:00
Bas van Meurs 64310405ac perf(reactivity): ref-specific track/trigger and miscellaneous optimizations (#3995) 2021-07-16 14:30:49 -04:00
TheDro 1cfe290352
fix(reactivity): call array subclass methods (#3624)
fix #2314, close #2315
2021-07-15 17:17:13 -04:00
Yang Mingshan 08f504c1b7
fix(ref): should not trigger when setting value to same proxy (#3658) 2021-07-15 16:28:01 -04:00
Carlos Rodrigues f6a5f09a3a
types(defineComponent): fix unwrap when returning `Ref<T>|undefined` from `setup` (#4100) 2021-07-15 15:58:20 -04:00
Evan You 127ed1b969 fix(types): improve type of unref()
fix #3954
2021-07-01 15:20:49 -04:00
Evan You f8a6b57ddd refactor(reactivity): improve tree-shaking annotations 2021-06-30 11:39:31 -04:00
zhangenming 960ef1691f
chore(reactivity): remove unnecessary RefImpl _shallow default value (#3895) 2021-06-08 09:58:02 -04:00
Evan You 03a7a73148 fix(reactivity): ensure computed always expose value
fix #3099

Also changes the original fix for #910 by moving the fix from
reactivity to the scheduler
2021-05-27 20:53:21 -04:00
Lo Leon 90aa835812
fix(types/reactivity): error TS4058 caused by `RefSymbol` (#2548) 2021-05-24 16:36:08 -04:00
Yunfei He 49fd1696c9
chore(types): remove unnecessary type assertion (#3724) 2021-05-12 17:47:52 -04:00
HcySunYang 5036c51cb7
fix(reactivity): fix tracking for readonly + reactive Map (#3604)
fix #3602
2021-05-07 18:49:11 -04:00
liaoliao666 c61e767422
fix(reactivity): should not trigger when setting value to same proxy (#2904) 2021-03-29 17:52:57 -04:00
Thorsten Lünborg 22cc4a7659
fix(reactivity): ensure that shallow and normal proxies are tracked seperately (close #2843) (#2851)
fix #2843
2021-03-26 15:39:56 -04:00
HcySunYang 68de9f408a
fix(reactivity): fix shallow readonly behavior for collections (#3003)
fix #3007
2021-03-26 15:10:21 -04:00
HcySunYang 2b588cf1bc
fix(types): unwrap refs on public instance data (#3319)
fix #3315
2021-03-25 17:30:10 -04:00
Evan You 41e02f0fac fix(reactivity): ensure computed can be wrapped by readonly
fix #3376
2021-03-25 11:23:34 -04:00
Cédric Exbrayat 57e1aa815b
chore: fix ownKeys signature (#3313) 2021-03-03 11:26:49 -05:00
zhufengzhufeng 9cd988342c
perf(reactivity): only call Set.add if doesn't already have value (#3307) 2021-02-25 14:57:35 -05:00
HcySunYang dd02cf37d5
perf(reactivity): should not track `__isVue` (#2940) 2021-02-03 19:28:07 +01:00
07akioni 4ca4666d58
fix(toRef): ref created from union typed prop can't be used in watch (#3048) 2021-02-03 19:12:51 +01:00
Evan You e315d84936 fix(types): fix ToRefs type on union value types
fix #2687
2020-12-02 14:58:03 -05:00
Thorsten Lünborg 6e46a574ed
fix(reactivity): ensure add/set on reactive collections return the proxy (#2534)
fix #2530
2020-11-27 14:16:00 -05:00
Thorsten Lünborg 34703082fd
fix(reactivity): ensure readonly on plain arrays doesn't track array methods. (#2506)
fix #2493
2020-11-27 10:24:31 -05:00
Evan You 8e20375372 fix(types): ensure correct type for toRef and toRefs on existing refs 2020-10-27 18:50:34 -04:00
Evan You 118502a4b8 chore: comments [ci skip] 2020-10-23 14:37:09 -04:00
Evan You 0e5a3c47a7 fix(reactivity): track length on for in iteration on Array
fix #2427
2020-10-19 17:37:35 -04:00
Lory Lee 6b8cf998c4
chore: add missing space in warning message (#2266) [ci skip] 2020-10-13 16:18:22 -04:00
edison af1f5d33aa
refactor(reactivity): remove `keyIsSymbol` (#2262) 2020-10-13 16:17:52 -04:00
Yang Mingshan 7cc09ca8a5
fix(reactivity): use resetTracking instead of enableTracking (#2174) 2020-10-13 15:32:46 -04:00
Evan You 390589ec6d fix(reactivity): should not trigger watch on computed ref when value is unchanged
fix #2231
2020-10-06 18:16:20 -04:00
HcySunYang ea1f87eabf
fix(reactivity): should add allowRecurse to the effect (#2213)
So that the scheduler also respects effect's allowRecurse option.

fix #2200
2020-10-05 16:36:02 -04:00
Nathan Shively-Sanders d52d139b85
types: fix Typescript 4.1 compile error (#2219)
close #2218
2020-09-28 12:39:14 -04:00
ᴜɴвʏтᴇ f316a332b0
fix(reactivity): avoid length mutating array methods causing infinite updates (#2138)
fix #2137

Co-authored-by: Evan You <yyx990803@gmail.com>
2020-09-18 01:01:36 -04:00
Evan You 3810de7d6b fix(reactivity): effect shoud only recursively self trigger with explicit options
fix #2125
2020-09-16 10:52:31 -04:00
Carlos Rodrigues 4fd468aced
types(runtime-core): refactor defineComponent (#1883) 2020-09-15 11:46:11 -04:00
Carlos Rodrigues d4bf9bcbb4
fix(reactivity): `toRef` should not wrap a `ref` (#2103) 2020-09-15 10:29:38 -04:00
Pick fcf9b2cf19
fix(reactivity): should trigger collection's write-function correctly on non-reactive keys (#1992) 2020-09-14 21:31:04 -04:00
Evan You 0124eacc91 refactor(reactivity): refactor iteration key trigger logic + use more robust Map/Set check 2020-09-14 11:26:34 -04:00
Evan You 5f4053967c fix(reactivity): revert ac81dcf
fix #2043
2020-09-04 11:10:26 -04:00
Evan You 691a4b9530 perf(reactivity): no need to proxy has/ownKeys for readonly objects 2020-09-01 20:52:48 -04:00
Pick 97bc30edad
perf(reactivity): avoid triggering Map.has twice on non-reactive keys (#1972) 2020-08-26 11:41:18 -04:00
xxgjzftd d5c4f6ed4d
perf(reactivity): add existing index or non-integer prop on Array should not trigger length dependency (#1969) 2020-08-26 11:28:58 -04:00
Evan You 016ba116a8 fix(reactivity): fix iOS 12 JSON.stringify error on reactive objects
- Use WeakMap for raw -> reactive/readonly storage. This is slightly
  more expensive than using a field on the taget object but avoids
  polluting the original.

- also fix Collection.forEach callback value

fix #1916
2020-08-24 15:34:04 -04:00
Robbin Baauw 07919e0065
perf(reactivity): improve ref performance by using class-based implementation (#1900) 2020-08-21 13:47:41 -04:00
ᴜɴвʏтᴇ 3c05f8bbd6
fix(reactivity): unwrap non-index accessed refs on reactive arrays (#1859)
close #1846
2020-08-21 13:36:41 -04:00
Carlos Rodrigues c86e7ad11b
types(reactivity): improve typings for `shallowRef` (#1780) 2020-08-18 23:34:29 -04:00
Jordan Pittman 4172fdb90c
feat(reactivity): return array when calling `toRefs` on array (#1768)
close #1764
2020-08-18 12:11:13 -04:00
ᴜɴвʏтᴇ d005b578b1
fix(reactivity): accept subtypes of collections (#1864) 2020-08-17 12:17:46 -04:00
Pick 44448fdd22
types(reactivity): add dts for proxyRefs & improve typings (#1786) 2020-08-14 17:37:36 -04:00
Evan You ac81dcf0cc fix(reactivity): effect should still check sync self-trigger 2020-08-13 17:45:21 -04:00
Evan You 50adc014f5 refactor(reactivity): readonly collections should not track 2020-08-06 12:10:03 -04:00
Evan You ed4381020f fix(reactivity): readonly+reactive collection should also expose readonly+reactive values
fix #1772
2020-08-06 11:18:16 -04:00
wujieZ 2787c34cd4
fix(reactivity): use isExtensible instead of isFrozen (#1753)
close #1784
2020-08-05 11:53:50 -04:00
Evan You aa06b1034d
feat(reactivity): `proxyRefs` method and `ShallowUnwrapRefs` type (#1682)
* feat(reactivity): `proxyRefs` method and `ShallowUnwrapRefs` type

BREAKING CHANGE: template auto ref unwrapping are now applied shallowly,
i.e. only at the root level. See https://github.com/vuejs/vue-next/pull/1682 for
more details.
2020-07-28 16:30:56 -04:00
Evan You 730e39eb76 refactor: remove unnecessary conditions and test case 2020-07-28 12:26:14 -04:00
Evan You b7ef38b773 fix(reactivity): fix ref mutation debugger event values 2020-07-28 12:01:34 -04:00
Evan You 7edfdf7e23 fix(reactivity): avoid tracking internal symbols in has trap
fix #1683
2020-07-22 21:23:32 -04:00
Zardddddd60 3e412c10e0
refactor(reactive): reduce code size by assigning to a local variable (#1634) 2020-07-21 10:33:09 -04:00
Carlos Rodrigues dabdc5e115
feat(computed): add readonly flag if no setter is provided (#1654) 2020-07-20 17:35:31 -04:00
Pick 527c2c8bbb
feat(types): expose DeepReadonly type (#1606) 2020-07-17 09:28:50 -04:00
Zardddddd60 ecf872fc95
refactor(reactive): remove unnecessary args handling in reactiveEffect (#1593) 2020-07-15 23:19:15 -04:00
Evan You 4535b1bde8 chore: remove outdated options 2020-07-15 17:05:00 -04:00
Pick b772bba558
feat(types/reactivity): use `DeepReadonly` type for `readonly` return type (#1462)
close #1452
2020-07-15 09:27:21 -04:00
Felix Rilling 829b35e426
chore: typo fixes (#1546)
* chore: fix typos in comments/JSDoc.

* chore: fix typo in internal function name.

* chore: fix typos in test comments/descriptions/variable names.
2020-07-08 12:32:42 +02:00
Pick 4f6460a71f
chore(reactivity): remove unused comment (#1485) [ci skip] 2020-07-06 15:57:54 -04:00
Pick 5c490f1c45
refactor(computed): deprecated computedRunners (#1458) 2020-07-01 15:39:13 -04:00
Pick c69ca88c04
refactor(types): simplify UnwrapRefSimple (#1466) 2020-06-30 12:02:21 -04:00
Evan You 82b28a5ecb fix(types): should unwrap array -> object -> ref 2020-06-29 12:26:28 -04:00
edison 178e89305d
chore(reactivity): use consistent naming for ReactiveFlags enum (#1428) 2020-06-26 09:32:09 -04:00
Pick f54be6a462
refactor(types): simplify UnwrapRef + specify iterable method return type (#1444) 2020-06-25 12:04:14 -04:00
underfin c43a6e61a0
perf(reactivity): should not track `__v_isRef` (#1392) 2020-06-25 11:40:49 -04:00
Pick 8899a90fc4
refactor(types): simplified UnwrapRef (#1390) 2020-06-17 16:06:55 -04:00
Evan You d863ce721f refactor: improve base getter readability 2020-06-12 09:25:40 -04:00