krakenjs / zoid

Cross domain components
Apache License 2.0
2.01k stars 248 forks source link

Stack overflow with object parameters on child-side vue v2.5.x #156

Open doublemarked opened 6 years ago

doublemarked commented 6 years ago

xcomponent in the child frame is performing some sort of reactivity that is clashing with Vue's own reactivity for object parameters passed to the component. This appears to be only since Vue v2.5, but nonetheless, it is problematic that xcomponent could be interfering like this in client behavior.

The problem occurs within replaceObject, which implements a getter that modifies state. Vue's reactivity appears to respond to that state change in a way that ultimately calls the replaceObject getter again, spiraling into a stack overflow.

I've implemented a test which demonstrates this error, within the following branch on my fork of xcomponent,

https://github.com/krakenjs/xcomponent/compare/master...doublemarked:hm/vue-client-stack-overflow-error

bluepnume commented 5 years ago

Are you still seeing this issue with the latest version?

doublemarked commented 5 years ago

So, good news: I've ported my test case over to the latest zoid and can no longer reproduce it there. Later this week I'll revert the workaround we put in our main codebase and confirm whether it's gone there as well.