Skip to content

Commit 654fdc9

Browse files
kingyue737Justineo
authored andcommitted
docs: update version, deps and docs for 8.0 beta (#849)
* chore: up version and deps * chore: use pnpm CLI to get versions * add note for echarts 6 upgrade guide * remove docs script let cdn to redirect for us * Revert "remove docs script" This reverts commit 3bc237d. * update demo links
1 parent 7e49190 commit 654fdc9

File tree

13 files changed

+806
-739
lines changed

13 files changed

+806
-739
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug-report.en-US.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ body:
4141
id: repro
4242
attributes:
4343
label: Reproduction
44-
description: "A link to a boiled-down reproduction (a minimal but runnable demo with unnecessary dependencies pruned). If the issue isn't reproducible within an online playground, please create a GitHub repo to reflect the problem. Please paste the link to your CodeSandbox demo or GitHub repo below: ([Vue 3 template](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 template](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
44+
description: "A link to a boiled-down reproduction (a minimal but runnable demo with unnecessary dependencies pruned). If the issue isn't reproducible within an online playground, please create a GitHub repo to reflect the problem. Please paste the link to your [StackBlitz demo](https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue) or GitHub repo below:"
4545
validations:
4646
required: true

.github/ISSUE_TEMPLATE/bug-report.zh-Hans.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ body:
4141
id: repro
4242
attributes:
4343
label: 问题复现
44-
description: "请提供一个精炼的问题复现(去除无关依赖的最小化可运行 demo)。如果在线环境无法复现,可以创建对应的 GitHub repo 来提供复现环境。请在下方贴入在 CodeSandbox 上 demo 的链接或 GitHub repo 链接:([Vue 3 模板](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 模板](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
44+
description: "请提供一个精炼的问题复现(去除无关依赖的最小化可运行 demo)。如果在线环境无法复现,可以创建对应的 GitHub repo 来提供复现环境。请在下方贴入 [StackBlitz demo](https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue) 的链接或 GitHub repo 链接:"
4545
validations:
4646
required: true

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## 8.0.0-beta.1
2+
3+
### Breaking changes
4+
5+
- Updated peer dependency for `echarts` to `^6.0.0`.
6+
- Updated peer dependency for `vue` to `^3.3.0`.
7+
- Dropped support for browsers without native `class` support.
8+
- Removed `vue-echarts/csp` entry. Use `vue-echarts` instead. Only manually include `vue-echarts/style.css` if you are **both** enforcing a strict CSP that prevents inline `<style>` injection and targeting browsers that don't support the [`CSSStyleSheet()` constructor](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility).
9+
10+
### New features
11+
12+
- ECharts 6 support.
13+
- Added slots for tooltip and data view.
14+
- Added support for getter in provide/inject.
15+
16+
### Chore
17+
18+
- Built with tsdown.
19+
- Switched Demo from Webpack to Rolldown-Vite.
20+
- Use ESLint flat config.
21+
122
## 7.0.3
223

324
- Fixed type for `autoresize` (again).

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66

77
---
88

9-
> Still using v6? Read v6 docs [here →](https://github.com/ecomfe/vue-echarts/tree/6.x)
9+
> Still using Vue 2? Read v7 docs [here →](https://github.com/ecomfe/vue-echarts/tree/7.x)
1010
1111
## Installation & Usage
1212

1313
### npm
1414

1515
```sh
16-
npm add echarts vue-echarts
16+
npm install echarts vue-echarts
1717
```
1818

1919
#### Example
2020

2121
<details>
22-
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3?file=src%2FApp.vue">Demo →</a></summary>
22+
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue">Demo →</a></summary>
2323

2424
```vue
2525
<template>
@@ -114,14 +114,14 @@ import "echarts";
114114
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
115115

116116
<details>
117-
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3-global?file=index.html">Demo →</a></summary>
117+
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-8-global?file=index.html">Demo →</a></summary>
118118

119119
<!-- vue3Scripts:start -->
120120

121121
```html
122-
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
123-
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
124-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script>
122+
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
123+
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
124+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@8.0.0-beta.1"></script>
125125
```
126126

127127
<!-- vue3Scripts:end -->
@@ -413,9 +413,18 @@ Static methods can be accessed from [`echarts` itself](https://echarts.apache.or
413413

414414
If you are **both** enforcing a strict CSP that prevents inline `<style>` injection and targeting browsers that don't support the [CSSStyleSheet() constructor](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility), you need to manually include `vue-echarts/style.css`.
415415

416-
## Migration to v7
416+
## Migration to v8
417417

418-
Read the breaking changes document in the [release log](https://github.com/ecomfe/vue-echarts/releases/tag/v7.0.0-beta.0) and the migration shoud be straightforward.
418+
> [!NOTE]
419+
> Please make sure to read the [upgrade guide](https://echarts.apache.org/handbook/en/basics/release-note/v6-upgrade-guide/) for ECharts 6 as well.
420+
421+
The following breaking changes are introduced in `vue-echarts@8`:
422+
423+
- **Vue 2 support is dropped:** If you still need to stay on Vue 2, use [`vue-echarts@7`](https://github.com/ecomfe/vue-echarts/tree/7.x).
424+
425+
- **Browser compatibility changes:** We no longer provide compatibility for browsers without native [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#browser_compatibility) support. If you need to support legacy browsers, you must transpile the code to ES5 yourself.
426+
427+
- **CSP entry point removed:** The entry point `vue-echarts/csp` is removed. Use `vue-echarts` instead. You only need to manually include `vue-echarts/style.css` if you are **both** enforcing a strict CSP that prevents inline `<style>` injection and targeting browsers that don't support the [`CSSStyleSheet()` constructor](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility).
419428

420429
## Local development
421430

README.zh-Hans.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66

77
---
88

9-
> 还在使用 v6?可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/6.x/README.zh-Hans.md)
9+
> 还在使用 Vue 2?可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/7.x/README.zh-Hans.md)
1010
1111
## 安装 & 使用
1212

1313
### npm
1414

1515
```sh
16-
npm add echarts vue-echarts
16+
npm install echarts vue-echarts
1717
```
1818

1919
#### 示例
2020

2121
<details>
22-
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3?file=src%2FApp.vue">Demo →</a></summary>
22+
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue">Demo →</a></summary>
2323

2424
```vue
2525
<template>
@@ -114,14 +114,14 @@ import "echarts";
114114
用如下方式在 HTML 中插入 `<script>` 标签,并且通过 `window.VueECharts` 来访问组件接口:
115115

116116
<details>
117-
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3-global?file=index.html">Demo →</a></summary>
117+
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-8-global?file=index.html">Demo →</a></summary>
118118

119119
<!-- vue3Scripts:start -->
120120

121121
```html
122-
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
123-
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
124-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script>
122+
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
123+
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
124+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@8.0.0-beta.1"></script>
125125
```
126126

127127
<!-- vue3Scripts:end -->
@@ -270,11 +270,11 @@ import { provide } from "vue";
270270

271271
provide(THEME_KEY, "dark");
272272

273-
// or provide a ref
273+
// 或者 provide 一个 ref
274274
const theme = ref("dark");
275275
provide(THEME_KEY, theme);
276276

277-
// getter is also supported
277+
// 也支持 getter
278278
provide(THEME_KEY, () => theme.value);
279279
```
280280

@@ -295,7 +295,7 @@ export default {
295295
}
296296
}
297297

298-
// Or make injections reactive
298+
// 或者让注入项具有响应性
299299
export default {
300300
data() {
301301
return {
@@ -413,9 +413,18 @@ Vue-ECharts 允许你通过 Vue 插槽来定义 ECharts 配置中的 [`tooltip.f
413413

414414
如果你执行严格的 CSP 策略来防止内联 `<style>` 注入,**并且**需要兼容不支持 [CSSStyleSheet() 构造函数](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility) 的浏览器,则需要手动引入 `vue-echarts/style.css`
415415

416-
## 迁移到 v7
416+
## 迁移到 v8
417417

418-
请阅读[发布日志](https://github.com/ecomfe/vue-echarts/releases/tag/v7.0.0-beta.0)中的变更记录,之后迁移过程应该会相对简单。
418+
> [!NOTE]
419+
> 请确保同时查阅 [ECharts 6 的升级指南](https://echarts.apache.org/handbook/zh/basics/release-note/v6-upgrade-guide/)
420+
421+
`vue-echarts@8` 引入了以下破坏性变更:
422+
423+
- **Vue 2 支持已移除:** 如果你仍需要继续使用 Vue 2,请使用 [`vue-echarts@7`](https://github.com/ecomfe/vue-echarts/tree/7.x)
424+
425+
- **浏览器兼容性变更:** 我们不再为不支持原生 [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#browser_compatibility) 的浏览器提供兼容性支持。如果你需要支持旧版浏览器,必须自行将代码转译为 ES5。
426+
427+
- **CSP 入口点已移除:** 入口点 `vue-echarts/csp` 已被移除。请使用 `vue-echarts` 替代。如果你执行严格的 CSP 策略来防止内联 `<style>` 注入,**并且**需要兼容不支持 [`CSSStyleSheet()` 构造函数](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility) 的浏览器,则需要手动引入 `vue-echarts/style.css`
419428

420429
## 本地开发
421430

demo/Demo.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ a {
151151
}
152152
}
153153
154-
h1,
155-
h2,
156-
h3 {
157-
color: #2c3e50;
158-
font-weight: 400;
159-
}
160-
161154
h1 {
162155
margin-bottom: 1em;
163156
font-family: Inter, "Helvetica Neue", Arial, sans-serif;
@@ -260,6 +253,8 @@ footer {
260253
h1,
261254
h2,
262255
h3 {
256+
color: #2c3e50;
257+
font-weight: 400;
263258
a,
264259
a:hover {
265260
text-decoration: none;

package.json

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-echarts",
3-
"version": "7.0.3",
3+
"version": "8.0.0-beta.1",
44
"description": "Vue.js component for Apache ECharts™.",
55
"license": "MIT",
66
"repository": {
@@ -18,7 +18,7 @@
1818
"dev:build": "vite build",
1919
"dev:preview": "vite preview",
2020
"dev:typecheck": "vue-tsc -p ./demo",
21-
"docs": "node ./scripts/docs.mjs",
21+
"docs": "jiti ./scripts/docs.ts",
2222
"prepublishOnly": "pnpm run typecheck && pnpm run dev:typecheck && pnpm run build && publint"
2323
},
2424
"packageManager": "[email protected]",
@@ -35,37 +35,44 @@
3535
"dist"
3636
],
3737
"peerDependencies": {
38-
"echarts": "^6.0.0-beta.1",
38+
"echarts": "^6.0.0",
3939
"vue": "^3.3.0"
4040
},
4141
"devDependencies": {
4242
"@highlightjs/vue-plugin": "^2.1.0",
43-
"@types/node": "^22.15.21",
44-
"@typescript-eslint/utils": "^8.32.1",
45-
"@vercel/analytics": "^1.3.1",
43+
"@types/node": "^22.17.0",
44+
"@typescript-eslint/utils": "^8.39.0",
45+
"@vercel/analytics": "^1.5.0",
4646
"@vitejs/plugin-vue": "^6.0.1",
4747
"@vue/eslint-config-prettier": "^10.2.0",
48-
"@vue/eslint-config-typescript": "^14.5.0",
48+
"@vue/eslint-config-typescript": "^14.6.0",
4949
"@vue/tsconfig": "^0.7.0",
50-
"@vueuse/core": "^13.1.0",
50+
"@vueuse/core": "^13.6.0",
5151
"comment-mark": "^2.0.1",
52-
"echarts": "^6.0.0-beta.1",
52+
"echarts": "^6.0.0",
5353
"echarts-gl": "^2.0.9",
5454
"echarts-liquidfill": "^3.1.0",
55-
"esbuild-wasm": "^0.23.0",
56-
"eslint": "^9.27.0",
57-
"eslint-plugin-vue": "^10.1.0",
58-
"highlight.js": "^11.10.0",
59-
"jiti": "^2.4.2",
60-
"pinia": "^3.0.2",
55+
"esbuild-wasm": "^0.25.8",
56+
"eslint": "^9.32.0",
57+
"eslint-plugin-vue": "^10.4.0",
58+
"highlight.js": "^11.11.1",
59+
"jiti": "^2.5.1",
60+
"pinia": "^3.0.3",
6161
"postcss-nested": "^7.0.2",
62-
"prettier": "^3.5.3",
62+
"prettier": "^3.6.2",
6363
"publint": "^0.3.12",
64-
"tsdown": "^0.13.2",
65-
"typescript": "^5.8.3",
66-
"unplugin-raw": "^0.5.0",
67-
"vite": "npm:rolldown-vite@latest",
68-
"vue": "^3.5.13",
64+
"tsdown": "^0.13.3",
65+
"typescript": "^5.9.2",
66+
"unplugin-raw": "^0.5.1",
67+
"vite": "npm:rolldown-vite@^7.1.0",
68+
"vue": "^3.5.18",
6969
"vue-tsc": "^3.0.5"
70+
},
71+
"pnpm": {
72+
"peerDependencyRules": {
73+
"allowedVersions": {
74+
"echarts": "6"
75+
}
76+
}
7077
}
7178
}

0 commit comments

Comments
 (0)