Fork me on GitHub
#shadow-cljs
<
2022-09-17
>
puchacz13:09:51

hi, I connected cider-cljs and I have REPL, but my source buffer says cider[not connected], and I cannot use commands like M-. (jump to definition) or C-z (go to REPL). the REPL works all right though. and the sesman-browsser shows my session with suspicious message (pending-cljs):

puchacz13:09:51

1: projects5/bubrary-gui:localhost:9000 linked-to: proj(~/projects5/bubrary-gui/) objects: cider-repl %s(pending-cljs)

puchacz13:09:12

(trying my luck with the same issue in cider)

Fredrik Andersson13:09:27

I'm trying to make the dev-http serv index-files from subdirectories for instance where /index.html would serve / and /app/index.html would serve /app

Fredrik Andersson13:09:43

is there any configuration that I am missing?

thheller14:09:45

no, it just assumes push-state routing. meaning your client doing the route logic with a base index.html

Fredrik Andersson14:09:12

yes, I read that in the docs - i wish to have a static landing page on the root and the SPA in /app is it possible to configure this scenario?

thheller14:09:10

/app/might work?

Fredrik Andersson14:09:51

no it still renders /index.html

thheller14:09:49

there is no setting for this. you can however just use any webserver that exists

thheller14:09:00

all they need to do is serve the static files

Ted Ciafardini21:09:16

Trying to get rid of a warning when I deploy my app:

:WARNING: You required cljs-devtools library in a project which is currently compiled with :optimizations :advanced.
remote:                 You should remove this library from non-dev builds completely because it impedes dead code elimination.
remote:                 The best way is to use :preloads compiler option: .
remote:                 To silence this warning please set :silence-optimizations-warning config key to true.
remote:                 More details: .
My shadow-cljs config is:
{:nrepl {:port 7772}
 :builds {:app {:target :browser
                :output-dir "target/cljsbuild/public/js"
                :asset-path "/js"
                :modules {:app {:entries []}}}
          :dev {:target :browser
                :output-dir "target/cljsbuild/public/js"
                :asset-path "/js"
                :modules {:app {:entries []}}
                :devtools {:preloads [day8.re-frame-10x.preload]
                           :watch-dir "resources/public"}
                :dev {:closure-defines
                      {re-frame.trace.trace-enabled?        true
                       day8.re-frame.tracing.trace-enabled? true}}}
          :test {:target :node-test, :output-to "target/test/test.js"
                 :autorun true}}
 :lein true}
I thought taking the dev tools out of the ‘app’ build (used for deployment) would resolve the issue - any help appreciated

Ted Ciafardini21:09:05

at deployment this script is run:

#!/usr/bin/env bash
npx shadow-cljs release app
lein uberjar

thheller04:09:28

I'm guessing that somewhere in your code you directly require something from devtools.*?

thheller04:09:36

devtools.core or devtools.preload or something

thheller04:09:25

splitting into a :dev build is not idiomatic. you can configure dev/release specific things in the main config. see https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration