-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
30 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@vintl/vintl': major | ||
--- | ||
|
||
Remove deprecated composables | ||
|
||
Composables, such as `useI18n`, `useTranslate` and `useFormatters` were previously deprecated with the warning that they will be removed in the next major version. They now get removed as scheduled. | ||
|
||
Migration steps: | ||
|
||
- Use `useVIntl` everywhere you used `useI18n`, the latter was just an alias for `useVIntl` in previous versions. | ||
|
||
- To retrieve translate function previously returned by `useTranslate`, destructure `formatMessage` function from the controller: | ||
|
||
```js | ||
const { formatMessage } = useVIntl | ||
``` | ||
|
||
It is bound to the controller and as such is safe to use on its own. | ||
|
||
- To retrieve formatters previously returned by `useFormatters`, destructure `formats` property from the controller: | ||
|
||
```js | ||
const { formats } = useVIntl | ||
``` | ||
|
||
It is reactively updated object and also safe to use on its own. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export { useI18n, useVIntl } from './useI18n.js' | ||
export { useFormatters } from './useFormatters.js' | ||
export { useTranslate } from './useTranslate.js' | ||
export { useVIntl } from './useVIntl.js' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters