Fork me on GitHub
#shadow-cljs
<
2019-05-02
>
thheller08:05:47

@richiardiandrea shadow-cljs doesn't do any classloader magic BUT once native-image is compiled you can't change the classpath at all

thheller08:05:24

so you could create a native-image on the client after all :dependencies were configured but that is completely impractical

thheller08:05:44

startup time really isn't much of a factor if you use server mode properly

richiardiandrea16:05:49

Will except that my colleagues always complain when CI is slow šŸ˜„ but maybe that it more of a people's problem

thheller16:05:42

caching makes a big diff. do you have that setup properly?

richiardiandrea16:05:40

In CI no, unfortunately we were on Azure

richiardiandrea16:05:10

They are slowly adding it to Azure so maybe soon this problem will go away

thheller16:05:10

no clue how azure CI works but if you can persist some state between builds it should be easy

thheller16:05:49

typical CI caching is pretty shitty for this actually since it usually just takes a hash of some file which isn't enough

thheller16:05:06

just some disk space that you can store stuff on would be enough

richiardiandrea16:05:37

yeah I think I will need to do that

thheller08:05:06

appcds can cut it by 50% almost but has the same classpath limitations

thheller08:05:25

I experimented with adding a shadow-cljs appcds command to the create archive

šŸ‘ 4
thheller08:05:36

but that takes a couple min to create

thheller08:05:55

so for that time to pay of you kinda have to start shadow-cljs 20x or so

richiardiandrea16:05:39

It would be worth adding it for CI builds

thheller08:05:20

so I decided not to add it

deplect14:05:26

I noticed something in the version 2.8.33 when trying to load multiple aliases like shadow-cljs -A:dev -A:nrepl this works with clj. It only takes the last from what I can deduce. Is there some trick to get them both to load?

thheller14:05:54

shadow-cljs -A:dev:nrepl should work

deplect14:05:48

yes! Thanks again @thheller šŸ˜Ž

Stefan15:05:25

Hi guys, got myself an interesting challenge again. Iā€™m trying to write a React Native app that uses WebAudio. From what Iā€™ve been able to find, this requires using a native webview in my app, for which I use the react-native-webview (https://github.com/react-native-community/react-native-webview) module. The API of that web view requires that Javascript is injected into it as a string. I want that to be ClojureScript, so I want to use shadow-cljs to compile the clojurescript to javascript, in my app read that javascript file and inject its contents into the webview. So my question is: can I tell shadow-cljs somehow to output everything in a single file, even in dev mode, instead of the multitude of files that are created by default?

thheller15:05:58

it might not work but try setting :devtools {:loader-mode :eval} in the build config

thheller15:05:17

and you'll probably need to use compile not watch to create the audio build

thheller15:05:23

somehow doubtful that the life reload stuff would work

Stefan15:05:22

Thanks @thheller Iā€™ll give it a shot. I was not expecting the live reload to work for the audio part. It would be extremely cool to have a REPL in there though, that would beat any JS dev tool out there for embedded web views šŸ™‚

Stefan15:05:49

(What does this ā€œloader-modeā€ do, do you have documentation for it?)

thheller15:05:52

maybe it works .. depends on what the webview can do (ie. websocket)

richiardiandrea16:05:49

Will except that my colleagues always complain when CI is slow šŸ˜„ but maybe that it more of a people's problem

wiseman17:05:25

@heikki.hamalainen i donā€™t know if your issue is completely resolved, or if this helps, but i donā€™t use a dynamic require with cljs-http and xhr2: https://github.com/r0man/cljs-http/issues/94#issuecomment-426442569

wiseman17:05:06

(though iā€™ve stopped using cljs-http because of https://github.com/r0man/cljs-http/issues/121)