Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
brawaru committed Oct 31, 2023
2 parents 7c70c3f + ba8cea3 commit bf2d99e
Show file tree
Hide file tree
Showing 55 changed files with 2,447 additions and 266 deletions.
19 changes: 19 additions & 0 deletions .changeset/happy-clocks-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@vintl/vintl': minor
---

Add more formatting components similar to `react-intl`

- `FormattedDate`, `FormattedDateParts`
- `FormattedTime`, `FormattedTimeParts`
- `FormattedDateTimeRange`
- `FormattedRelativeTime` (static, unlike `react-intl`)
- `FormattedNumber`, `FormattedNumberParts`
- `FormattedPlural`
- `FormattedList`, `FormattedListParts`
- `FormattedDisplayName`
- `FormattedMessage`

Since this is a Vue library, they use slots to pass formatted values (otherwise rendering them as is).

`FormattedMessage` is very similar to `IntlFormatted`, but accepts descriptor properties and does not allow to format raw messages.
27 changes: 27 additions & 0 deletions .changeset/new-turkeys-pump.md
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.
7 changes: 7 additions & 0 deletions .changeset/olive-bugs-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@vintl/vintl': major
---

Bump Vue version to 3.3.4

We're now requiring a newer Vue version because we are relying on functionality added in Vue 3.3, such as generic components. Since it's not compatible with previous versions of Vue, this is marked as a breaking change.
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@vintl/vintl": "4.2.0"
},
"changesets": []
}
7 changes: 7 additions & 0 deletions .changeset/tender-zoos-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@vintl/vintl': minor
---

Add `useMessages` composable

v5 introduces a new API that allows you to create messages more effectively.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"indent": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "warn",
"vue/one-component-per-file": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off"
},
"parserOptions": {
Expand All @@ -41,7 +42,7 @@
"parserOptions": { "project": "./tsconfig.build.json" }
},
{
"files": ["./vitest.config.ts", "./test/*.test.ts"],
"files": ["./vitest.config.ts", "./test/**/*.ts", "./test/**/*.tsx"],
"parserOptions": { "project": "./tsconfig.tests.json" }
}
]
Expand Down
8 changes: 7 additions & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineBuildConfig({
outDir: './dist',
},
{
input: './src/components',
input: './src/components/index',
name: 'components',
builder: 'rollup',
declaration: true,
Expand All @@ -79,4 +79,10 @@ export default defineBuildConfig({
},
],
declaration: true,
rollup: {
esbuild: {
jsx: 'automatic',
jsxImportSource: 'vue',
},
},
})
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@testing-library/vue": "^7.0.0",
"@types/node": "^18.18.7",
"@vue/runtime-core": "^3.3.7",
"del-cli": "^5.1.0",
Expand All @@ -86,17 +87,19 @@
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vitepress": "1.0.0-rc.24",
"vitest": "^0.34.6"
"vitest": "^0.34.6",
"vue": "^3.3.7"
},
"dependencies": {
"@braw/async-computed": "^5.0.2",
"@formatjs/ecma402-abstract": "^1.17.2",
"@formatjs/icu-messageformat-parser": "^2.7.0",
"@formatjs/intl": "^2.9.5",
"@formatjs/intl-localematcher": "^0.4.2",
"intl-messageformat": "^10.5.4"
},
"peerDependencies": {
"vue": "^3.2.47"
"vue": "^3.3.7"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit bf2d99e

Please sign in to comment.