This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-18
Channels
- # announcements (6)
- # babashka (137)
- # beginners (104)
- # biff (4)
- # calva (24)
- # cider (1)
- # clj-kondo (15)
- # cljs-dev (18)
- # cljsrn (1)
- # clojure (43)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojure-germany (3)
- # clojure-nl (3)
- # clojure-spec (40)
- # clojure-uk (6)
- # clojured (1)
- # clojurescript (24)
- # code-reviews (14)
- # core-logic (5)
- # cursive (24)
- # datahike (2)
- # datomic (3)
- # deps-new (9)
- # events (5)
- # figwheel-main (1)
- # fulcro (7)
- # helix (3)
- # honeysql (8)
- # jobs (4)
- # jobs-discuss (7)
- # lsp (59)
- # malli (9)
- # mid-cities-meetup (1)
- # nrepl (2)
- # off-topic (27)
- # portal (11)
- # re-frame (16)
- # reitit (1)
- # releases (12)
- # remote-jobs (4)
- # shadow-cljs (48)
- # spacemacs (1)
- # vim (9)
- # xtdb (14)
hello, is there any need to have test dependencies in any way separated from the other (runtime) dependencies. Will shadow-cljs automatically remove unused dependencies when I run shadow-cljs release app
?
@franklineapiyo your builds only include whatever you :require
in your namespaces. having extra :dependencies
does not matter when they are not required in your build directly. generate a build report to see what ended up in your build and why https://shadow-cljs.github.io/docs/UsersGuide.html#build-report
Hello, channel! I am trying to generate a js with a hash for my project, but it seems I have no idea how to dynamically include a hashed js file into an html. How do I make sure that my index.html file includes the latest module with a hash if I use
:module-hash-names
?you can use the manifest to generate the HTML you need https://shadow-cljs.github.io/docs/UsersGuide.html#BrowserManifest
or you can use this hook https://github.com/thheller/shadow-cljs/blob/master/shadow-cljs.edn#L150-L152
no way for me to tell without seeing what you did 😛 I know that the implementation works since I use it
basically you need to have a source html file that has <script src="/js/base.js"></script>
tag already
all the copy does is replace the src path, and only if the source path matches you configured :asset-path
+ the module name
what is your :asset-path
? what is your script src
? and what is your :build-hooks
config?
I have src/index.html
file that contains <script _src_="js/compiled/main.js" _type_="text/javascript"></script>
tag. I have shadow-cljs.edn
that has
:frontend
{:target :browser
:output-dir "public/js/compiled"
:asset-path "/js/compiled"
;; :compiler-options {
;; ;; add env vars
;; }
:build-hooks [(shadow-env.core/hook)
(shadow.html/copy-file
"public/src/index.html"
"public/index.html")]
:module-hash-names true
;; ;; :fingerprint true
;; :build-options {:manifest-name "manifest.json"}
:modules {:main
{:init-fn mytherapy.core/init!}}
;; :compiler-options {:externs ["public/js/plugins/"]}
}
I dont know, if I switch to <script _src_="/js/compiled/main.js" _type_="text/javascript"></script>
and :output-dir "public/js/compiled" and :asset-path "/js/compiled" they do not seem to affect the behaviour
very likely you want :asset-path "/js/compiled"
and script src="/js/compiled/main.js"
i'm trying to fix an issue in a dep two levels down with an externs file. i can get the extern to work if i put the file in my repo and add it to :externs
but i'm trying to add it to the dep (via deps.cljs
in that jar) so that other projects can get it for free... but it isn't getting picked up that way. anyone know if this does or doesn't work? versions to use? pointers on debugging?
i'd love to have shadow-cljs print out what it's passing to the compiler... if that's even how it works 🙂
or does anyone know if {:externs ["file.js"]}
is enough... or does it need foreign-libs
to work? (from a jarred deps.cljs
)
the shadow build produces a jar manifest that has the externs file contents (in "~:resources"
), but the "~:externs"
is just []
... there aren't any other files in it though... it looks like it's treating it as a js module
confirmed, if i rename that file to .txt it no longer shows up in the manifest even though it's supposed to be in :externs
yeah, libraries nowadays should really use ^js
hints when needed. that works in everything and is easier to maintain.