Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/v3 #225

Merged
merged 16 commits into from
Oct 14, 2017
Merged

Feature/v3 #225

merged 16 commits into from
Oct 14, 2017

Conversation

apertureless
Copy link
Owner

πŸ’Ž vue-chart.js v3

Finally version 3 of vue-chartjs is ready to 🚣 . We have some breaking changes, but they are easy to change!

βœ… Removed Vue.extend() in the base components #201
βœ… Changed the private data from private instance to private data instance #182
βœ… Updated peerDependencies vue & chart.js

πŸ”₯ Breaking Changes!

🐣 Component creation

In v2 you were creating your own chart components by extending the base component like this:

import { Line } from 'vue-chartjs'

export default Line.extend({
  ....
})

This was possible because the base components had a export default Vue.extend({}) in it. Which creates a subclass of the vue ctor. vue docs
Because of this Vue needed to be included as a dependency and bundled into the package for the browser build.

This was causing a lot of confusing πŸ˜• and also some weird errors #216, #151 and some more problems like increased bundle size and duplicated dependencies for browser build.

πŸ” Chart instance

Like mentioned in #182 vue could possibly overwrite the private _chart variable as it is saved as an unprotected instance variable. Now it makes usage of vue's private data notation.

⬆ πŸ“– Upgrade Guide

🐣 Component creation

Create your components now with either extends or mixins :

import { Line } from 'vue-chartjs'

export default {
   extends: Line,
   data () {...},
   mounted () {
      ....
   }
}

or

import { Line } from 'vue-chartjs'

export default {
   mixins: [Line],
   data () {...},
   mounted () {
      ....
   }
}

πŸ” Chart instance

Replace this._chart with this.$data._chart

@codecov
Copy link

codecov bot commented Oct 14, 2017

Codecov Report

Merging #225 into develop will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           develop   #225   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           11     11           
  Lines          105     96    -9     
======================================
- Hits           105     96    -9
Impacted Files Coverage Ξ”
src/BaseCharts/Radar.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Pie.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/HorizontalBar.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Bubble.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Scatter.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/PolarArea.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Line.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Bar.js 100% <100%> (ΓΈ) ⬆️
src/BaseCharts/Doughnut.js 100% <100%> (ΓΈ) ⬆️

* master:
  Spelling
  Fix inaccuracies in Russian translation
  Added French doc to config
  add bahasa indonesia docs
  did not translate the correct file...
  French translation for README.md
  ✨ Add dist files to repo
  πŸ’Ž Release new version 2.8.7
  Update peerDependencies
  ⬆️ Update dependencies
  πŸ’Ž Release new version 2.8.6
  πŸ“ Update CHANGELOG
  v2.8.5
  Replace deepmerge with lodash.merge
  πŸ“ Update CHANGELOG
  v2.8.4
  πŸ”₯ Remove transform-object-assign
  βž• Add dependency deepmerge
  πŸ“ Update CHANGELOG
  πŸ’Ž Release new version 2.8.3

# Conflicts:
#	dist/vue-chartjs.full.js
#	dist/vue-chartjs.full.min.js
#	dist/vue-chartjs.js
#	dist/vue-chartjs.min.js
#	docs/config.js
#	package.json
#	yarn.lock
@apertureless apertureless self-assigned this Oct 14, 2017
@apertureless apertureless merged commit d498b7c into develop Oct 14, 2017
@apertureless apertureless deleted the feature/v3 branch December 1, 2017 21:10
@andreineculau andreineculau mentioned this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant