Releases: presidenten/vuex-plus
Refactored
While 2.0.6 fixed hmr in newer vue versions, this version mainly consists of refactoring changes.
Changes since 2.0.0
(Also present in 2.0.6)
root.get/dispatch
can be used from vue components with $parent alias in path if used together with vnode:root.get({ path: '$root/count', vnode: this });
- Normal mixins trigger on
beforeCreate
to work better with vues watches. - HMR works again for vue components on newer vue versions & webpack 3.
New in 3.0.0
- Code is refactored and lots of unnecessary code was removed
- The decorated property module.$api is removed
Enhanced paths
A few breaking changes in this version, but the new features are super sweet and well worth it.
Updates:
- All module states are extended with
$parent
which allows submodules to read their parents state and thus the parents other submodules. - The library is now optimized to use strings for paths instead of the api. The api is deprecated and will be removed in the next major version.
Global
is removed (breaking change) androot
is introduced.root
accepts keywords together withcontext.state
to make path navigation simpler. Easy access to parents getters and the root module in the same instance tree.root.get({ path: '$parent/getter', state: context.state })
expands to full path with parent instancesroot.get({ path: '$root/getter', state: context.state })
expands to root module instance path
addStore
is removed (breaking change) andregister
is introduced.register
takes a store name and returns a mixin that can be used instantly in the mixin property.- To get the Vue and Vuex plugins are now accessed through functions from Vuex+ (breaking change). It was necessary to be able to patch Vuex to add $parent when inserting new states through Vue devtools.
- Works nicely mixed with normal vuex modules. By following file naming conventions they also get automatic HMR.
- Bug fix where files with
-store
in middle of the filename would get weird module names.
Vuex plus final release
The library is being used in live project and feels good. :-)
Code is commented and tests are still running.
No changes from 0.8.2.
Almost done
Unit tests are written and no more bugs found for a while.
I think the library is just about done.
If no other bugs or missing enhancements show up during this week the code will be commented, and the project will be bumped to 1.0.0 for a proper release.
Bug fixes and better global getter/action/mutation api
The global getter/action/mutation api do not need to be passed context
all the time any more.
Just pass the path
parameter for global reach, or also pass the context.state for local reach.
Installs as plugins & better global getter handling
Breaking changes in how Vuex+ is added
import Vue from 'vue';
import Vuex from 'vuex';
import VuexPlus from 'vuex+';
Vue.use(Vuex);
Vue.use(VuexPlus.vuePlugin);
const store = new Vuex.Store({
plugins: [VuexPlus.vuexPlugin],
});
new Vue({
el: '#app',
store,
render: h => h(require('./app.vue')),
});
Major refactoring
Refactored code to prepare for unit testing
Better global api
- hmr
- global by default
- all top level instances present
- possible local get/act/mutate via local: true flag
New way to add toplevel stores, and api merged with global
Updates and breaking changes
-
Better way to
{addstore}
and use mixins and local api.addStore('name-store')
now returns {mixin, api} instead of a mixin. -
Merged
{api}
into{global}
, so no moreimport {api} from 'vuex+';
. Use import {global} from 'vuex+'; ` instead.
The demo and tutorial will be updated shortly. Check out the new features here: https://github.com/presidenten/vuex-plus-demo
Submodule instantiations
Now submodules may also be instantiated.
Breaking changes:
- Instance => global
- # as instance separator => $ as instance separator
This way we can use . notation all the way.