|
| 1 | +# 0.3.0 |
| 2 | + |
| 3 | +- Improve TypeScript type definitions. |
| 4 | +- Fix `context.slots` not being avaliable before render [#84](https://github.com/vuejs/composition-api/issues/81). |
| 5 | + |
| 6 | +## Changed |
| 7 | + |
| 8 | +The `render` function returned from `setup` no longer receives any parameters. |
| 9 | + |
| 10 | +### Previous |
| 11 | + |
| 12 | +```js |
| 13 | +export default { |
| 14 | + setup() { |
| 15 | + return props => h('div', prop.msg); |
| 16 | + }, |
| 17 | +}; |
| 18 | +``` |
| 19 | + |
| 20 | +### Now |
| 21 | + |
| 22 | +```js |
| 23 | +export default { |
| 24 | + setup(props) { |
| 25 | + return () => h('div', prop.msg); |
| 26 | + }, |
| 27 | +}; |
| 28 | +``` |
| 29 | + |
1 | 30 | # 0.2.1 |
2 | | -* Declare your expected prop types directly in TypeScript: |
| 31 | + |
| 32 | +- Declare your expected prop types directly in TypeScript: |
| 33 | + |
3 | 34 | ```js |
4 | | - import { createComponent, createElement as h } from '@vue/composition-api' |
| 35 | + import { createComponent, createElement as h } from '@vue/composition-api'; |
5 | 36 |
|
6 | 37 | interface Props { |
7 | | - msg: string |
| 38 | + msg: string; |
8 | 39 | } |
9 | 40 |
|
10 | | - const MyComponent = createComponent<Props>({ |
11 | | - props: { |
12 | | - msg: {} // required by vue 2 runtime |
13 | | - }, |
14 | | - setup(props) { |
15 | | - return () => h('div', props.msg) |
16 | | - } |
17 | | - }) |
| 41 | + const MyComponent = |
| 42 | + createComponent < |
| 43 | + Props > |
| 44 | + { |
| 45 | + props: { |
| 46 | + msg: {}, // required by vue 2 runtime |
| 47 | + }, |
| 48 | + setup(props) { |
| 49 | + return () => h('div', props.msg); |
| 50 | + }, |
| 51 | + }; |
18 | 52 | ``` |
19 | | -* Declare ref type in TypeScript: |
| 53 | + |
| 54 | +- Declare ref type in TypeScript: |
20 | 55 | ```js |
21 | | - const dateRef = ref<Date>(new Date); |
| 56 | + const dateRef = ref < Date > new Date(); |
22 | 57 | ``` |
23 | | -* Fix `createComponent` not working with `import()` [#81](https://github.com/vuejs/composition-api/issues/81). |
24 | | -* Fix `inject` type declaration [#83](https://github.com/vuejs/composition-api/issues/83). |
25 | | - |
| 58 | +- Fix `createComponent` not working with `import()` [#81](https://github.com/vuejs/composition-api/issues/81). |
| 59 | +- Fix `inject` type declaration [#83](https://github.com/vuejs/composition-api/issues/83). |
| 60 | + |
26 | 61 | # 0.2.0 |
| 62 | + |
27 | 63 | ## Fixed |
28 | | -* `computed` property is called immediately in `reactive()` [#79](https://github.com/vuejs/composition-api/issues/79). |
| 64 | + |
| 65 | +- `computed` property is called immediately in `reactive()` [#79](https://github.com/vuejs/composition-api/issues/79). |
29 | 66 |
|
30 | 67 | ## Changed |
31 | | -* rename `onBeforeDestroy()` to `onBeforeUnmount()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
32 | | -* Remove `onCreated()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
33 | | -* Remove `onDestroyed()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
| 68 | + |
| 69 | +- rename `onBeforeDestroy()` to `onBeforeUnmount()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
| 70 | +- Remove `onCreated()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
| 71 | +- Remove `onDestroyed()` [lifecycle-hooks](https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks). |
34 | 72 |
|
35 | 73 | # 0.1.0 |
| 74 | + |
36 | 75 | **The package has been renamed to `@vue/composition-api` to be consistent with RFC.** |
37 | 76 |
|
38 | 77 | The `@vue/composition-api` reflects the [Composition API](https://vue-composition-api-rfc.netlify.com/) RFC. |
39 | 78 |
|
40 | 79 | # 2.2.0 |
41 | | -* Improve typescript support. |
42 | | -* Export `createElement`. |
43 | | -* Export `SetupContext`. |
44 | | -* Support returning a render function from `setup`. |
45 | | -* Allow string keys in `provide`/`inject`. |
| 80 | + |
| 81 | +- Improve typescript support. |
| 82 | +- Export `createElement`. |
| 83 | +- Export `SetupContext`. |
| 84 | +- Support returning a render function from `setup`. |
| 85 | +- Allow string keys in `provide`/`inject`. |
46 | 86 |
|
47 | 87 | # 2.1.2 |
48 | | -* Remove auto-unwrapping for Array ([#53](https://github.com/vuejs/composition-api/issues/53)). |
| 88 | + |
| 89 | +- Remove auto-unwrapping for Array ([#53](https://github.com/vuejs/composition-api/issues/53)). |
49 | 90 |
|
50 | 91 | # 2.1.1 |
51 | | -* Export `set()` function. Using exported `set` whenever you need to use [Vue.set](https://vuejs.org/v2/api/#Vue-set) or [vm.$set](https://vuejs.org/v2/api/#vm-set). The custom `set` ensures that auto-unwrapping works for the new property. |
52 | | -* Add a new signature of `provide`: `provide(key, value)`. |
53 | | -* Fix multiple `provide` invoking per component. |
54 | | -* Fix order of `setup` invoking. |
55 | | -* `onErrorCaptured` not triggered ([#25](https://github.com/vuejs/composition-api/issues/25)). |
56 | | -* Fix `this` losing in nested setup call ([#38](https://github.com/vuejs/composition-api/issues/38)). |
57 | | -* Fix some edge cases of unwarpping. |
58 | | -* Change `context.slots`'s value. It now proxies to `$scopeSlots` instead of `$slots`. |
| 92 | + |
| 93 | +- Export `set()` function. Using exported `set` whenever you need to use [Vue.set](https://vuejs.org/v2/api/#Vue-set) or [vm.\$set](https://vuejs.org/v2/api/#vm-set). The custom `set` ensures that auto-unwrapping works for the new property. |
| 94 | +- Add a new signature of `provide`: `provide(key, value)`. |
| 95 | +- Fix multiple `provide` invoking per component. |
| 96 | +- Fix order of `setup` invoking. |
| 97 | +- `onErrorCaptured` not triggered ([#25](https://github.com/vuejs/composition-api/issues/25)). |
| 98 | +- Fix `this` losing in nested setup call ([#38](https://github.com/vuejs/composition-api/issues/38)). |
| 99 | +- Fix some edge cases of unwarpping. |
| 100 | +- Change `context.slots`'s value. It now proxies to `$scopeSlots` instead of `$slots`. |
59 | 101 |
|
60 | 102 | # 2.0.6 |
| 103 | + |
61 | 104 | ## Fixed |
62 | | -* watch callback is called repeatedly with multi-sources |
| 105 | + |
| 106 | +- watch callback is called repeatedly with multi-sources |
63 | 107 |
|
64 | 108 | ## Improved |
65 | | -* reduce `watch()` memory overhead |
| 109 | + |
| 110 | +- reduce `watch()` memory overhead |
66 | 111 |
|
67 | 112 | # 2.0.0 |
| 113 | + |
68 | 114 | Implement the [newest version of RFC](https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md) |
69 | 115 |
|
70 | 116 | ## Breaking Changes |
| 117 | + |
71 | 118 | `this` is not available inside `setup()`. See [setup](https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md#the-setup-function) for details. |
72 | 119 |
|
73 | 120 | ## Features |
| 121 | + |
74 | 122 | Complex Prop Types: |
75 | 123 |
|
76 | 124 | ```ts |
77 | | -import { createComponent, PropType } from 'vue' |
| 125 | +import { createComponent, PropType } from 'vue'; |
78 | 126 |
|
79 | 127 | createComponent({ |
80 | 128 | props: { |
81 | | - options: (null as any) as PropType<{ msg: string }> |
| 129 | + options: (null as any) as PropType<{ msg: string }>, |
82 | 130 | }, |
83 | 131 | setup(props) { |
84 | | - props.options // { msg: string } | undefined |
85 | | - } |
86 | | -}) |
| 132 | + props.options; // { msg: string } | undefined |
| 133 | + }, |
| 134 | +}); |
87 | 135 | ``` |
88 | 136 |
|
89 | 137 | # 1.x |
90 | | - Implement the [init version of RFC](https://github.com/vuejs/rfcs/blob/903f429696524d8f93b4976d5b09dfb3632e89ef/active-rfcs/0000-function-api.md) |
| 138 | + |
| 139 | +Implement the [init version of RFC](https://github.com/vuejs/rfcs/blob/903f429696524d8f93b4976d5b09dfb3632e89ef/active-rfcs/0000-function-api.md) |
0 commit comments