Great thanks to @pikax for #311, making most of the APIs better aligned with the latest vue-next.
BREAKING CHANGE
- The
lazy
option ofwatch
has been replaced by the oppositeimmediate
option, which defaults to false. (It's ignored when using the effect signature). more details (#266) - Rename
nonReactive
tomarkRaw
watchEffect
now follows the same behaviour as v3 (triggers immediately).UnwrapRef
types fromvue-next
this can cause some incompatibilities.
Bug Fixes
- Added missing reactivity API from vue-next, #311, @pikax
- Fix return type of
toRefs
, #315 - Fix incorrect ref typing, #344, @antfu
- Binding context vm when using function without parentheses, #148, @pikax
- computed: destroy helper vm of computed to prevent memleak, #277, @LinusBorg
- Remove the surplus Function type from PropType, #352, @pikax
Features
- Added
unref
(#309),isReactive
(#327),toRef
(#313),UnwrapRef
(#247) - Added
shallowReactive
,shallowRef
- Added
toRaw
getCurrentInstance
available on the lifecycle hooks (onMounted
, etc)getCurrentInstance
returnsundefined
when called outside setup instead of throwing exception
Types
- Align reactivity types with
vue-next