Is it a known issue where async cljs tests are running twice after hot reload?
Feels like test env is not being cleared, but looking at the code cleaning the env is always called in the end.
@roman01la don't think anyone has reported that bug before
but goes w/o saying this needs reproducer w/ just ClojureScript
i.e. standard REPL only
(require 'foo :reload)
ok, I'll try that
I will note that I use the standard Node.js REPL and reload test namespaces quite a bit and I've never seen this problem
Just tried it, couldn't repro as well
time to dig into tooling... 😫
I have the following issue with trying to use cljs.analyzer.api
https://clojurians.slack.com/archives/C03S1L9DN/p1585922766236400
by external dependencies I mean the CLJS/JS sources that are not directly part of my project, but are added to my classpath via tools.deps
I can build my project just fine via cljs.build.api
and I'm not sure how cljs.analyzer.api
is different in handling these dependencies
you need to make sure you're using the deps alias
also an example of the api calls you're making would be helpful
sure, so for building this works fine:
(cljs.build.api/build
{:output-to "resources/public/js/app.js"
:output-dir "target/cljs"
:externs ["lib/externs.js"]
:optimizations :advanced
:main "example.core"
:source-map false
:pretty-print false
:pseudo-names false
:elide-asserts true
:fn-invoke-direct true
:parallel-build true})
but when I try to run analyze with the same options:
(cljs.analyzer.api/analyze-file (<http://clojure.java.io/file|clojure.java.io/file> "src/cljs/example/core.cljs") {...same options...})
I get No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file file:/usr/home/ak/.m2/repository/reagent/reagent/0.10.0/reagent-0.10.0.jar!/reagent/core.cljs
let me know if I can provide any additional info
@ak407 yeah you can't call it like that - you need to make a compiler state first and pass it as the first argument
@ak407 and there's actually no good way to do it via a public api in the current release
@dnolen: thanks, good to know. any non-public api I can use? 🙂
(cljs.env/default-compiler-env compiler-options)
then try passing that as first arg to analyze-file
@ak407 if you're doing tooling or heavy-duty analysis also not much wrong w/ just using the analyzer directly - there's the risk that your tool might break of course but you just have to live w/ that
we don't change the details of the analyzer that often
@dnolen: thanks again, I'll give it a shot
@ak407 in the next release this will be cleaned up a bit if you discover analyze-file
is good enough for what you want to accomplish
(ana.api/analyze-file (ana.api/empty-state options) ...)