This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-27
Channels
- # aleph (8)
- # announcements (14)
- # beginners (25)
- # cider (20)
- # cljdoc (5)
- # clojure (70)
- # clojure-europe (2)
- # clojure-germany (6)
- # clojure-italy (8)
- # clojure-nl (3)
- # clojure-russia (107)
- # clojure-spec (22)
- # clojure-uk (40)
- # clojurescript (18)
- # core-async (3)
- # cursive (8)
- # data-science (11)
- # datomic (20)
- # editors (1)
- # emacs (5)
- # figwheel-main (19)
- # fulcro (25)
- # graphql (1)
- # hoplon (2)
- # hyperfiddle (2)
- # jobs (1)
- # leiningen (3)
- # lumo (4)
- # off-topic (40)
- # pedestal (1)
- # quil (4)
- # re-frame (5)
- # shadow-cljs (105)
- # sql (4)
- # uncomplicate (1)
@thheller thanks. Have set that flag, and also :autoload
and :ignore-warnings
to true: https://github.com/thisdotrob/shadow-cljs-node-hot-code-reload
__filenamex /mnt/c/Users/thheller/code/shadow-cljs/tmp/shadow-cljs-node-hot-code-reload/out/demo-script/script.js
starting server
http server running
stop called
stop completed undefined
__filenamex2 /mnt/c/Users/thheller/code/shadow-cljs/tmp/shadow-cljs-node-hot-code-reload/out/demo-script/script.js
start called
starting server
http server running
I was trying to replicate my other shadow-cljs project's setup which starts serving up a re-frame app straight automatically after compiling, but for node-script. More investigation needed
Yep open it in a browser, but I have :http-root
and :http-port
so it is being served up automatically after compiling
was hoping to have a similar setup for my node server, with it starting automatically
@rs nothing starts automatically with a browser app. you need to open it otherwise nothing else happens. the http server literally just serves files nothing else.
node server starting is out of scope yes since you may need stdin or just want a CLI script to exit
you can always use shadow-cljs node-repl
and do things manually but it won't execute hooks
@thheller I’m trying to get started with a local fork of shadow — are there any more instructions than CONTRIBUTING.md ?
I want to diagnose and try and fix https://github.com/thheller/shadow-cljs/issues/422
you can just put this file into your classpath https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/client/browser.cljs
might need this too https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/client/hud.cljs
shadow.dom.append.cljs$core$IFn$_invoke$arity$2 [Line: 867, Col: 1], shadow.dom.js
shadow.cljs.devtools.client.hud.dom_insert.cljs$core$IFn$_invoke$arity$2 [Line: 360, Col: 1], shadow.cljs.devtools.client.hud.js
shadow.cljs.devtools.client.hud.dom_insert.cljs$core$IFn$_invoke$arity$1 [Line: 342, Col: 1], shadow.cljs.devtools.client.hud.js
shadow$cljs$devtools$client$hud$connection_error [Line: 770, Col: 1], shadow.cljs.devtools.client.hud.js
Anonymous function [Line: 1038, Col: 1], shadow.cljs.devtools.client.browser.js
I don’t think that’s it — my hunch is that body
is not available yet when I load my code.
Ah, cool — yes, it wouldn’t be able to do the connection because it’s running in a VM.
I might need to proxy that shadow websocket anyway, because then things like browserstack can never work. I want to get my designers a way to see their changes live on many different browsers.
Still though, I think the fact that hud/dom-insert
is using js/document.body
is a little smelly 🙂 I’ll see if I can tweak that to make sure the error reporting works.
Yes, of course — this is caused because I load my CLJS in head
(long story, unavoidable unfortunately). Many things break 🙂
It’s funny how most of us now assume that JS is going to be loaded at the end of the body
element.
all of this happens async. I don't know why IE11 even attempts to connect while body
is not present
I’m trying to override hud.cljs
. I’ve placed it right in my source path, path is <source-path>/shadow/cljs/devtools/client/hud.cljs
but my changes don’t seem to have any effect. Am I doing something wrong?
Regarding the timeout thing, I see here: https://github.com/thheller/shadow-cljs/blob/9752ddcf0502b559ccae66389f4e61e7d13bbd7c/src/main/shadow/cljs/devtools/client/browser.cljs#L371-L374
So the moment this the websocket error happens, the hud tries to show the connection error and then blows up.
dunno. not sure I want to support ancient browsers. I hate ie11 enough for work I don't really want to deal with it elsewhere 😉
Still though, seems off to delay connecting the websocket until the document is ready.
OK, I’ve got this working — on to the next hurdle: getting a relative :devtools-url
to work. It seems the code in env/ws-url
expects a full url because it tries to replace http
with ws
.
I’d like to have my devtools-url
be /shadow-cljs-server
so that it goes to whatever the serving address is…
whoops, sorry, reuse the same port and host. So my webserver is responsible to proxy the traffic.
Just to clarify: I’m loading my page from
. I want to instruct shadow to connect to
. But I’m also loading my page from
, so I want then the connection to be
Hm, replacing env.cljs
doesn’t seem to take any effect. I wonder if all the google-closure defines at the top have anything to do with it.
What a wild goose chase. Turns out the default behaviour of shadow is just right — it’s trying to connect to “whatever-host-you-have:9630” which should just work for all my use cases. But, IE11 inside that VM complains with: SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status Code: 200, OK
it shouldn't answer with that though? should get an upgrade response? is a proxy or something active?
This is definitely IE11 specific. Chrome inside that VM is working correctly with the default shadow settings.
I suspect something about security things but I’m not quite sure how to troubleshoot this.
To clarify: shadow’s default that connects to
works just fine when using chrome inside a VM and safari outside the VM, where original-host
is different. It’s only IE11 that complains with that cryptic error.
I give up. IE11 on windows 10 manages to connect succesfully. Funnily enough, there, reloading only works with dev tools open. Otherwise I get a shadow hud saying: [reload failed] invalid calling object
I’ll update my issue with all this info, and a PR for the websocket connection on document load.
@orestis I had one of those issues with IE before. forgot the details though. something to do with standards/quirks mode
All I want is my designers to be able to quickly preview CSS/markup changes on both IE11 and modern browsers. Having the devtools open is not a deal breaker for this, so I’ll stop exploring for now.
I wonder, is that barrage of document.write
s something that shadow-cljs controls? Or does it come from some lower level?
It makes working with browserstack (where the VM running the browser is far away) a tad painful.