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

Sources > Filesystem > "Add Folder To Workspace" not working in Dirac 1.2.37 #80

Closed
aeberts opened this issue Aug 25, 2018 · 8 comments
Closed

Comments

@aeberts
Copy link

aeberts commented Aug 25, 2018

Environment:
Dirac Version 1.2.37
Chromium Version : 70.0.3505.0
Mac: 10.13.6

Issue: In the Sources >> Filesystem section of Dirac devtools, clicking the button "Add folder to workspace" does nothing.

Expected behaviour: In the Sources >> Filesystem section of devtools, clicking the "Add folder to workspace" button would present the user with a file chooser dialog and allow the user to select a folder to add to the Sources section.

Actual behaviour: When clicking "Add folder to workspace" no dialog is displayed. Nothing happens when dragging folder from the filesystem to the main "Sources" window.

Reproduction steps:

  • Install Dirac extension from Chrome Extension store
  • Start Chromium 70.0.3505.0 with remote debugging enabled
  • Start re-frame application, nrepl and dirac agent as outlined in installation instructions
  • Click Dirac extension and make sure that dirac can connect to the nrepl server
  • In Dirac, click the "Sources" section. Click the "Filesystem" subsection.
  • Click the button "+ Add folder to workspace"
  • Result -> Nothing happens. (no error message in terminal log)

Additional Notes:

In a dirac-enabled re-frame project, dirac is installed and appears to work correctly (Dirac UI starts, connects to the Dirac Agent and presents a cljs REPL that evaluates simple cljs expressions).

In a regular devtools window running in Chromium 70.0.3505.0 the "Add folder to workspace" button works as expected (i.e. the dialog is displayed and the source folder is added to the filesystem section).

@darwin
Copy link
Member

darwin commented Aug 25, 2018

Thanks for detailed report. I have reproduced it here. It sounds like a general limitation of DevTools running in so called "hosted mode" as a simple web app. That is what dirac does, it hosts devtools javascript files in a chrome extension and runs it as a simple web app talking to chrome debugging port.

There are known limitations of running DevTools in hosted mode. I looked briefly at the source code and indeed "Add folder to workspace" tries to call into InspectorFrontendHost API which is not fully available in hosted mode.

@darwin
Copy link
Member

darwin commented Aug 25, 2018

There is a relatively new command-line switch --custom-devtools-frontend[1] for instructing chrome to use different sources (urls) as "internal" devtools. I believe in this mode Dirac DevTools fork would be full-featured.

When I started hacking on Dirac this option wasn't available, that is why it is hosted inside an extension. Maybe it won't be that much work to support the --custom-devtools-frontend based workflow. But I'm not going to investigate this unless there is a critical need for it.

[1] https://codereview.chromium.org/2458033003/

@aeberts
Copy link
Author

aeberts commented Aug 26, 2018

Thanks for the detailed response. I do not personally have a critical need for this to work but I think supporting the workspaces in Dirac would bring it one step closer to being able to use dirac as your primary code editor for CLJS. With figwheel compiling changes in the background, I imagine that this could be a more productive workflow than switching to and from an external editor.

@darwin
Copy link
Member

darwin commented Aug 26, 2018

I personally feel this would be too early and ambitious. I haven't seen any javascript devs using DevTools with workspaces as their code editor.

btw. I believe you can still use internal DevTools for workspaces-related functionality and Dirac DevTools for REPL and debugging. This newly works thanks to recently implemented support for multiple clients talking to chrome debugger protocol.

@aeberts
Copy link
Author

aeberts commented Aug 26, 2018

Using two different Dev Tools (one for workspace and the other for REPL and debugging) sounds like a great workaround.

@darwin
Copy link
Member

darwin commented Jan 8, 2020

@aeberts FYI, we are getting closer to have Dirac running with --custom-devtools-frontend
https://github.com/binaryage/dirac/releases/tag/v1.5.0

@aeberts
Copy link
Author

aeberts commented Jan 8, 2020

@darwin Sounds promising! Looking forward to taking it for a test spin.

@darwin
Copy link
Member

darwin commented Jan 14, 2020

I just tested it with Dirac v1.5.3 using new dirac cli workflow and seems to work as expected.

Feel free to reopen if you spot any difference between Dirac and stock DevTools.

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

2 participants