Fork me on GitHub
Pick Feky01:07:18

is there any way to wrap CORS to compojure-api ? i tried wrap-cors from ring-cors lib and seems didnt work.

Pick Feky01:07:19

oops this is cljs sorry


I have one issue left with Cider/Figwheel that bothers me and I can't seem to find a solution googling for it, maybe someone can help me. When I start a Figwheel-REPL via Cider it does not open the page in the browser - and that leads to an nrepl sync request timeout unless I nil that variable. And then I still need to manually open the page after an unknown amount of time. Does anyone know what to do about that? The Cider-Docs for CLJS explicitly state "open a browser and go to the figwheel url", so it kind of seems like this is expected behaviour.


Okay, it says the same in the figwheel wiki. But I'd guess there must be something like a hook after Cider-REPL-initialization and a way for Emacs to open a tab in the browser ...


in the latest CIDER, when I run cider-jack-in-clojurescript it does ask if I want to open a browser window


(I only use shadow-cljs and fighweel-main tho, not lein-figwheel)

Mario C.16:07:34

I am using Om and I've encountered quite a peculiar case. I had a component that wraps a reify such as (defn funny-view [funnies owner] (let [...] ... (reify om/IRenderState (render-state [...]...). Inside the let I had a list [my-list-of-jokes [:j1 :j2]] and whenever I changed the state in the parent component, the list would replicate [:j1 :j2 :j1 :j2]. I added some println's as sanity checks in the let and I noticed that they would output many times but println's in the render function would output the expected number of times. The replication would only occur once after initial page load and first update then after it would not happen. I know this was occurring because of the let wrapping and after moving that logic into the init-state everything works as it should. I am just curious on the why it was happening. Any ideas?


@mario.cordova.862 there's an Om specific channel btw

Mario C.16:07:36

You're right I should probably post it there


sometimes when there'll be a warning like can't take the value of macro cljs.core/and or can't take the value of macro cljs.core/or if I write something like this:

(when (or x y)  ;; x and y come from arguments


If I write when (or (some? x) (some? y)), there will be no warning


that sounds like a bug - more info needed


I'm still trying to find the minimal case for reproducing


are you experiencing this with figwheel-main?


yes, with figwheel-main and devcards


i believe there's a bug in figwheel-main that is patched but perhaps not released yet?


can go to a snapshot version of figwheel-main or downgrade cljs:


looks like I can require a snapshot version of figwheel-core


i wonder if @bhauman is around and could cut a release? this has come up a bit in the past is the only reason i recognized it


oh, no, I found my figwheel-main isn't the newest version.


let me switch to 0.2.1. I think this may be resolved already


@dpsutton thanks for help!

parens 4
Mikko Koski19:07:43

Is there a way in ClojureScript to control the reader so that it would read the decimal types to something else than JavaScript number? Something like (cljs.reader/read-string "{:a 1.01M}") => {:a [:decimal "1.01"]}?


custom reading is not really supported in Clojure and thus not supported in ClojureScript


you can of course probably hack around and figure out how to make it work - but there is not official / sanctioned way - and there won't be

Mikko Koski20:07:00

Ok cool. Thanks


I am attempting to test using lein doo nashorn test. I have a dependency to Firebase which I satisfy in the browser by simply importing the Firebase <script> within my index.html before running my compiled test.js script. However, in Nashorn the index.html is not being read from (it only runs a javascript file). I was wondering if there is a way to grab the Firebase script before running my test script in Nashorn?


I guess I could also wget all the scripts I need, and then concat them to the front of my test.js script... Seems dubious.


You know, maybe this is dumb, maybe I should just run javascript test from within my browser, seems odd not to have the immediate feedback on the cli though...


there are two ways to go about executing tests in a browser


you can use a build that executes a specific runner ns to give you immediate feedback. I like using that in conjunction with


I think both figwheel and shadow-cljs have some amount of automation around setting that up


you can also use something like karma, which will execute your tests in a headless environment and give you output via the CLI. we use this for CI purposes


not sure how to set that up for figwheel, but shadow-cljs has a build target specifically for that


Thanks. So I also tried Karma, but the error messages are less than great so far. I mean they are there, but there is so much noise about the browser and all that, feels like it might only be appropriate for actual integration, not for allowing me to develop against it.


I will look at cljs-test-display.


Finally, is shadow-cljs over-reaching for this problem? I kind of though shadow-cljs was for integrating external javascript that just wasn't going to play very well with the Clojurescript compilation process? My knowledge of this is light, so could be entirely wrong.


shadow-cljs is a general purpose build tool for clojurescript


it does what a combination of leiningen and figwheel and clojurescript, or deps.edn and Clojure CLI and figwheel and clojurescript, do


Hah, that sounds like a lot, I take it you endorse using it?


e.g. managing dependencies, configuring builds, compiling code, hot loading changes during development


I like it a lot


I find most of my projects end up needing to do some subset of those things and knowing how to use shadow-cljs lets me do any of them


Ok, cool, gives me two new paths to walk down. I'll take a look. Thank you.


it also has the best story for integration with npm libs which I often use