1.7.2 (2023-08-15)
1.7.1 (2022-09-23)
1.7.0 (2022-07-01)
- add note about Vue 2.7 (6117f81)
1.6.3 (2022-06-24)
1.6.2 (2022-05-23)
1.6.1 (2022-05-05)
1.6.0 (2022-04-27)
1.5.0 (2022-04-25)
- createElement: allow createElement to bind vm (#920) (564a5a4)
- Unified as the key of raw in vue3 (#922) (5874eb5)
1.4.10 (2022-03-16)
1.4.9 (2022-02-26)
1.4.8 (2022-02-26)
- types: optional Boolean props as default props (#909) (8f88ae6)
- use registered Vue instance for warning (b01f1e4)
1.4.7 (2022-02-24)
1.4.6 (2022-02-07)
1.4.5 (2022-01-27)
- reactive: remove useless proxy logic of shallowReactive (#890) (7243ffa)
- shallowReactive: don't trigger watchers for oldVal === newVal (#894) (2a88e71)
1.4.4 (2022-01-16)
- types:
emit
type in SetupContext (#884) (5c35403) - types: update inject and unref type (#888) (315f6ab)
1.4.3 (2021-12-27)
- #874 setup return object with type of Module (#875) (a1a3e11)
- improve register check, close #876 (#878) (3c2ad93)
1.4.2 (2021-12-17)
1.4.1 (2021-11-30)
1.4.0 (2021-11-14)
1.4.0-beta.0 (2021-11-07)
1.3.3 (2021-11-03)
1.3.2 (2021-11-03)
1.3.1 (2021-11-01)
1.3.0 (2021-10-28)
1.2.4 (2021-10-07)
1.2.3 (2021-10-05)
- proxyRefs: When using proxyRefs, the internal variable composition-api.refKey is exposed on the object itself #817 (#818) (92b7eb1)
- ssr:
set()
twice lose reactivity (#821) (416845a) - correct prop type inference when using PropType (#825) (9c9f8e8)
1.2.2 (2021-09-24)
1.2.1 (2021-09-21)
- types: align ComponentPublicInstance type (2f9cfbf)
1.2.0 (2021-09-21)
1.1.5 (2021-09-09)
- improve
isReadonly
behaviour, close #811, close #812 (d3c456a) - api-watch: watching nested ref array w/ deep doesn't work (#808) (b625420)
1.1.4 (2021-08-31)
- types: align emits type with vue-next (565cbd1)
1.1.3 (2021-08-22)
1.1.2 (2021-08-21)
- set: reactive in SSR w/ set (#796) (3a1837f)
- setup: should not trigger getter w/ object computed nested (#799) (72a878d)
- watch: always triggers when watching multiple refs (#791) (8beffc3)
- typos (#788) (59653ac)
1.1.1 (2021-08-14)
1.1.0 (2021-08-09)
- align with Vue v3.2
- new
watchPostEffect
api (92fe90c) - new
watchSyncEffect
api (e12c23d) - new
effectScope
api (#762) (fcadec2)
1.0.6 (2021-08-09)
- support second target argument for lifecycle functions (3f3b9c6)
1.1.0-beta.7 (2021-08-09)
- effectScope: should have a vaild scope with component (da21873)
1.1.0-beta.6 (2021-08-09)
1.1.0-beta.4 (2021-07-22)
1.1.0-beta.3 (2021-07-18)
- build for mjs and exports all submodules (c116714)
1.1.0-beta.2 (2021-07-16)
- effectScope: should stop along with parent component (784d96c)
1.1.0-beta.1 (2021-07-16)
- implement
effectScope
api (#762) (fcadec2) - support second target argument for lifecycle functions (3f3b9c6)
1.0.6 (2021-08-09)
1.0.5 (2021-08-01)
1.0.4 (2021-07-22)
1.0.3 (2021-07-18)
- build for mjs and exports all submodules (69538ee)
1.0.2 (2021-07-16)
- readonly: align behavior with vue-next. (#765) (42104aa)
- type: remove unnecessary type assertion (#766) (ebb7975)
- should dynamically update refs in context (#764) (d7de23e)
1.0.1 (2021-07-16)
1.0.0 (2021-07-15)
- mockReactivityDeep: add parameter seen for mockReactivityDeep. (#759) (40cb14a)
- runtime-core: trigger warning when the injectionKey is undefined (#760) (2ccad9b)
1.0.0-rc.14 (2021-07-12)
- customReactive: avoid circular reference. (#758) (2bd6ea5)
- watch: traverse refs in deep watch (#753) (55a0a20)
- only trigger warning in the dev environment (#755) (bc7c2af)
- watch: errors thrown in the asynchronous callback function in watch will not be caught. (#751) (f0e423f)
- watch: only trigger warning in the dev environment (#754) (0fe0088)
1.0.0-rc.13 (2021-07-02)
- observe: solve the Ref not unwrapping on the ssr side issue with recursive way. (#723) (debd37d)
- the hasOwn should be used to determine whether an attribute exists. (#737) (65abcb4)
- shallowReadonly: align behavior with vue-next (#741) (14d1c7b)
- types: use AnyObject insteads of any (#742) (efb4195)
1.0.0-rc.12 (2021-06-17)
- proxyRefs: infinite loop when using proxyRefs. (#730) (0b6ab25)
- reactivity: check type of ob in isRaw and isReactive (#732) (97dd671)
- watch: watched previous values can't be destructure on first fire. (#727) (b3ab6f9)
1.0.0-rc.11 (2021-06-04)
- reactivity: should trigger watchEffect when using set to change value of array length (#720) (9c03a45)
- reactivity: unexpected behaviors for array index out of valid array length when set and del (#719) (f08a1d6)
- shallowReactive: should keep array as array (#717) (620d09b)
- shallowReadonly: watch should work for ref/reactive with shallowReadonly (#714) (b6fc1f7)
1.0.0-rc.10 (2021-05-27)
- dev: setup data in nextTick is proxied to vm._data. (#697) (e231837)
- watch: align behavior with vue-next(doWatch). (#710) (fcf8bc3)
1.0.0-rc.9 (2021-05-19)
- The behavior of development and production merge should be consistent. (#694) (7ca7010)
- shallowReactive: align behavior with vue-next (#696) (3485ecb)
1.0.0-rc.8 (2021-04-29)
- reactive: align behavior with vue-next (#689) (37fcbaa)
- Memory leak caused by global variables. (#686) (badff82)
1.0.0-rc.7 (2021-04-18)
1.0.0-rc.6 (2021-03-29)
1.0.0-rc.5 (2021-03-11)
1.0.0-rc.4 (2021-03-11)
1.0.0-rc.3 (2021-03-03)
1.0.0-rc.2 (2021-02-18)
1.0.0-rc.1 (2021-01-20)
1.0.0-beta.26 (2021-01-14)
- types: expose ExtractPropTypes type, close #628 (903a0aa)
- change duplicate installation from error to warn, close #631 (#632) (5301d49)
- Date infer string in props (#627) (b2acb2d)
1.0.0-beta.25 (2021-01-08)
useCSSModule
renamed touseCssModule
to align with Vue 3 (#626)useCSSModule
is depreacted.
1.0.0-beta.24 (2021-01-06)
1.0.0-beta.23 (2021-01-05)
- useCSSModule to adapt the change of getCurrentInstance, close #620 (#622) (2ddead0)
- README: The correct option name is
emits
(#617) (4b2f1ab)
1.0.0-beta.22 (2020-12-19)
- getCurrentInstance: The internal vm can be accessed with
getCurrentInstance().proxy
const vm = getCurrentInstance()
// becomes
const vm = getCurrentInstance().proxy
1.0.0-beta.21 (2020-12-07)
1.0.0-beta.20 (2020-11-24)
1.0.0-beta.19 (2020-11-02)
- types: allow any custom options for defineComponent, fix #579 (#584) (7cdf1e5)
- types: attrs in SetupContext fix#562 (#582) (2d6de26)
- types: this type in data(), fix #570 (#576) (9a5b438)
1.0.0-beta.18 (2020-10-21)
- type: vue constructor should not require props with default values (#567) (964f9f3)
- better
vueDependency
importing, close #564 (#572) (555f20a)
1.0.0-beta.17 (2020-10-17)
-
watch APIs now default to use
flush: 'pre'
instead offlush: 'post'
.-
Check https://github.com/vuejs/vue-next/commit/49bb44756fda0a7019c69f2fa6b880d9e41125aa
-
This change affects
watch
,watchEffect
, thewatch
component option, andthis.$watch
. -
As pointed out by @skirtles-code in
-
1.0.0-beta.16 (2020-10-10)
- SSR: value set for props, fix #550 (#551) (5b1b094)
- add emits options to defineComponent(fix #553) (#554) (e44311f)
1.0.0-beta.15 (2020-10-04)
- reactive: fix issue when using reactive
array
in the template (#532) (d99b91d) reactive
in SSR (#546) (535c829)- incorrect warning for
getRegisteredVueOrDefault
, resolve #544 (3a1d992) - reactive for props (#547) (4d39443)
- vue-test: prevent warning when using multiple
localVue
(#531) (5484bb7)
1.0.0-beta.14 (2020-09-15)
1.0.0-beta.13 (2020-09-12)
1.0.0-beta.12 (2020-09-12)
- allow plugin to be installed in localVue (#497) (07be9d7)
- improve reactive checks (#502) (255dc72)
- inject: add
treatDefaultAsFactory
argument (#503) (78592bf)
1.0.0-beta.11 (2020-08-22)
- setup: handle updates for directly return a reactive object (#488) (a7f2c25), closes #487
- watch: check if ob has value before addSub (#477) (d8cd30d)
1.0.0-beta.10 (2020-08-15)
1.0.0-beta.9 (2020-08-11)
1.0.0-beta.8 (2020-08-07)
1.0.0-beta.7 (2020-08-07)
- template auto ref unwrapping are now applied shallowly, i.e. only at the root level. See vuejs/core#1682 for more details.
1.0.0-beta.6 (2020-07-22)
1.0.0-beta.5 (2020-07-20)
1.0.0-beta.4 (2020-07-18)
- IE11: replace
startsWith
to be IE11 compatible (#442) (b31c74a) - type: fix tying issues in #428 (#444) (98c7041)
1.0.0-beta.3 (2020-07-09)
1.0.0-beta.2 (2020-07-05)
- prevent multiple plugins get installed (#427) (94d4d87)
- remove "browser" field in package.json (#424) (4ebeda4)
- toRaw typo (#429) (9468f72)
1.0.0-beta.1 (2020-06-30)
- change umd exported name to
VueCompositionAPI
(#399) - rename
createElement
toh
(#400) - drop
createComponent
(#389) - match dist file naming with vue-next (#413)
- unwrapRef: copy ob and make toRaw work in props (#409) (5f23886), closes #392
- nextTick await (#414) (85ffede)
- type: accept undefined return for setup() (#417) (64b16ff)
0.6.7 (2020-06-24)
- toRefs: do not warn when toRefs is called in a prop value (#405) (048b6d3)
- type: improve defineComponent type for option apis (#406) (1c64108)
0.6.6 (2020-06-21)
0.6.5 (2020-06-19)
- watchEffect: prevent recursive calls when using
flush:sync
(#389) (f7f1e77) - not unwrapping
markRaw
objects (#386) (575d100) - unwrap refs returned by
data
(#387) (1f07075)
0.6.4 (2020-06-16)
- setup: call stack exceeded when returning circular dependency (#380) (66f58ba)
- setup: Vue.extend(Comp).extend({}) - vue-test-utils (#383) (ce932bf)
0.6.3 (2020-06-12)
0.6.2 (2020-06-11)
- reactivity: unwrap nested refs on the template (#361) (1fd48f5)
- defineComponent() with array props (#364) (d7048d4)
- setup: Allow retuning frozen objects on the setup (#366) (bca3a69)
- mark props as reactive (#359) (bc78428)
__DEV__
is not defined, #355, @yoyo930021
Great thanks to @pikax for #311, making most of the APIs better aligned with the latest vue-next.
- 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.
- 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
- 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
- Align reactivity types with
vue-next
- New:
watchEffect
function, lingin up with the latest version of the RFC (RFC docs) (#275) - Fix:
setup
from a mixin should called before the component's own (#276) - Fix(types): Fix corner case in
UnWrapRef
internal type (#261) - types: Add
Element
to bailout types for unwrapping (#278)
- Refactor: rename
createComponent
todefineComponent
(thecreateComponent
function is still there but deprecated) #230 - Fix: correct the symbol check; fixes the compatibility issue in iOS 9 #218
- Fix: avoid accessing undeclared instance fields on type-level; fixes Vetur template type checking; fixes vue-router type compatibility #189
- Fix:
onUnmounted
should not be run ondeactivated
#217
- Fixed
reactive
setter not working on the server. - New
isServer
setup context property.
- Fixed make
__ob__
unenumerable #149. - Fixed computed type
- Expose
getCurrentInstance
for advanced usage in Vue plugins. - New
onServerPrefetch
lifecycle hook and newssrContext
setup context property #198.
- Improve TypeScript type infer for
props
option #106. - Fix return type of
createComponent
not being compatible withvue-router
#130. - Expose
listeners
onSetupContext
#132.
- Fix cleaup callback not running when watcher stops #113.
- Fix watcher callback not flushing at right timing #120.
- Improve TypeScript type definitions.
- Fix
context.slots
not being available before render #84.
The render
function returned from setup
no longer receives any parameters.
export default {
setup() {
return props => h('div', prop.msg);
},
};
export default {
setup(props) {
return () => h('div', prop.msg);
},
};
-
Declare your expected prop types directly in TypeScript:
import { createComponent, createElement as h } from '@vue/composition-api'; interface Props { msg: string; } const MyComponent = createComponent < Props > { props: { msg: {}, // required by vue 2 runtime }, setup(props) { return () => h('div', props.msg); }, };
-
Declare ref type in TypeScript:
const dateRef = ref < Date > new Date();
-
Fix
createComponent
not working withimport()
#81. -
Fix
inject
type declaration #83.
computed
property is called immediately inreactive()
#79.
- rename
onBeforeDestroy()
toonBeforeUnmount()
lifecycle-hooks. - Remove
onCreated()
lifecycle-hooks. - Remove
onDestroyed()
lifecycle-hooks.
The package has been renamed to @vue/composition-api
to be consistent with RFC.
The @vue/composition-api
reflects the Composition API RFC.
- Improve typescript support.
- Export
createElement
. - Export
SetupContext
. - Support returning a render function from
setup
. - Allow string keys in
provide
/inject
.
- Remove auto-unwrapping for Array (#53).
- Export
set()
function. Using exportedset
whenever you need to use Vue.set or vm.$set. The customset
ensures that auto-unwrapping works for the new property. - Add a new signature of
provide
:provide(key, value)
. - Fix multiple
provide
invoking per component. - Fix order of
setup
invoking. onErrorCaptured
not triggered (#25).- Fix
this
losing in nested setup call (#38). - Fix some edge cases of unwarpping.
- Change
context.slots
's value. It now proxies to$scopeSlots
instead of$slots
.
- watch callback is called repeatedly with multi-sources
- reduce
watch()
memory overhead
Implement the newest version of RFC
this
is not available inside setup()
. See setup for details.
Complex Prop Types:
import { createComponent, PropType } from 'vue';
createComponent({
props: {
options: (null as any) as PropType<{ msg: string }>,
},
setup(props) {
props.options; // { msg: string } | undefined
},
});
Implement the init version of RFC