Skip to content

Commit 193b5ca

Browse files
committed
Merge branch 'hotfix/minification' into develop
* hotfix/minification: ⬆️ Update npm version πŸ’Ž Release new version v2.3.0 πŸ“ Update README ✨ Add mixins to alias ⬆️ Update dependencies Change mixins exports to be seperate
2 parents 015aebf + dde366c commit 193b5ca

File tree

9 files changed

+411
-460
lines changed

9 files changed

+411
-460
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,66 @@ However you can simply implement this by your own or use one of the two mixins w
100100
- `reactiveProp`
101101
- `reactiveData`
102102

103+
Both are included in the `mixins` module.
104+
103105
The mixins automatically create `chartData` as a prop or data. And add a watcher. If data has changed, the chart will update.
104106

105107
```javascript
106108
// MonthlyIncome.js
107-
import { Line, reactiveProp } from 'vue-chartjs'
109+
import { Line, mixins } from 'vue-chartjs'
108110

109111
export default Line.extend({
110-
mixins: [reactiveProp],
112+
mixins: [mixins.reactiveProp],
113+
props: ["chartData", "options"],
114+
mounted () {
115+
this.renderChart(this.chartData, this.options)
116+
}
117+
})
118+
119+
```
120+
121+
### Mixins module
122+
The `mixins` module is included in the `VueCharts` module and as a seperate module.
123+
Some ways to import them:
124+
125+
```javascript
126+
// Load complete module with all charts
127+
import VueCharts from 'vue-chartjs'
128+
129+
export default VueCharts.Line.extend({
130+
mixins: [VueCharts.mixins.reactiveProp],
131+
props: ["chartData", "options"],
132+
mounted () {
133+
this.renderChart(this.chartData, this.options)
134+
}
135+
})
136+
```
137+
138+
```javascript
139+
// Load speperate modules
140+
import { Line, mixins } from 'vue-chartjs'
141+
142+
export default Line.extend({
143+
mixins: [mixins.reactiveProp],
111144
props: ["chartData", "options"],
112145
mounted () {
113146
this.renderChart(this.chartData, this.options)
114147
}
115148
})
149+
```
116150

151+
```javascript
152+
// Load speperate modules with destructure assign
153+
import { Line, mixins } from 'vue-chartjs'
154+
const { reactiveProp } = mixins
155+
156+
export default Line.extend({
157+
mixins: [reactiveProp],
158+
props: ["chartData", "options"],
159+
mounted () {
160+
this.renderChart(this.chartData, this.options)
161+
}
162+
})
117163
```
118164

119165
## Available Charts

β€Žbuild/webpack.base.conf.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ module.exports = {
1616
extensions: ['', '.js', '.vue'],
1717
fallback: [path.join(__dirname, '../node_modules')],
1818
alias: {
19-
'vue': 'vue/dist/vue.js',
19+
'vue': 'vue/dist/vue.common.js',
2020
'src': path.resolve(__dirname, '../src'),
21+
'mixins': path.resolve(__dirname, '../src/mixins'),
2122
'BaseCharts': path.resolve(__dirname, '../src/BaseCharts')
2223
}
2324
},

β€Žbuild/webpack.prod.conf.jsβ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const webpack = require('webpack')
22
const base = require('./webpack.base.conf')
33
const config = require('../config')
4+
var env = process.env.NODE_ENV === 'testing'
5+
? require('../config/test.env')
6+
: config.build.env
47

