Fork me on GitHub
Old account10:05:34

What is the common way to work with web designers? As far as I understand they produce html and css + etc. and I would have to translate the html to Hiccup? I am about to hire a web designer, but I don't know much about it. Please advice :)


Hey everyone 👋 I'm going to use Do you know any potential security issues I could encounter, e.g. code execution?

Andreas S.11:05:30

What is the best clojurescript getting started guide besides this: ?


The figwheel-main tutorial is pretty good as well:

Pinchas Laivich13:05:09

Hello, I am trying to get started with Calva VS Code plugin + lein re-frame template, but having some trouble 😞

Pinchas Laivich13:05:27

I run lein new re-frame reframe-app

Pinchas Laivich13:05:57

Then "Calva: Start a project REPL and connect (Jack-in)"

Pinchas Laivich13:05:18

Select "shadow-cljs" and ":app" build

Pinchas Laivich13:05:55

REPL prompts me whether to connect to :app, node-repl, browser,repl, I select "🍎 "

Pinchas Laivich13:05:00

I visit localhost:8080 and I get the default re-frame message. The websocket connection is good

Pinchas Laivich13:05:06

Then I run "Calva: Load Current Files and Dependencies"

Pinchas Laivich13:05:41

And get: Evaluating file: filename.cljs No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code. No results from file evaluation.

Pinchas Laivich13:05:08

I get the same error when running "Calva: Evaluate Current Form"


@stebokas If you’re working with web designers that produce HTML/CSS, you can use other templating libraries like Selmer or Enlive to make HTML dynamic, but this is only for server-rendered HTML.

✔️ 4
Pinchas Laivich13:05:51

There is a GH issue for that specific lein template, but everyone says that you just need to load up the browser first. I tried that, and it's still not working 😞


try running shadow-cljs cljs-repl app from the command line and just eval 1 or so


don't know about calva but if that fails too I might be able to help

Pinchas Laivich13:05:36

Thanks for the reply! I tried running it manually w/the command you provided and get the same error: ⇒ shadow-cljs cljs-repl app shadow-cljs - config: /home/user1/development/clojure/re-frame-proj/shadow-cljs.edn shadow-cljs - running: lein run -m shadow.cljs.cli --npm cljs-repl app shadow-cljs - HTTP server available at http://localhost:8280 shadow-cljs - server version: 2.9.3 running at http://localhost:9630 shadow-cljs - nREPL server started on port 8777 cljs.user=> (println "asdf") No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code. cljs.user=> (1) No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code. cljs.user=>


ok what does the browser console say exactly?


should say 🠶 shadow-cljs: WebSocket connected!?


also you said you visited localhost:8080 but the above also starts a webserver at :8280?


are you maybe just on the wrong server?

Pinchas Laivich13:05:58

Installing CLJS DevTools 1.0.0 and enabling features :formatters :hints :async :8280/js/compiled/cljs-runtime/module$node_modules$react_dom$cjs$react_dom_development.js:796 Download the React DevTools for a better development experience: :8280/js/compiled/cljs-runtime/cljs.core.js:175 dev mode :8280/js/compiled/cljs-runtime/devtools.util.js:240 CLJS DevTools: some custom formatters were not rendered.

Pinchas Laivich13:05:06

OOps, that was a typo


ehm hang on


you don't seem the have shadow-cljs running at all?


> shadow-cljs - running: lein run -m shadow.cljs.cli --npm cljs-repl app


this should have said "connected to server"


do you have lein dev running?


or shadow-cljs watch app?


I do not know what calva does ...


you may just have 2 competing shadow-cljs instances running? but the messages above indicate that it doesn't even try to connect anywhere

Pinchas Laivich14:05:56

Sorry battery died. I will give that a shot

Pinchas Laivich14:05:51

This is odd, so when I run lein run -m shadow etc I get the same error when trying to use REPL

Pinchas Laivich14:05:59

The calva stuff just runs " npx shadow-cljs -d cider/cider-nrepl:0.23.0 watch :app"

Pinchas Laivich14:05:31

Just tried lein dev by itself, get the same issue, I guess it

Pinchas Laivich14:05:47

*it's a problem with Calva 😕


It just works when I do this… It would be awesome if I could see what is going on (or not) in your setup.

Andreas S.13:05:09

hi @thheller nodeJS as a dependency is not a option for me


Even as a dev-time dependency?

Andreas S.07:05:03

where can I find a list of current possible development approaches with clojureScript? does such a list exist?


why is it not an option? at some point you may want to access JS dependencies that are only available via npm? not just with shadow-cljs. also with the new :bundle stuff going through webpack or similar


you can limit yourself and never access npm but since you already tried going through the quickstart react-dom example that would already involve npm packages


sure there are fairly stable CLJSJS versions for that but CLJSJS becomes more unreliable the more packages you want to use


I'm not aware of such a list though. the most common setups are shadow-cljs, figwheel-main, lein-figwheel+lein-cljsbuild. raw cljs.main if you want something more basic.

Andreas S.07:05:26

thank you thheller!

Andreas S.07:05:56

Why is it that "CLJSJS becomes more unreliable the more packages you want to use"?

thheller08:05:31 I'd expect CLJSJS to be left behind as more people move to using npm directly instead

Andreas S.09:05:39

so shadow is the only way if I want to use js dependencies correctly?


no, the :bundle stuff gets you the same access but you have to also use a secondary JS build tool like webpack


Hi. I run my clojure-script code with shadow-cljs when ever there is a bug in the code (especially functions for view) the page completely goes out (I get a white blank page) and some error pops up on the console Is there any method to avoid losing the whole page despite of the exceptions thrown on different parts of the code? In other words what are the best practices for this kind exception handling for these situation? Thanks.


if you're using react normally react says you can use an error boundary


Does re-frame has any equivalent for react error boundry? or is it implemented in re-frame?


i don't believe so


but it seems its just some lifecycle methods


Thanks alot.