This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-22
Channels
- # announcements (3)
- # babashka (6)
- # beginners (29)
- # calva (10)
- # cider (14)
- # clj-kondo (67)
- # cljfx (6)
- # clojure (34)
- # clojure-australia (1)
- # clojure-europe (46)
- # clojure-italy (5)
- # clojure-nl (3)
- # clojure-spec (6)
- # clojure-uk (27)
- # clojured (1)
- # clojurescript (26)
- # conjure (14)
- # cursive (5)
- # data-science (1)
- # datomic (26)
- # deps-new (10)
- # editors (1)
- # events (2)
- # fulcro (23)
- # graalvm (41)
- # honeysql (5)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (1)
- # luminus (2)
- # malli (22)
- # meander (5)
- # observability (3)
- # podcasts-discuss (1)
- # rdf (3)
- # re-frame (27)
- # remote-jobs (7)
- # reveal (6)
- # shadow-cljs (45)
- # xtdb (8)
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
did you not follow https://github.com/thheller/reagent-react-native?
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 https://github.com/v3gal0g/chrysalis-xd
@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.
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.
===============================================
I see, so I would need to configure another test runner that supports junit style xml results?
So I managed to find https://github.com/lambdaisland/kaocha-junit-xml. I’m currently trying to see if I can get https://github.com/lambdaisland/kaocha-cljs2 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
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 ---------------------------------------------
foo
no source by provide: cljs.user
{:provide cljs.user}
ExceptionInfo: no source by provide: cljs.user
shadow.build.data/get-source-id-by-provide (data.clj:186)
.....
Only seems to be the case for cljs.user
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
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
Tried to use :repl-init-ns
with another namespace - same problem with that namespace.
Anyway, I'll create a repro.
@thheller There you go: https://github.com/grav/shadow-cljs-user-issue 🙂 Will also create an issue
Created issue here: https://github.com/thheller/shadow-cljs/issues/905 Thanks for looking into it 🙂