-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add __VUE_DEVTOOLS_CONTEXT__ to allow for iframe compatibility #361
Conversation
Well, thanks for starting the discussion 🙂 |
I hope that In storybook 3.2, will be release for vue supporting. 😉 |
Why is this not going forward? |
It does, but very slowly, because I don't have as much time as I would like to 😞 |
Really appreciate the hard work you're putting in this @posva |
@miljan-aleksic Just as a side note, a better way to ask your question would be something: "I am very interested in seeing this completed. How can I help in getting this to move forward?" |
@posva, @LinusBorg, seems I spend daily too many hours answering tickets and helping others that I have forgotten how to ask for help my self. Sorry if my question was too raw, I didn't imply anything with it, didn't even assume somebody was or not working on it, just wanted to know if there is any update on this topic that is important, but seems have low priority. |
@miljan-aleksic Thanks for understanding, and no worries, I'm guilty of that too from time to time. We all just need a little reminder sometimes, and that's ok. |
In case anyone wants to look what is working, there's an |
Something I can do on the storybook side? |
not at the moment, I'll ping you in the Discord server if something arises 🙂 |
I've started to work this weekend on this (very work in progress - chrome only: davinov@5ec21a8) @posva : we could take some time time to discuss this in the week if you're available |
Actually in the case of Living Styleguides.. this can happen. Storybook doesn't do this YET, but it could eventually. (showing multiple previews with different sizes to develop responsive components better) |
Hehe, thanks to indicate that! With further research, I think it can be achieved that by replacing |
How is this going? |
@davinov got a bit further, I pushed my work in a branch here but I simply don't have the time at the moment 🙁 |
@posva Thank you for your reply! @davinov I would like to help it due to be able make time. |
Wait whut, this is working now? |
What gives you the impression? |
|
You can be excited for things not yet existing / working ;) If you read the next sentence, he's asking posva if he can continue work on this or someone else should pick up. That would not make sense if it worked already, would it? |
Could we move forward with this PR? storybookjs/storybook#1376 was merged from the storybook side. This isn't a be-all-end-all solution, but it provides more capabilities than exist now. We could roll forward with a different iframe selector experience at some later point. |
@Akryum what do you think about merging this? At the very least it doesn't hurt anything. It gives the capability to vue-devtools with storybook today. |
Hi all ! In an effort to push this forward, i've started to work on this matter in my fork. After a night of hack, the most basic example looks like working , but I would like more feedbacks before going any further. I had to implement a nasty hack but i think this feature cannot work without it, or at least something cleaner that looks like it. Both Vue.js and VueX relies on a window getter named You can see calls to the devtools in the init process of Vue.js (here) and in the process of construction of a VueX Store(here). That makes it not possible to use the VueX, router, and events part of the devtools in an iframe environment without patching Vue.js and VueX. I investigated few ways to do achieve this :
I tried to implement 2nd proposition with So, I went for the 3rd proposition instead : for a soft patch, I implemented how Vue.js and VueX could leave their instance to be debugged here but i think we could do better if we were to modify the builds. Then, It was relatively easy to patch the devtools ; that said, i think it should be re-written with async hooking taken in consideration, as well as for Vue.js and VueX. For example about the latter, I think this should be deleted in order to avoid nasty hack in the devtools. On a side note, I'm sorry that I couldn't pick up on @posva branch but it looked a bit far from dev branch, so I tried directly from it instead. There are for sure lots of things to do, and to clean in order to make this tool works with iframes. Please, let me know what you think :) |
Can we get this moving again? |
@gapipro i could try to make a proper branch and propose a PR, maybe this could move faster this way. although, i think the architecture of this app is quite something to rework on. I'd like to propose my help, but i think there's a lot to do to provide a better structure and readability. Let me know in what sense i could help to make it move forward. |
Could we get some sort of direction from the Vue-devtools team on what is needed here? I might be willing to pitch in and help, but it seems like right now any effort might just be a waste, because it's not clear what path forward is acceptable to the devtools team. Or even if there's sufficient interest in getting outside contributions merged in to address the issue. Any feedback would be super appreciated 👍 |
Isn't this outdated now that remote devtools exist? wasn't it made by @michalsnik and @znck ? |
You should be able to debug anything with the remote devtools. |
@posva @Akryum @LinusBorg I'm not sure what you guys are referring to. If you're talking about the vue stand alone electron app, and placing the |
That's what they were referring to, yeah. If that sometimes works and sometimes doesn't, it still seems to work better than what we have concerning this PR right here, right? So if we move to improve it, we will probably get more progress if we concentrate on the remote devtools implementation. |
@LinusBorg I'm fine with that as well. I'm pretty confident it worked at some point with the electron shell early last year, but it's been broken (as far as I can tell) for a good handful of months now. Let me know if there's anything I can do, here or elsewhere, to help things move along. |
@Aaron-Pool if there's a repo to work on a fresh version, i'm willing to help too. |
Any updates on this? Where or who is best to ask? It it a devtools issue or storybook issue? |
In Storybook 5 you can launch the current story iframe on an external browser tab where the Vue devtools will work as expected. Is a good workaround and it actually make sense to remove the Storybook context when using a 3rd party tool. |
Thanks @miljan-aleksic, should be noted that this only works locally, if you run the static build storybook sets Vue to production mode and Dev Tools are disabled. |
Any news on that ? |
so? When can I use it? |
Hi, I'm currently creating this PR as a discussion point to possibly solve some of the issues around using Devtools to identify apps within iframes 1, 2 (last bullet point).
The stopgap solution I'm proposing here would check for a global
__VUE_DEVTOOLS_CONTEXT__
variable on the target document. This would allow for an application likestorybook
orvue-play
to define the context in which the devtools would run. I.e. https://github.com/storybooks/storybook/pull/1376/filesThis may not be the perfect way to go but it's currently the solution I'm using locally to develop and I figured it might be helpful to bring up here.