MitsuhaKitsune / vuex-webextensions

A Vuex plugin to share store through webextensions components
MIT License
83 stars 30 forks source link

v1.3.2 npm build not working properly #57

Closed TCashion closed 3 years ago

TCashion commented 3 years ago

It seems the compiled code is still not quite working as expected. The specific bug I found was in the vweReplaceState mutation:

...
Object.keys(str.state).forEach(function(key) {
      str.state[key] = payload[key];
 });
...

When debugging, I find that the payload object is passed through as a JSON string of the store object, so payload[key] resolves to undefined. Thus the content script store does not receive the proper values from the background script.

This only happens on the npm build. When I install the package directly from the Git repository, it works as expected.

I noticed that v1.3.0 was built using the rimraf dist && babel src -d dist command, not the rollup command. Could I suggest reverting to that build method?

MitsuhaKitsune commented 3 years ago

Yes, on the past I use babel to compile the module, I switch to rollup to make dist more small and on a single file but as I can see it do a lot of problems on the builds, so I gona back to only babel and I investigate a better method to distribute builds with time.

Let me 10 minutes and v.1.3.3 are ready on npm.

I'm very sorry for all issues that you encounter, it's my first npm module, seems that I should learn more.

MitsuhaKitsune commented 3 years ago

v1.3.3 now available on npm, I pray that this version work properly.

This is my bad because I use the example extension for test the module, but it use the module uncompiled importing it from src directory.

Now I have a enviroment to test from build dir, so I think that we don't gona see problems on builds I guess.

Im very sorry about that really, and a lot of thanks for all efforts that you put on testing and reports.

TCashion commented 3 years ago

Great! After my first test, 1.3.3 seems to work well! I will keep you posted and thank you again for being so responsive!

MitsuhaKitsune commented 3 years ago

Nice to hear that, I investigate the rollup issue on the future.

As I said, this is my first and npm package at this time, the objetive of the implementation of rollup are compress whole plugin into a unic file and reduce his size to max possible, to do that I follow one guide that I see on medium, but for some reason didn't work fine with this plugin.

Don't need to say thanks, I don't use this plugin anymore because my webextension are focused on League of Legends forums and unafortunally they get down a year ago, but seeing that it is still useful for you and all the support it receives gives me the strength to continue with it ^^