shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
2021-04-24T02:13:09.468500Z

can you post your shadow-cljs.edn config for this build? you likely have to set :output-dir and asset-path to different values than they are now. For example:

:builds 
{:my-build {:output-dir  "dev/public/js" :asset-path "/js" :modules {...}
  :devtools   {:http-port          8021
                                  :http-resource-root "public"
                                  :http-root          "dev/public/"}}

thheller 2021-04-24T07:32:57.469300Z

@huxley you cannot open the html file directly from disk. it needs to be served via http (eg. via :dev-http)

2021-04-24T07:33:27.469500Z

thx

yiorgos 2021-04-24T21:10:05.471600Z

what opts do I need to pass in this line? :main-opts ["-m" "shadow.cljs.devtools.cli" ] I fount that line here https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn

yiorgos 2021-04-24T21:10:33.472100Z

can I hardcode the watch app in the deps.edn?

thheller 2021-04-24T21:10:49.472500Z

sure, just add "watch" "app"

๐Ÿ‘ 1
yiorgos 2021-04-24T21:10:56.472700Z

something like :main-opts ["-m" "shadow.cljs.devtools.cli" "watch app"]

yiorgos 2021-04-24T21:11:09.473100Z

ah, let me try

Janne Sauvala 2021-04-24T23:02:00.473400Z

Hello ๐Ÿ‘‹:skin-tone-2: If I have understood correctly shadow-cljs produces some JS code that will open a websocket server (in the client) and adds that to the rest of the JS code generated from CLJS. That websocket server will then accept new code updates (like userโ€™s REPL evals) from the shadow-cljs process (that does the compilation of the CLJS code to JS). Would it be possible to open manually the websocket server inside the library I have created (I guess I can just require shadow-cljs NPM package and use that?) and make it accept JS code coming from the shadow-cljs build process?

thheller 2021-04-25T07:42:08.474100Z

well most importantly shadow-cljs is written in Clojure not ClojureScript. so you cannot embed it into a JS process.

thheller 2021-04-25T07:42:41.474300Z

but also that part of shadow-cljs is not written as a library and cannot be used like that. it is meant as a standalonee process to do what shadow-cljs does not some other user-related things

Janne Sauvala 2021-04-25T09:10:00.476400Z

Thanks for the answers. Iโ€™ll go back to the hammock to think about this ๐Ÿ™‚

Janne Sauvala 2021-04-24T23:02:18.473500Z

Iโ€™m interested trying out to keep the REPL-feeling when I have done a release build. The release build will strip away this websocket-server since it is made to be used only for dev time.