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

Vuex 4 support #32

Open
NetCZ opened this issue May 29, 2020 · 7 comments
Open

Vuex 4 support #32

NetCZ opened this issue May 29, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@NetCZ
Copy link

NetCZ commented May 29, 2020

Hi @MitsuhaKitsune,
thanks for the great plugin.

I'm trying to make it work with new version of Vuex and I'm getting following error:
Initial state not sent: DataCloneError: The object could not be cloned.

I believe problem lies in state object being wrapped with Proxy in new version, which cannot be handled by structured clone algorithm.

Problem is in initial @@STORE_SYNC_STATE message:

data: this.store.state

Quick workaround could be this.store._modules.root.state or JSON.parse(JSON.stringify(...)) as I haven't found any way how to get original object from Proxy.

@bbird1980
Copy link

I haven't found any way how to get original object from Proxy.

https://stackoverflow.com/questions/51096547/how-to-get-the-target-of-a-javascript-proxy

@MitsuhaKitsune MitsuhaKitsune added the enhancement New feature or request label Aug 4, 2021
@MitsuhaKitsune
Copy link
Owner

Didn't check vuex 4 for now, I'm still using vuex 3 on my projects, so I need time to test with v4.

@kinghat
Copy link

kinghat commented Aug 4, 2021

Didn't check vuex 4 for now, I'm still using vuex 3 on my projects, so I need time to test with v4.

vuex 5 and pinia are also right around the corner.

@bbird1980
Copy link

bbird1980 commented Aug 4, 2021

Also manifest v3 is here and there is no background-pages, event-based worker only :(

@MitsuhaKitsune
Copy link
Owner

@Kinhat Yes, I admit that I have been absent for a long time. My extension project has been closed for a year and I no longer use this plugin in any of my projects, but I really want to keep it for all of you because of the support it has received to date.

I will check both versions, both v4 and v5 and offer support for them as soon as possible as soon as I find the problem and manage to develop a solution.

@bbird1980 As I understand it, the background pages are replaced by workers, and they still have access to the browser APIs, so in principle, there should be no problem adapting the plugin to manifest v3.

@kinghat
Copy link

kinghat commented Aug 4, 2021

thanks for the update. i recently came across this and maybe it could be used to simplify part of the library or make it easier to bring up to date? https://github.com/antfu/webext-bridge

@MitsuhaKitsune
Copy link
Owner

Vuex 4 support (WIP) it's on new branch: https://github.com/MitsuhaKitsune/vuex-webextensions/tree/vuex-v4

When it's ready for production use I notice it here, probably I publish the compatible version with @next tag similar to vuex at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants