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

Strict mode #1

Closed
educkf opened this issue May 20, 2020 · 2 comments
Closed

Strict mode #1

educkf opened this issue May 20, 2020 · 2 comments

Comments

@educkf
Copy link

educkf commented May 20, 2020

Hello!

I have been studying your project, to understand more about using Three.js with Vuex. I know you have build it more than a year ago, and maybe don't remember it much. But anyway, I thought of discussing some aspects of it.

I have been poking it around, trying to make it work on strict mode. Moving everything that visibly changes state to a mutation and everything, but I could not make it work, it never finishes loading the page once I activate strict mode...

When reading about strict mode on Vuex, it is said:

Do not enable strict mode when deploying for production! Strict mode runs a synchronous deep watcher on the state tree for detecting inappropriate mutations, and it can be quite expensive when you make large amount of mutations to the state. Make sure to turn it off in production to avoid the performance cost.

Maybe it never stop loading because of the expense of those deep watchers? Is the code you have now already "ok" with strict mode and state mutability only on commits? Or is it something not doable with Vuex and Three.js maybe?

Do you have any thoughts on that?

thanks!

@rydurham
Copy link
Member

Hello,

I have not tried using this code in strict mode, so I can't speak from experience here. However, I can say that even without strict mode I had a fair amount of trouble getting Three.js to work well with Vuex. It was very easy to overwhelm vuex with a large number of state change commits and bring down the whole page. My guess is that with the watcher in place this balance becomes even more tenuous.

I don't know for sure, but if I had to guess I would say that it is not possible to get Vue and Three.js working together with strict mode enabled.

@rydurham
Copy link
Member

This may or may not be a moot point in Vue 3, which has been implemented in PR #6. I am going to close this for now but feel free to reopen it if you would like.

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

No branches or pull requests

2 participants