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

Vue devtools #1708

Closed
miljan-aleksic opened this issue Aug 22, 2017 · 51 comments
Closed

Vue devtools #1708

miljan-aleksic opened this issue Aug 22, 2017 · 51 comments

Comments

@miljan-aleksic
Copy link

miljan-aleksic commented Aug 22, 2017

Similar to the React devtools issue with iframes Vue devtools doesn't recognize the Storybooks components. Seems the solution is also similar using the __VUE_DEVTOOLS_GLOBAL_HOOK__, although I'm actually not sure if that's up to date.

Anyhow, if finally Vue devtools is not compatible with Storybooks there should be a BIG warning about that.

@miljan-aleksic
Copy link
Author

Ok, I just saw it is already like that in the Vue iframe file, but is not working for me.

Checking why...

@miljan-aleksic
Copy link
Author

miljan-aleksic commented Aug 22, 2017

I see Events are getting registered, but no components. Can somebody confirm this or say it does work for him?

@kazupon kazupon added the vue label Aug 22, 2017
@kazupon
Copy link
Member

kazupon commented Aug 22, 2017

related:
#1376
vuejs/devtools-v6#361

@ndelangen
Copy link
Member

So to answer here, Currently this does not work,

It's a remote issue being addressed inside the vue-devtools. There's progress being made to resolve the issue.

The reason it's not working, is because the preview and vue binding is happening in an iframe.

@davidm-public
Copy link

any updates on this ?

@davidm-public
Copy link

curiously, vue-devtools works fine with vue-play, which also uses an iframe:
https://github.com/vue-play/vue-play

@ndelangen
Copy link
Member

Wow, that IS curious! @kazupon any idea how that'd work?

@davidm-public are you able to view the components inside the iframe? because vue-play's manager UI is written in Vue, maybe that's what's being picked up? Debugging that isn't too valuable for developers I imagen.. But if they indeed are somehow able to pull off letting vue devtools connect to the vue instance inside the iFrame, we'd really like to know how to do that in storybook too.

@miljan-aleksic
Copy link
Author

@davidm-public, @ndelangen assumption is correct, vue-devtools is picking up the VuePlay app and totally ignoring the components from the stories, which are inside an iFrame.

@cmrd-senya
Copy link

That might be useful to note that one is able to use devtools if they take the iframe link from the DOM and open it in a separate tab

@zephraph
Copy link
Contributor

zephraph commented Mar 7, 2018

That's a stopgap solution, but it's pretty cumbersome.

#1376 added the hook to be able to support switching the default iframe. vuejs/devtools-v6#361 is opened and labeled as a discussion of how to handle iframe switching, but if that PR was merged as is it would at least have this functionality working. Please drop by that issue and pitch in to the discussion or give your support if it's something you're interested in.

@y-nk
Copy link
Contributor

y-nk commented May 21, 2018

still no update on that issue ? is there a way to make it work temporarly ?

@zephraph
Copy link
Contributor

@ynk The issue from vue-devtools side hasn't been merged yet. I pinged one of the maintainers... hopefully it'll get merged. 🤞

@davidmoshal
Copy link

Try https://github.com/asvae/vue-component-tree

It's excellent

@igor-dv
Copy link
Member

igor-dv commented Aug 28, 2018

@ndelangen, didn't you fix this?

@davidm-public
Copy link

@igor-dv vue-component-tree has been renamed vue-book:
https://github.com/asvae/vue-book
it's pure Vue, no need to run Vue inside react.

@y-nk
Copy link
Contributor

y-nk commented Sep 4, 2018

@zephraph shouldn't it be like vue-devtools should add a manual "please select an iframe to inspect" kindof feature ?

@zephraph
Copy link
Contributor

zephraph commented Sep 5, 2018

That's a possibility. vuejs/devtools-v6#361 really already does everything that's needed though. Sure, if they wanted, they could actually support it in the UI. Ultimately this would be enough... unfortunately, it doesn't look like there's any movement from that side.

