Seems like clojurescript 1.10.758 is the last version which react-native (using Hermes) could work properly with 1.10.844 and above gives me weird syntax errors, which is really unfortunate given that 844 gave (:require [npm-lib$SubLib) syntax (maybe it's related? 😅) Did anyone encounter this problem?
re: RN. We found Hermes to be unreliable (when I was at Vouch), and that had nothing to do w/ ClojureScript, we ran into problems w/ patterns in various JS dependencies. Disabling removed those issues.
Hermes never seemed like a good idea.
lots of things around tooling could be better - but my anecdote of doing React Native for 5 years - the most frustrating things and productivity black holes were not ClojureScript - but JavaScript.
and Android/iOS stuff. So really React Native itself.
the most important question to ask is - whether the RN thing is better than doing it twice (for us not practical, so we eat the other problems)
re: not using REPL w/ ClojureScript seems unidiomatic to me. I can't say much about nREPL, but dropping that indirection removed most of my own struggles years ago.
Thanks @dnolen really appreciate the response! Seems like react-native people are pushing Hermes further and further, especially as a default option in tooling and inside marketing materials, interestingly all evidence I’ve found showed that performance difference is marginal at best.. Re: Doing twice: for me RN with clojurescript is mostly about dev ux, both kotlin with notebooks (also can write once) and Swift with playgrounds and previews provide a subpar experience compared to repl, especially on moderate size project, but the entry/setup for cljs is challenging
Also interested in what struggles nrepl brings? Anomalies in behaviour?
nrepl is just weird and much more complicated than a basic streaming REPL. although streaming REPLS are much more limited in the features they can provide, so most editors tend to rely on nrepl for those features or completely bail and don't provide them for socket REPLs. calva/cider rely heavily on nrepl so you'd miss out on a lot without it. Cursive not so much, so less noticable
hermes just doesn't support es6+ syntax. At least it used to complain about a const use in some goog file
you can set :compiler-options {:output-feature-set :es5} in the build config when using shadow-cljs
can't remember what the option was in regular cljs.main configs
Yes, read about this problem, but strange thing here is that swapping clojurescript version makes it work, seems like it shouldn’t?
it doesn't. but swapping the clojurescript version also swaps the dependent closure library version
FWIW I could make rn-rf-shadow template work, but failed to replicate it using latest expo tooling 🫠 will give it another spin today For now the only thing which worked was figwheel, but unfortunately with old clojurescript
I have never used react-native myself, so no clue what might have changed
if you give me the error I can make suggestions though
Me neither 🙃 But as someone who spent a lot of time developing natively, I feel like modern react native finally offers something really good especially bundled with clojure, so trying hard to make it work, cycling between different set of tooling (bare cljs, krell, figwheel, shadow)
But so far just dropping to js was the easiest option 🥲 unfortunately no atoms, reagent, datascript, core async, etc..
🤷
Almost got it working with shadow! Not sure about this error sometimes popping up after jack-in from Calva (NOBRIDGE) ERROR REPL Invoke Exception [ReferenceError: Property 'cider' doesn't exist] {"hash": null, "arr": [{"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "type", "name": "type", "ns": null}, {"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "repl/invoke", "name": "invoke", "ns": "repl"}, {"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "name", "name": "name", "ns": null}, "<eval>", {"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "js", "name": "js", "ns": null}, "cider.nrepl.inlined.deps.suitable.v0v6v2.suitable.js_introspection.property_names_and_types.call(null, (function (){var this$ = this; return this$; })(),\"a\")", {"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "source", "name": "source", "ns": null}, "(cider.nrepl.inlined.deps.suitable.v0v6v2.suitable.js-introspection/property-names-and-types (this-as this this) \"a\")", {"hash": null, "cljs$lang$protocolmask$partition0$": <tel:2153775105|2153775105>, "cljs$lang$protocol_mask$partition1$": 4096, "fqn": "source-map-json", "name": "source-map-json", "ns": null}, "{\"version\":3,
In all other ways - fantastic, I even have :default inside imports and don’t need lib$sublib syntax 🔥 Not sure about es6 and Hermes, didn’t see any problems but also didn’t explicitly set es5 mode
that error looks like cider trying to eval clj code in a cljs repl. or maybe it just hasn't done a proper require before trying to use that code. maybe ask the #cider people. I don't use emacs myself, so not sure what that all does
Ah, it was Calva in vscode, so probably I messed something up switching between shadow-cljs and shadow-cljs + deps edn jack ins.. Will try one more fresh sample haha
Philosophical question: I know, most ordinary clojurescript setups are simpler than RN, but still, given that both modern js and js tooling aren’t that bad, why is clojurescript worth it for people? Asked myself this question, trying to figure out the correct setup, and seems like the most straightforward answer is repl, feeling bad without this direct link to the running program, besides, probably absence of syntax, simplicity, and some unique libs, like datascript. Interested in what others think.
I'd suggest searching here and e.g. on Reddit for similar questions. As you can imagine, something like this has been asked more than once. :) All I can say is that I myself almost never use CLJS REPL. And usually just to quickly test some behavior as compared to CLJ.
I know that and also asked this before 😛, specifically interested in fresh answers, given that both js and cljs are moving (and reddit looks almost dead and probably for good huh) Agree that cljs repl feels less useful that clj, but the good thing is that you can often repl out the same code in clj repl and then pass back to cljs
CLJ[S] Reddit isn't dead, it's just slow. > both js and cljs are moving The latter doesn't move fast enough to generate any new answers. But maybe you could get some answers from new people.
Agree on dynamics, but probably the pace of js (was associated with smth bad before, probably not so much now, idk) could change opinions for old people. Anyway, appreciate the answer 🤝
clojure.core
That's why CLJS is worth it for me.