Skip to content

Commit 7a8e18b

Browse files
committed
chore: update changelog
1 parent 34bbf72 commit 7a8e18b

File tree

1 file changed

+91
-42
lines changed

1 file changed

+91
-42
lines changed

CHANGELOG.md

Lines changed: 91 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,139 @@
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+
130
# 0.2.1
2-
* Declare your expected prop types directly in TypeScript:
31+
32+
- Declare your expected prop types directly in TypeScript:
33+
334
```js
4-
import { createComponent, createElement as h } from '@vue/composition-api'
35+
import { createComponent, createElement as h } from '@vue/composition-api';
536

637
interface Props {
7-
msg: string
38+
msg: string;
839
}
940

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+
};
1852
```
19-
* Declare ref type in TypeScript:
53+
54+
- Declare ref type in TypeScript:
2055
```js
21-
const dateRef = ref<Date>(new Date);
56+
const dateRef = ref < Date > new Date();
2257
```
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+
2661
# 0.2.0
62+
2763
## 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).
2966

3067
## 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).
3472

3573
# 0.1.0
74+
3675
**The package has been renamed to `@vue/composition-api` to be consistent with RFC.**
3776

3877
The `@vue/composition-api` reflects the [Composition API](https://vue-composition-api-rfc.netlify.com/) RFC.
3978

4079
# 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`.
4686

4787
# 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)).
4990

5091
# 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`.
59101

60102
# 2.0.6
103+
61104
## Fixed
62-
* watch callback is called repeatedly with multi-sources
105+
106+
- watch callback is called repeatedly with multi-sources
63107

64108
## Improved
65-
* reduce `watch()` memory overhead
109+
110+
- reduce `watch()` memory overhead
66111

67112
# 2.0.0
113+
68114
Implement the [newest version of RFC](https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md)
69115

70116
## Breaking Changes
117+
71118
`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.
72119

73120
## Features
121+
74122
Complex Prop Types:
75123

76124
```ts
77-
import { createComponent, PropType } from 'vue'
125+
import { createComponent, PropType } from 'vue';
78126

79127
createComponent({
80128
props: {
81-
options: (null as any) as PropType<{ msg: string }>
129+
options: (null as any) as PropType<{ msg: string }>,
82130
},
83131
setup(props) {
84-
props.options // { msg: string } | undefined
85-
}
86-
})
132+
props.options; // { msg: string } | undefined
133+
},
134+
});
87135
```
88136

89137
# 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

Comments
 (0)