meteor-vue / vue-meteor

🌠 Vue first-class integration in Meteor
897 stars 111 forks source link

Vuex incompatible with vue 2 #84

Closed janat08 closed 7 years ago

janat08 commented 7 years ago

http://pastebin.com/zGfuqwxw this.callMethod

janat08 commented 7 years ago

Isn't 1.4.2 error.

janat08 commented 7 years ago

https://laracasts.com/discuss/channels/vue/vuex-anybody-typeerror-thisstorecommit-is-not-a-function

I'm pretty much following the solution with the defaul library I suppose.

janat08 commented 7 years ago

Well then so I cross referenced what "this" gives at example repo and what I got, and the library doesn't have some exceptional errors, although with looping root in extended store and hectic patterns I may as well be looking at benign parts that have been ported over from original library for vuex.

janat08 commented 7 years ago
 _addAction(action) {
    return (store, ...args) => {
      if (!(store instanceof ExtendedStore)) {
        args.unshift(store);
        store = this.store;
      }

      return action.call(this, {
        store,
        state: this.getState(store.state),
      }, ...args);
    };
  }
}

this is what my action amounts to within console, and it has these closures: Closure (_addAction) Closure Closure (meteorInstall.node_modules.meteor.akryum:vuex.client.client.js) Closure Global

Please help? I corrected the typo for this.action.shouldBeMappedAction.

janat08 commented 7 years ago

Stuck the vuex injection into new vue rather than app layout, and still wouldn't work.

Akryum commented 7 years ago

What is your full component code?

janat08 commented 7 years ago

http://pastebin.com/pFPCKRmp

Akryum commented 7 years ago

Which version of Vue are you using?

janat08 commented 7 years ago
"vue": "^2.0.3",
"vue-router": "^2.0.0-rc.5",
"vuex": "^1.0.0-rc.2"
janat08 commented 7 years ago

vuex is 1.0.0

Akryum commented 7 years ago

Well, you are trying to use an incompatible version of vuex with Vue 2.0 and my Meteor vuex package isn't compatible with Vue 2.0 either.

janat08 commented 7 years ago

Beautiful, I speculated about such a case within forums, I think; No one acknowledged that.

janat08 commented 7 years ago

"As for Vuex, even version 0.8 is compatible with Vue 2, so you’re not forced to upgrade. The only reason you may want to upgrade immediately is to take advantage of the new features in Vuex 2, such as modules and reduced boilerplate."

They say it should be fine, whats the problem and is it going to get fixed?

janat08 commented 7 years ago

Just in case maybe you could assign this to a milestone?

janat08 commented 7 years ago

At very least porting over some of the convenience functionality would be splendid like reading from state directly rather than having to declare getter for every state.

Akryum commented 7 years ago

Well, you can use mapState to access the state directly: documentation.

aadamsx commented 7 years ago

I think I need vuex for component-to-component communication (Non-Parent to child communication) on a larger scale (lots of state on one page).

Can I install akryum:vuex and start using vuex today even though I'm using Vue 2.0? The examples over at https://github.com/Akryum/meteor-vuex-example seem to be using Vue 1.0?

akryum:vue 1.2.2 akryum:vue-component 0.8.0 akryum:vue-router2 0.0.2 vue: 2.1.8 vue-meteor-tracker: ^1.0.4 vue-router: ^2.1.1

Akryum commented 7 years ago

The Meteor vuex package is only for Vue 1.x, as I will do a different and more generic npm package for vuex 2. You can still install vuex 2 and follow the guide.

janat08 commented 7 years ago

Oh well, using vuex stand alone without akryum:vuex hasn't occurred to me.

janat08 commented 7 years ago

to be clear mapstate isn't supported in your package, since you link to vuex 2 documentation and it looks like vuex 1 doesn't have mapstate.

Akryum commented 7 years ago

Yes, vuex2 doesn't work like vuex1.

janat08 commented 7 years ago

Well then map state shouldn't be available, although I just concluded that it's essentially the same stuff mapping it through mapstate or getter.

On Tue, Jan 17, 2017 at 6:43 PM, Guillaume Chau notifications@github.com wrote:

Yes, vuex2 doesn't work like vuex1.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Akryum/meteor-vue-component/issues/84#issuecomment-273134307, or mute the thread https://github.com/notifications/unsubscribe-auth/AKz-gbH-joOdex-JnCyQEf2N4nDCWirdks5rTLd1gaJpZM4KrVmI .

janat08 commented 7 years ago

Seeing how original vue is hell to debug with it's "common" junk (maybe you could share your secret with them), would you comment on how horrific vuex 2 is? I belief I used their web pack constructor, so it's probably the lib that's shite.