Fork me on GitHub

anyone actively uses react native with shadow cljs?


i developed an #fulcro app targeting react native since before #shadow-cljs support react-native (~2019). I used npm-module target and things work pretty well Even things like hot reload works in some how Now I already ported most of the things to react-native target and etc I'm just sharing that things in cljs/shadow are pretty stable and you can trust them 🙂 I still think that in 2019 I had the better/fastest code-reload/dev-experience available in react-native world. And the setup to share code between native and web is WAY simpler than anything with webpack


yeah, react in 2017 was faster than react@next is now


never mind, it just started working on its own. dark magic


took me more than a week from first cloning the react-native repo with shadow config 😄


it's difficult to follow something which starts from assumptions that I am ignorant about 🙂


That was the repo I was specifically mentioning. I tried to do those steps, and it took me over a week to get to the place where everything connects. For two days the build was working but for some reason the websocket had issues. That was the last thing, and that was the only thing that fixed itself. It requires an emulator or usb, which i haven't tested. took me a bunch of days just to be able to run the emulator, I had to disable wsl2 which contained all my working environment. Then, wherever should I get react-native binary in my PATH? I ended up using npx, so that's a diversion already, I have zero idea what you had set up. Then, for some reason, it requires create-react-class, I had to install that manually, there was no way around it. It's not part of your repo anywhere 🙂 To be clear, I am still 100% amazed that it works and it's all as promised and I am very grateful for everything.


Hi there. I’m using :module-hash-names true and when I do a release build I get the fingerprinted file. However, if I then remove the .shadow-cljs folder and do another release build I get a file which has a different fingerprint even though there have been no code or dependency changes. It appears that the munged variable names are different. Q: is this expected? I assumed that the build process would produce identical output given identical input, but maybe that’s not the case?


no, builds are not 100% deterministic. by deleting .shadow-cljs you are basically destroying the reproducible part 😉


@thheller ok, thanks for confirming. Our builds are done on CI and we are not sharing the ‘.shadow-cljs’ between build machines. We were confused as to why our fingerprints change with every build even if there are no cljs code changes.


Can someone tell me what I'm missing here? I've added clojurescript/shadow-cljs to my project and when I go to my default index page I do get indication that it's picking up on shadow-cljs in the lower left corner. However as far as detecting any functions I write in core.cljs or even my cljs repl it's a no go. Not sure what else I'm missing or where I goof'd


@decim "However as far as detecting any functions" what does that mean? what are you doing exactly?


@thheller say I even try (js/alert “foo”) it doesn’t pick up on it. It looks like it should be reading my app.js file but it doesn’t appear so. I’m not quite sure, after tinkering for a few hours.


I need more information


WHERE do you type that?


what commands did you run?


> It looks like it should be reading my app.js file but it doesn’t appear so


what do you mean by "It"? shadow-cljs generates the resource/public/js/app.js yes. it does not generate any HTML, so loading that file is up to you?


So I tried following the instructions for using karma to test my code. Unfortunately my code is a node script and karma is a browser test suite, not designed for node. All I really want is some XML output so I can see the results in circleci. I don’t even know how to get more detailed tests, is there a verbose option? All I get is this when I run my test.

========= Running Tests =======================

Testing uniorg-util.cli-test

Testing uniorg-util.core-test

Ran 8 tests containing 31 assertions.
0 failures, 0 errors.


so I assume you found :node-test?


> All I really want is some XML output so I can see the results in circlec


not sure what you mean by that


shadow has no built-in "xml output" for tests if thats what you are asking


I see, so I would need to configure another test runner that supports junit style xml results?


yeah you can configure custom runners with :node-test. in case those exist 😛


So I managed to find I’m currently trying to see if I can get working.


Generally people throw an index.html in resources/public/ as I did. Don’t worry about it I’ll figure it out, I’m sure it’s a beginners error. If not I’m familiar with figwheel.


@decim and WHERE did you type (js/alert "foo")? there is a difference here to figwheel. you need either a connection from your editor or shadow-cljs cljs-repl app in addition to shadow-cljs watch app first


so REPL is a separate process from the watch


Both using shadow-cljs repl and from emacs evaluating it in (core.cljs) with ‘npx shadow-cljs watch app’ running. Also I apologize if I came off as rude. I’m not slighting your project by any means. The issue is on my end.


@decim I'm trying to help you but I don't have a clue what you are doing so I'm asking what you are doing. you are only giving me small pieces of information that don't really tell me what you are doing.


Hey! Whenever I make a change in my cljs.user, and Shadow-cljs hot-reloads it, and I then try executing something in the repl, I get the following exception:

------ REPL Error while processing ---------------------------------------------
no source by provide: cljs.user
{:provide cljs.user}
ExceptionInfo: no source by provide: cljs.user (data.clj:186)
Only seems to be the case for cljs.user


@grav which version are you on? that should have been fixed for a while now?


@thheller Latest: 2.14.5


Here's more info:

[2021-06-22 22:07:23.472 - WARNING] :shadow.cljs.devtools.server.worker.impl/cljs-compile-ex - {:input {:code "foo", :ns cljs.user, :repl true}}
ExceptionInfo Failed to process REPL command {:eof? false, :ns cljs.user, :form foo, :source "foo", :tag :shadow.cljs.repl/process-ex}
        shadow.cljs.repl/process-read-result (repl.clj:501)
        shadow.cljs.repl/process-read-result (repl.clj:475)
        shadow.cljs.repl/process-input (repl.clj:659)
        shadow.cljs.repl/process-input (repl.clj:637)


I'm using :deps {:aliases [:cljs]}, and then I have :paths ["src" "dev"] in my deps.edn, and cljs.user is in dev/cljs/user.cljs


would help if you can setup a reproducible repo


Alright - I'll see if I can do that :thumbsup: Is there a work-around for now, can I eg avoid having shadow hot-reload cljs.user


you can have (ns cljs.user {:dev/once true} ...) meta to only load it once. not sure that fixes anything


Doesn't seem to unfortunately.


Tried to use :repl-init-ns with another namespace - same problem with that namespace. Anyway, I'll create a repro.


@thheller There you go: 🙂 Will also create an issue


Created issue here: Thanks for looking into it 🙂


Ha I got it! In shadow-cljs.edn…. :modules {:app … changed that to main and pulled main.js in index.html and now we have lift off.

🎉 5