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

Reopen index.html when I close it? #1135

Open
vemv opened this issue Jul 24, 2023 · 3 comments
Open

Reopen index.html when I close it? #1135

vemv opened this issue Jul 24, 2023 · 3 comments

Comments

@vemv
Copy link

vemv commented Jul 24, 2023

I have the pretty severe muscle memory of closing Chrome tabs.

With it, I can close index.html, and with it, my IDE experience will significantly degrade.

I can spend a while realising the cause of this.

So, perhaps there could be an option such that on disconnect, the shadow-cljs would print shadow-cljs disconnected. or so.

Even better, it could be a plugable function so that I can (clojure.java.shell/sh "open" "index.html") instead.

Don't know if this is there already / a FAQ, etc.

Thoughts?

Thanks - V

@thheller
Copy link
Owner

There is no such thing as opening a browser for any regular build at the moment. Your editor might attempt it, but shadow-cljs does not as this would require an additional config option. I'm fine with adding something like :devtools {:open-url "http://localhost:4000" :reopen true} or something, just never personally felt the need. Cursive doesn't depend on my having my REPL connected.

I'm fine with printing something too, you can set :log {:level :debug} in shadow-cljs.edn, as that already does a bare print, which would be trivial to turn into some proper "text". However at least for cider I don't know where that would end up. I believe it banishes all stdout to a panel you are unlikely to look at. And random REPL messages it didn't expect (ie. not part of an eval) also were equally "invisible" last time I checked.

All information related to REPL connects/disconnects is available for everyone that is interested in it. Just currently only exposed via shadow remote and severly underdocumented. Nobody had any interest in the version accessible over nrepl so far, it does still exist and maybe cider wants to make use of it?

@vemv
Copy link
Author

vemv commented Jul 25, 2023

Thanks for the response!

I'm fine with printing something too, you can set :log {:level :debug} in shadow-cljs.edn, as that already does a bare print, which would be trivial to turn into some proper "text". However at least for cider I don't know where that would end up.

CIDER already prints a variety of possible shadow-cljs messages (while doing no special effort at accomplishing so), while staying on the default log level:

image

Therefore, it would seem easy, and consistent with the rest of the existing experience to print a Disconnected [...] message that was reachable at the default logging level.

I'm fine with adding something like :devtools {:open-url "http://localhost:4000" :reopen true} or something, just never personally felt the need.

Nice. If I appreciated, I could offer a PR with that.

At this point I would be happy with a simple println though. I don't like suggesting/introducing heavier changes untill I consider my need fully time-proven.

Cheers - V

@thheller
Copy link
Owner

A quick hack would be adding that log here

(defn remove-runtime [worker-state runtime-id]

If :runtimes is empty it could log something else?

Not sure that's where I'd want it to be ultimately but could be an option.

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