clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Jeremie Pelletier 2020-09-10T03:32:06.428Z

Hello! I'm trying to use error boundaries in reagent and I can't seem to get the setState example to work; the error is caught and displayed, but the reset button with the call to .setState never updates the component is there something special to do for this to work?

Jeremie Pelletier 2020-09-10T03:35:26.428300Z

the first example with the ratom does work however

jewiet 2020-09-10T09:54:12.430400Z

Hello everyone, I want to mock responses from a server in a ClojureScript application and I am trying to figure out how to do it. I am using https://github.com/r0man/cljs-http and https://github.com/clojure/core.async libraries for making request. I have found https://github.com/myfreeweb/clj-http-fake but it is for Clojure. Is there a way to mock responses in ClojureScript?

athomasoriginal 2020-09-10T15:19:56.430800Z

Are you looking to an E2E flow or do you just need the data? Depending on the goal, I usually do one of a few things: • stub the HTTP client to return response • setup a quick little server which returns the responses. • use spec to generate some random data as I need.

2020-09-10T15:40:06.432300Z

Hi, I am trying to hack some functionality with keywords. My goal would be to have something similar to clojure's

clojure
(create-ns 'com.my-app.user)
(alias 'user 'com.my-app.user)
This lets me do ::user/namewithout creating the alias in the ns form and creating an empty com/my-app/user.cljs. Is there something I am missing that allows that? If not, is it a good idea to write a macro that would modify the clojurescript compiler's env state to add this namespace and alias? Is it even possible? Cheers

dpsutton 2020-09-10T15:46:00.432800Z

sounds like a road of pain. why not just :user/name. why tie this to an actual namespace?

mfikes 2020-09-10T15:49:03.433800Z

An interview with Chris Gammell, a portion of which goes into ClojureScript on the ESP32 hardware: https://contextualelectronics.com/cep005-clojure-script-on-hardware-with-mike-fikes

👏 2
2020-09-10T15:57:30.439600Z

@dpsutton it's the idea that :`my-app.user/name` is different than :your-lib.user/name . If we just use user/name there for instance would be a clash when both my app and your lib want to spec :user/name . Now I could use the long form everywhere but it would make for very long keywords in some cases.

2020-09-11T18:10:10.452800Z

I am not an authority on this matter, but having seen it discussed before, I think that several experienced Clojurians simply do use the fully qualified keyword everywhere, without aliases. Copy-and-paste helps avoid typing, but of course that doesn't make the keywords shorter when reading.

athomasoriginal 2020-09-10T16:03:06.442300Z

Any thoughts on this? :face_with_monocle: https://clojurians.slack.com/archives/C053PTJE6/p1599602572059300

p-himik 2020-09-10T16:31:15.442500Z

There's a Jira ticket for that. If you really want to work on such a functionality, it may be worth it to work on that ticket so that the functionality ends up in the core.

jewiet 2020-09-10T17:32:17.442700Z

@tkjone I just wanted the data. I managed to do it finally. Thank you for the suggestions:) I used similar approach to your first suggestion.

👍 1