58
base.entry = {
69
lib: './src/index.js'
@@ -19,9 +22,7 @@ var webpackConfig = Object.assign({}, base)
1922
webpackConfig.devtool = '#source-map'
2023
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
2124
new webpack.DefinePlugin({
22-
'process.env': {
23-
NODE_ENV: '"production"'
24-
}
25+
'process.env.NODE_ENV': env
2526
}),
2627
new webpack.optimize.UglifyJsPlugin({
2728
compress: { warnings: false }

β€Ždist/vue-chartjs.jsβ€Ž

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/vue-chartjs.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-chartjs",
3-
"version": "2.2.1",
4-
"description": "Vue wrapper for chart.js",
3+
"version": "2.3.0",
4+
"description": "vue.js wrapper for chart.js",
55
"author": "Jakub Juszczak <[email protected]>",
66
"repository": {
77
"type": "git",
@@ -26,8 +26,8 @@
2626
},
2727
"dependencies": {
2828
"babel-runtime": "^6.11.6",
29-
"chart.js": "^2.2.1",
30-
"vue": "^2.0.1"
29+
"chart.js": "^2.4.0",
30+
"vue": "^2.1.6"
3131
},
3232
"devDependencies": {
3333
"babel-core": "^6.10.4",
@@ -38,14 +38,14 @@
3838
"chai": "^3.5.0",
3939
"chromedriver": "^2.21.2",
4040
"connect-history-api-fallback": "^1.1.0",
41-
"cross-spawn": "^4.0.2",
42-
"css-loader": "^0.25.0",
41+
"cross-spawn": "^5.0.1",
42+
"css-loader": "^0.26.1",
4343
"eslint": "^3.7.1",
4444
"eslint-config-standard": "^6.2.0",
4545
"eslint-friendly-formatter": "^2.0.5",
4646
"eslint-loader": "^1.3.0",
4747
"eslint-plugin-html": "^1.3.0",
48-
"eslint-plugin-promise": "^2.0.1",
48+
"eslint-plugin-promise": "^3.4.0",
4949
"eslint-plugin-standard": "^2.0.1",
5050
"eventsource-polyfill": "^0.9.6",
5151
"express": "^4.13.3",
@@ -54,7 +54,7 @@
5454
"function-bind": "^1.0.2",
5555
"html-webpack-plugin": "^2.8.1",
5656
"http-proxy-middleware": "^0.17.2",
57-
"inject-loader": "^2.0.1",
57+
"inject-loader": "^3.0.0-beta2",
5858
"isparta-loader": "^2.0.0",
5959
"jasmine-core": "^2.5.2",
6060
"json-loader": "^0.5.4",
@@ -73,18 +73,18 @@
7373
"nightwatch": "^0.9.8",
7474
"ora": "^0.3.0",
7575
"phantomjs-prebuilt": "^2.1.13",
76-
"selenium-server": "^2.53.1",
76+
"selenium-server": "^3.0.1",
7777
"shelljs": "^0.7.4",
7878
"sinon": "^1.17.3",
7979
"sinon-chai": "^2.8.0",
8080
"url-loader": "^0.5.7",
8181
"vue-hot-reload-api": "^2.0.6",
8282
"vue-html-loader": "^1.2.3",
83-
"vue-loader": "^9.3.0",
83+
"vue-loader": "^10.0.2",
8484
"vue-style-loader": "^1.0.0",
8585
"webpack": "^1.13.2",
8686
"webpack-dev-middleware": "^1.4.0",
8787
"webpack-hot-middleware": "^2.6.0",
88-
"webpack-merge": "^0.14.1"
88+
"webpack-merge": "^1.1.1"
8989
}
9090
}

β€Žsrc/index.jsβ€Ž

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import Pie from './BaseCharts/Pie'
55
import PolarArea from './BaseCharts/PolarArea'
66
import Radar from './BaseCharts/Radar'
77
import Bubble from './BaseCharts/Bubble'
8-
import reactiveProp from './mixins/reactiveProp'
9-
import reactiveData from './mixins/reactiveData'
8+
import mixins from './mixins/index.js'
109

1110
const VueCharts = {
1211
Bar,
@@ -16,8 +15,19 @@ const VueCharts = {
1615
PolarArea,
1716
Radar,
1817
Bubble,
19-
reactiveProp,
20-
reactiveData
18+
mixins
2119
}
2220

23-
module.exports = VueCharts
21+
export default VueCharts
22+
23+
export {
24+
VueCharts,
25+
Bar,
26+
Doughnut,
27+
Line,
28+
Pie,
29+
PolarArea,
30+
Radar,
31+
Bubble,
32+
mixins
33+
}

β€Žsrc/mixins/index.jsβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import reactiveData from './reactiveData.js'
2+
import reactiveProp from './reactiveProp.js'
3+
4+
export default {
5+
reactiveData,
6+
reactiveProp
7+
}

0 commit comments

Comments
Β (0)