@y-nk
Copy link
Contributor

y-nk commented Sep 6, 2018

@zephraph i'll try my luck and ask ; in the meantime, what are the possibilities to fix this issue on storybook side ?

@ndelangen
Copy link
Member

@y-nk In the next version I'll introduce an eject button to 'eject' the iframe from the manager.

This will give the dev tools direct access there.

Hope that helps.

@y-nk
Copy link
Contributor

y-nk commented Sep 6, 2018

@zephraph @ndelangen I kinda made the devtools work with iframes, at least in its dev environment. I commented my progress here : vuejs/devtools-v6#361

My next goal is to try to build this devtools version to make it testable with storybook. hopefully it should work fine.

@ndelangen
Copy link
Member

@y-nk that is freaking awesome!

@ndelangen ndelangen added this to the v4.0.0 milestone Sep 6, 2018
@ndelangen ndelangen mentioned this issue Sep 6, 2018
82 tasks
@igor-dv
Copy link
Member

igor-dv commented Oct 8, 2018

@ndelangen, maybe it worth fixing it for the v4?

@y-nk
Copy link
Contributor

y-nk commented Oct 9, 2018

@ndelangen sadly the Vue team doesn't seem to respond, i wonder if they have seen the post.

@ndelangen
Copy link
Member

@kazupon Do you think you could help us out here? if @y-nk can help getting this feature working that'd be amazing for vue users!

@ndelangen ndelangen removed this from the v4.0.0 milestone Oct 12, 2018
atepoorthuis added a commit to spatialnetworkslab/vue-gg that referenced this issue Jan 11, 2019
following this storybookjs/storybook#1708 (comment)

installed devtools globally (`yarn global add @vue/devtools`) because it requires electron which seems overkill to add in dev deps
atepoorthuis added a commit to spatialnetworkslab/vue-gg that referenced this issue Jan 14, 2019
* chore: add storybook custom head tag for dev tools

following this storybookjs/storybook#1708 (comment)

installed devtools globally (`yarn global add @vue/devtools`) because it requires electron which seems overkill to add in dev deps

* chore: add storybook to now.sh build

* fix: remove specific polygon mark render logic

already contained in mixin

* feat: add Area mark

* feat: add prevRow/nextRow to forEachRow

* chore: rename width to strokeWidth

* chore: consistent stroke/fill prop naming

Fixes #36

* feat: add opacity/strokeOpacity/fillOpacity props

* docs: minimal Area prop documentation

* chore: `style` in `CreateElement` not `attrs`

* fix: update color/opacity props in `createScale`

* refactor: optional options object to parseAesthetic.js

* refactor: replaced sortX by sort prop

* rename: MultiLine mixin to Path

* refactor: Area mark render logic

* docs: added docs for Area mark

* fix: typo

* refactor: set Mark aes defaults as component props
@lfkwtz
Copy link

lfkwtz commented Jan 15, 2019

@jackkoppa global install isn't required, running fine here on a dev dependency

@shilman shilman removed this from the next milestone Apr 26, 2019
@github-actions
Copy link
Contributor

Automention: Hey @backbone87 @elevatebart, you've been tagged! Can you give a hand here?

@fgm
Copy link

fgm commented Dec 4, 2019

In the meantime, zero-code/zero-conf hack: inspect the iframe in devtools, and right-click on "Open in new tab" on its "src" attribute, and you get the inspected component with the working devtools. Of course, you'll need to do it again every time you want to inspect another component.

@blocka
Copy link

blocka commented Dec 4, 2019 via email

@fgm
Copy link

fgm commented Dec 4, 2019

That's what I thought, and was my first idea, but it doesn't actually enable the Vue devtools, for some reason I couldn't guess. EDIT: I was not using the same button mentioned by @blocka.

@blocka
Copy link

blocka commented Dec 4, 2019 via email

@fgm
Copy link

fgm commented Dec 4, 2019

