Skip to content

Commit 45c3076

Browse files
committed
feat: drop vue v2 support
1 parent dd62411 commit 45c3076

File tree

7 files changed

+73
-184
lines changed

7 files changed

+73
-184
lines changed

README.md

+1-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# @opd/g2plot-vue
66

7-
> [G2Plot](https://g2plot.antv.vision/) for `Vue`, both `v2` and `v3`, see [documentation](https://g2plot-vue.opd.cool) for more
7+
> [G2Plot](https://g2plot.antv.vision/) for `Vue`, see [documentation](https://g2plot-vue.opd.cool) for more
88
99
[![build](https://github.com/open-data-plan/g2plot-vue/workflows/build/badge.svg)](https://github.com/open-data-plan/g2plot-vue/actions?query=workflow%3Abuild)
1010
[![npm](https://img.shields.io/npm/v/@opd/g2plot-vue.svg)](https://www.npmjs.com/package/@opd/g2plot-vue)
@@ -19,12 +19,6 @@
1919
npm install @opd/g2plot-vue
2020
```
2121

22-
`g2plot-vue` will auto switch export version based on your installed `vue` version, if not work, you can switch by follow:
23-
24-
```bash
25-
node ./node_modules/@opd/g2plot-vue/scripts/postinstall.js
26-
```
27-
2822
## Usage
2923

3024
[![Edit g2plot-vue-basic-example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/g2plot-vue-basic-example-uxde9?fontsize=14&hidenavigation=1&theme=dark)
@@ -114,9 +108,6 @@ export default {
114108
- Vue 3
115109
- [github](https://github.com/open-data-plan/g2plot-vue-demo)
116110
- [online](http://g2plot-vue-demo-opd.vercel.app/)
117-
- Vue 2
118-
- [github](https://github.com/open-data-plan/g2plot-vue2-demo)
119-
- [online](http://g2plot-vue2-demo-opd.vercel.app/)
120111

121112
## API
122113

@@ -129,10 +120,6 @@ Notable API in `g2plot-vue`
129120

130121
## FYI
131122

132-
- [Throw error: `Failed to mount component: template or render function not defined.` in `vue@2`](https://github.com/open-data-plan/g2plot-vue/issues/483)
133-
134-
please ensure `composition-api` has been enabled.
135-
136123
- [Build failed with `vite`](https://github.com/open-data-plan/g2plot-vue/issues/505)
137124

138125
`g2plot-vue` use `babel` to build output files, and transform `@babel/runtime` with dependencies, so `@babel/runtime` is required.

docs/guide/index.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ title: Guide
99
## Features
1010

1111
- Fully support `G2Plot` charts, and will support new chart at first time.
12-
- Both `Vue 2&3` support, and easily use.
1312
- Native support for `TypeScript`.
1413
- **100%** unit test coverage
1514

15+
> Vue 2 has reached EOL and is no longer actively maintained, so we dropped support for Vue 2 and only support Vue 3.
16+
1617
## Install
1718

1819
```
1920
npm install @opd/g2plot-vue
2021
```
2122

22-
`g2plot-vue` will auto switch export version based on your installed `vue` version, if not work, you can switch by follow:
23-
24-
```bash
25-
node ./node_modules/@opd/g2plot-vue/scripts/postinstall.js
26-
```
27-
2823
## Usage
2924

3025
### jsx

docs/index.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
layout: home
33
hero:
44
name: G2Plot Vue
5-
text: For vue, both v2 and v3
6-
tagline: Builtin universal component support with vue-demi
75
actions:
86
- theme: brand
97
text: Get Started
108
link: /guide/
119
features:
12-
- title: Both Vue 2&3
13-
details: Universal support with vue-demi
1410
- title: G2Plot
1511
details: Powered by G2Plot
1612
- title: TypeScript
1713
details: Fully type definitions support
14+
- title: 100%
15+
details: Fully tested
1816
---

package-lock.json

+4-53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-24
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,17 @@
2424
"dev": "vitepress dev docs",
2525
"lint": "eslint . --ext=.ts,.tsx",
2626
"lint:fix": "eslint . --ext=.ts,.tsx --fix",
27-
"test": "npm run test3",
28-
"test2": "vue-demi-switch 2 vue2 && jest",
29-
"test3": "vue-demi-switch 3 && jest",
27+
"test": "jest",
3028
"prebuild": "npm test",
31-
"build": "npm run build:vue3 && npm run build:vue2",
32-
"build:vue3": "npm run build:es && npm run build:commonjs && npm run build:types3",
33-
"build:vue2": "npm run build:es2 && npm run build:commonjs2 && npm run build:types2",
34-
"build:es": "vue-demi-switch 3 && babel src -d es --extensions .ts,.tsx --delete-dir-on-start",
35-
"build:commonjs": "vue-demi-switch 3 && cross-env BABEL_ENV=commonjs babel src -d lib --extensions .ts,.tsx --delete-dir-on-start",
36-
"build:es2": "vue-demi-switch 2 vue2 && babel src -d es2 --extensions .ts,.tsx --delete-dir-on-start",
37-
"build:commonjs2": "vue-demi-switch 2 vue2 && cross-env BABEL_ENV=commonjs babel src -d lib2 --extensions .ts,.tsx --delete-dir-on-start",
38-
"build:types3": "vue-demi-switch 3 && tsc && tsc --declarationDir ./es",
39-
"build:types2": "vue-demi-switch 2 && tsc --declarationDir ./lib2 && tsc --declarationDir ./es2",
29+
"build": "npm run build:es && npm run build:commonjs && npm run build:types",
30+
"build:es": "babel src -d es --extensions .ts,.tsx --delete-dir-on-start",
31+
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src -d lib --extensions .ts,.tsx --delete-dir-on-start",
32+
"build:types": "tsc && tsc --declarationDir ./es",
4033
"build:docs": "vitepress build docs",
4134
"preversion": "npm run build",
4235
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
4336
"postversion": "npm publish",
4437
"sync": "node ./scripts/sync.js",
45-
"postinstall": "node ./scripts/postinstall.js",
4638
"prepare": "husky"
4739
},
4840
"repository": {
@@ -99,8 +91,7 @@
9991
"ts-node": "^10.0.0",
10092
"typescript": "^5.0.3",
10193
"vitepress": "^1.0.0-alpha.4",
102-
"vue": "^3.0.2",
103-
"vue2": "npm:vue@2"
94+
"vue": "^3.0.2"
10495
},
10596
"browserslist": [
10697
"> 1%",
@@ -120,18 +111,11 @@
120111
},
121112
"prettier": "@opd/prettier-config-pangu",
122113
"dependencies": {
123-
"core-js": "^3.12.1",
124-
"vue-demi": "^0.14.0"
114+
"core-js": "^3.12.1"
125115
},
126116
"peerDependencies": {
127117
"@antv/g2plot": "^2.3.0",
128118
"@babel/runtime": "^7.13.0",
129-
"@vue/composition-api": "^1.7.0",
130-
"vue": "^2.0.0 || >=3.0.0"
131-
},
132-
"peerDependenciesMeta": {
133-
"@vue/composition-api": {
134-
"optional": true
135-
}
119+
"vue": ">=3.0.0"
136120
}
137121
}

scripts/postinstall.js

-26
This file was deleted.

0 commit comments

Comments
 (0)