This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-07
Channels
- # beginners (142)
- # boot (18)
- # cider (39)
- # cljs-dev (2)
- # cljsrn (11)
- # clojars (8)
- # clojure (51)
- # clojure-brasil (3)
- # clojure-italy (22)
- # clojure-losangeles (2)
- # clojure-nl (20)
- # clojure-nlp (2)
- # clojure-russia (4)
- # clojure-serbia (2)
- # clojure-spec (90)
- # clojure-uk (147)
- # clojurescript (116)
- # data-science (10)
- # datomic (189)
- # devcards (31)
- # duct (6)
- # emacs (12)
- # fulcro (16)
- # graphql (36)
- # juxt (1)
- # off-topic (5)
- # om (11)
- # overtone (2)
- # pedestal (4)
- # perun (1)
- # portkey (17)
- # reagent (6)
- # reitit (3)
- # shadow-cljs (57)
- # spacemacs (45)
- # specter (8)
- # tools-deps (46)
@thheller hello man, how you doing? question, how does work the part of shadow that you can click on a warning and it opens on the editor? I'm looking at the sources and see that it triggers something on the server to do it, can you tell me how that works?
and you know if it's possible for me to do something similar strait in the browser? for context, I'm creating a devcards alternative, and I would like to jump to the card source from a button in the page
can't do it straight in the browser no. it basically just does a xhr and the server then executes via the shell https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/web/api.clj#L55-L86
uses ProcessBuilder https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/util.clj#L363-L396
since the browser can't just randomly start applications it must go through the server
gotcha, so I think I'll make this "shadow-only" and I can just leverage your xhr call
good idea
Looked at the issue and the PR and left some comment there, I think there is value...but the target can be made generic - say :lambda-fn
- and the metadata dropped - easy to write anyways`.
Will try to come up with a PR today and probably I will ask you more questions on how to package everything, node_modules
included, in a single file
@thheller ^ and thanks 😉
@thheller trying to use the open-file, but not working, I guess I might be sending the wrong path, what the path need to be relative to?1
I'm getting the info out of (meta &form)
, but the path there seems relative to its own source path, do you know if I can get the absolute path there somehow?
I got annoyed by leaking /home/thheller/code/shadow-cljs/src/...
or other absolute paths into the compiled output
I could add another open-classpath
fn that maps the classpath path to an absolute path and opens that
gotcha, I couldn't make it work, I tried manually asking for the shadow file
the editor gets focused, but the correct file isn't opened
I tried relative to project and absolute
on the js console this line doesn't work at all
shadow.cljs.devtools.hud.open_file("shadow-cljs.edn", 1, 1)
VM52189:1 Uncaught TypeError: Cannot read property 'open_file' of undefined
at <anonymous>:1:26
ah, was msising client: shadow.cljs.devtools.client.hud.open_file("shadow-cljs.edn", 1, 1)
but still, not focusing the correct file
yeah, when I click from a warning it works
ups, or at least was working early, for some reason seems like that isn't working now either
let me try restarting shadow
now it's not working anymore, even on warnings =/
I have this on ~/.shadow-cljs/config.edn
{:open-file-command
["idea" :pwd "--line" :line :file]}
strange, I''m sure it worked earlier
maybe, I'll try restarting it
still the same, I'll give up on that for now, not that important
I'm finding that running shadow-cljs via "clojure" (with a deps.edn file) results in a process that never exits.
I converted my deps.edn to a project.clj and running under lein I don't have the same issue.
It looks like any action that shells out to the clojure process never returns. I can put together an example repo in a couple hours if you want.
$ yarn shadow-cljs clj-eval "(println \"hello\")"
yarn run v1.7.0
warning package.json: No license field
$ /home/oscar/Projects/penny-profit/redux/node_modules/.bin/shadow-cljs clj-eval '(println "hello")'
shadow-cljs - config: /home/oscar/Projects/penny-profit/redux/shadow-cljs.edn cli version: 2.3.36 node: v10.4.0
shadow-cljs - starting via "clojure"
hello
nil
had you tried without yarn
? I used with deps.edn before, didn't had this issue, also there is a strange thing about the 130 status code return, I wonder if that + yarn is getting you in this place
yeah check which process actually doesn't exit. is it really the java process sticking around?