It looks like it should but it does not. Here are two screenshots, one with the popout mode:

Capture d'écran 2019-12-04 19 32 52

...which doesn't enable the tools, and the other one with the manual open which enables the Vue tools
Capture d'écran 2019-12-04 19 34 23

EDIT: my bad, we were not talking about the same button. So for whomever reads this, the "pop out" button is the second one, not the first one. Due the icon being similar to the one used by macOS to share content, I thought it was a share link, and only considered the maximizing button.

NateWr added a commit to pkp/theme-components that referenced this issue Jan 9, 2020
Allows use of standalone Vue dev tools to get around issue
with Vue not detecting components in iframes.

See: storybookjs/storybook#1708

See: https://github.com/vuejs/vue-devtools/blob/master/shells/electron/README.md
@niedzielski
Copy link
Contributor

the latest versions of storybook have a "pop out" mode, which basically does this for you

I was scouring the internet for "pop out mode" and didn't find anything 😆 I happened upon this mode today though! It's the button second from the right:

image

@ricardok1
Copy link

Is this still open?

@jackkoppa
Copy link

I'd be OK closing, after we can update the docs section here to explain the "Pop Out" mode, which does indeed solve the problems described here much more simply than enabling a local dev tools, for example

https://github.com/storybookjs/storybook/blob/next/docs/src/pages/guides/guide-vue/index.md

@blocka
Copy link

blocka commented Jun 22, 2020 via email

@shilman
Copy link
Member

shilman commented Jun 23, 2020

@blocka i think react devtools works using this hook:

https://github.com/storybookjs/storybook/blob/master/lib/core/src/server/templates/base-preview-head.html#L71-L73

somebody also added a hook for Vue devtools, but I guess Vue devtools doesn't support it

@blocka
Copy link

blocka commented Jun 23, 2020

So something has to be done in vue devtools for this to work?

@shilman
Copy link
Member

shilman commented Jun 23, 2020

I'm not familiar with Vue devtools, but that's my guess. I believe the way we support React devtools is through an API that they provide and we write to, since there is no general way to solve this iframe issue without security implications.

@braddialpad
Copy link

I'd be OK closing, after we can update the docs section here to explain the "Pop Out" mode, which does indeed solve the problems described here much more simply than enabling a local dev tools, for example

https://github.com/storybookjs/storybook/blob/next/docs/src/pages/guides/guide-vue/index.md

Link seems to be broken now, what is this "Pop Out" mode mentioned?

@unr
Copy link

unr commented May 31, 2021

@braddialpad I eventually found it through several other discussions on the same thing. They meant "pop out" the iframe, as in view the iframe source directly.
image

This will let you use vue dev tools.

@yannbf
Copy link
Member

yannbf commented May 31, 2021

@braddialpad @unr
There is a button on top right that opens the story in its own url:

image

@domyen I feel like this feature should have a proper name to avoid confusion. WDYT? Currently it says "open canvas in a new tab", some people say "pop out", others say "eject"...

@ndelangen
Copy link
Member

Yann is correct, that button is for this purpose exactly. Storybook will make sure all args and globals will be set correctly.

@sethidden
Copy link

sethidden commented Jun 9, 2021

Good news

If you download the latest beta of Vue devtools and open the storybook main page you'll see this:
image


image

As you can see that's the main storybook page, not the bare iframe view.

This works for both Vue 2/3-based storybooks

If you want to quickly jump in to check it out, here are repro steps with a repro script that didn't work on beta.13 for me and now works on beta.14: vuejs/devtools-v6#353 (comment)

@shilman
Copy link
Member

shilman commented Jun 10, 2021

Awesome. Going to close this issue! Thanks for the heads up @3nuc !!!

@shilman shilman closed this as completed Jun 10, 2021
@magersoft
Copy link

I have devtools version 6.2.1, vue 3 and @storybook/vue3: ^6.5.12
for me not working, Vue.js not detected. How to fix it?

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

No branches or pull requests