After reading the --watch
argument for cljs.main/main
it seems you can watch multiple directories if you separate them with a path-separator
. As an example, this seems to work:
--watch "src:test"
Im not too familiar with pathSeparator
, but it’s my understanding that the above path string separated using :
would only work on mac and linux. iS this correct or would this work on windows as well?it seems likely that you would need a ;
on Windows, not a :
. I would think it comes from the Java lib : https://docs.oracle.com/javase/8/docs/api/java/io/File.html#pathSeparatorChar
Yeah, that was my thought as well 😞
Anyone know the preferred way of specifying a system-independent path? or perhaps this is intended?
read about java.nio.Path
lots of facilities in that
Sorry, I meant inside of a deps.edn
file. Unless i’m missing your suggestion?
surely deps.edn is going to be using java to actually process the specified path
That sounds right, but I think my mental gap is I don’t know what that looks like to specify this in the deps.edn
file. I will dig into this a bit.
It is not clear to me that there is a way to specify the command line args --watch "src:test"
for Mac and Linux systems, but --watch "src;test"
for Windows systems, from the same single deps.edn
file.
Although if you use WSL on Windows, perhaps the :
separator would work there as it does on Linux?
I guess you'd be able to use a different alias on windows vs *nix to set the command line args?
Yeah, looks like that might have to be the way. Upon re-reading the description again:
Specifies a system-dependent path-separated list of directories to watch
Sounds like it’s literally in the documentation that the path, should you choose this route, only works on specific systems.Is there a tool or library (js or cljs) available which provides the MDN API so that it can be used interactively as when writing a web app? I would like to write this in cljs without having to wait until running the code inside the browser to get some feedback. Thanks for any comment.
Hello guys, I’m using lein fighwheel, but I have a config file with environment variables to dev and production, how can I setup my application to know when is DEV and get variables from dev ? in build time :thinking_face:
An autocomplete plugin for IDE to use (js/….) ?
If your CLJS repl is connected to a browser you have all the API’s there behind js/...
One way is to use :closure-defines
compiler option https://cljs.github.io/api/compiler-options/closure-defines
If I remember correctly lein
can read your environment variables and pass them into :closure-defines
Yeah, you something like this in project.clj
:dbname ~(get (System/getenv) "DB_NAME")
Do you have an example project like this ? Because I tried to use clojure-defines but a have many variables in a file
I think you have to name all the variables that you’re going to pass to :closure-defines
. I’m sorry I don’t have any examples that reads closure-defines from env vars but I think you could achieve that by doing something like this https://github.com/lipas-liikuntapaikat/lipas/blob/master/webapp/project.clj#L165 but instead of hardcoding the value you put in something like this ~(get (System/getenv) "MY_ENV_VAR")
👋
Thanks @valtteri
Has anyone here worked with React Native and shadow-cljs and has successfully written platform-specific code? I wondering how it’s done since I don’t see a way to note which namespaces are for which platform
one way is to add custom reader conditionals: https://shadow-cljs.github.io/docs/UsersGuide.html#_conditional_reading though that only works with cljc files