Skip to content

Commit 9582d5c

Browse files
authored
docs: v5.1 notes (#1138)
1 parent 7db2643 commit 9582d5c

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Supports Chart.js v4 and v3.
1818
[downloads]: https://img.shields.io/npm/dm/react-chartjs-2.svg
1919
[downloads-url]: https://www.npmjs.com/package/react-chartjs-2
2020

21-
[build]: https://img.shields.io/github/workflow/status/reactchartjs/react-chartjs-2/CI.svg
21+
[build]: https://img.shields.io/github/actions/workflow/status/reactchartjs/react-chartjs-2/ci.yml?branch=master
2222
[build-url]: https://github.com/reactchartjs/react-chartjs-2/actions
2323

2424
[coverage]: https://img.shields.io/codecov/c/github/reactchartjs/react-chartjs-2.svg

website/docs/faq/esm-only.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,4 @@ slug: /faq/esm-only
44

55
# How to fix "Cannot find module 'react-chartjs-2'" error?
66

7-
Chart.js v4 and react-chartjs-2 v5 are [ESM-only packages](https://nodejs.org/api/esm.html). To use them in your project, it also should be ESM:
8-
9-
```json title="package.json"
10-
{
11-
"type": "module"
12-
}
13-
```
14-
15-
If you are experiencing this problem with Jest, you should follow [this doc](https://jestjs.io/docs/ecmascript-modules) to enable ESM support. Or, we can recommend you migrate to [Vitest](https://vitest.dev/). Vitest has ESM support out of the box and [has almost the same API as Jest](https://vitest.dev/guide/migration.html#migrating-from-jest). [Here is our example of migration](https://github.com/reactchartjs/react-chartjs-2/commit/7f3ec96101d21e43cae8cbfe5e09a46a17cff1ef).
16-
7+
Upgrade to Chart.js v4.1 and react-chartjs-2 v5.1, where the CommonJS support was restored.

website/docs/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Supports Chart.js v4 (read below) and Chart.js v3 (see [this guide](/docs/chartj
2727
[downloads]: https://img.shields.io/npm/dm/react-chartjs-2.svg
2828
[downloads-url]: https://www.npmjs.com/package/react-chartjs-2
2929

30-
[build]: https://img.shields.io/github/workflow/status/reactchartjs/react-chartjs-2/CI.svg
30+
[build]: https://img.shields.io/github/actions/workflow/status/reactchartjs/react-chartjs-2/ci.yml?branch=master
3131
[build-url]: https://github.com/reactchartjs/react-chartjs-2/actions
3232

3333
[coverage]: https://img.shields.io/codecov/c/github/reactchartjs/react-chartjs-2.svg

website/docs/migration-to-v5.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ description: react-chartjs-2 migration guide to v5
55

66
# Migration to v5
77

8+
## v5.0
9+
810
Chart.js v4 and react-chartjs-2 v5 are [ESM-only packages](https://nodejs.org/api/esm.html). To use them in your project, it also should be ESM:
911

1012
```json title="package.json"
1113
{
1214
"type": "module"
1315
}
1416
```
17+
18+
## v5.1
19+
20+
Chart.js v4.1 and react-chartjs-2 v5.1 have restored the CommonJS support.

0 commit comments

Comments
 (0)