clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Ricardo Cabral 2021-02-01T16:09:03.284300Z

Hello all, could someone give me a direction about testing clojurescript with reagent? I have setup luminus, figwheel, doo, karma and reagent and I have found a library called cljs-react-test, however I am getting a lot of errors with the sample in their github example and I would like to know what is the best approach to test components like a simple input text. Could someone, please, let me know what is the best approach to learn clojurescript using TDD/BDD?

Ricardo Cabral 2021-02-02T08:21:16.311100Z

I believe this will help mehttps://francisvitullo.medium.com/a-way-of-testing-views-in-clojurescript-apps-98aaf57c5c2a however I have just realized that I need to read about re-frame

cap10morgan 2021-02-01T18:14:10.286700Z

Is there a way to build webworkers with :target :bundle? I see that :webworker is another value for the :target key, but it seems like I need both for a :target :bundle build. Or am I misunderstanding something?

dnolen 2021-02-01T18:25:02.287100Z

I feel like we did something for that already

dnolen 2021-02-01T18:25:25.287500Z

but I don't use webworkers - I think maybe @kommen might have worked on this?

Fredrik Andersson 2021-02-01T19:06:12.290800Z

Is there any prefered way to unfold an vector into another when building hiccup? I got it working with "into" but I wonder if there is a better way? "concat" didn't work

dpsutton 2021-02-01T19:07:55.291600Z

into or apply vector?

p-himik 2021-02-01T19:08:54.293300Z

I don't think there's a better way than into, assuming you mean something like (into [:div] children). A bit relevant - note also that Reagent supports React fragments via :<>.

Fredrik Andersson 2021-02-01T19:09:37.294600Z

@p-himik yes thats my usecase

Fredrik Andersson 2021-02-01T19:10:04.295700Z

ok i dont know what react fragments is, need to look it up

p-himik 2021-02-01T19:10:44.296900Z

Ah, and often you can even use just [:div children]. But my memory is a bit hazy here - I think only vectors are supported and seqs will whine about missing :key.

Fredrik Andersson 2021-02-01T19:12:20.298600Z

okay, i was trying to make something like (menu {:prop xx :prop yy :items [(item {:prop...}]})

Fredrik Andersson 2021-02-01T19:12:42.299200Z

where i in menu need to inject the :items into the menu div

Atiq Gauri 2021-02-01T19:12:57.299600Z

I am generating source maps in cljs using shadow-cljs compiler config:

:electron-main     {:target           :node-script
                                :main             mutesync.inspect.electron.background.main/init
                                :devtools         {:after-load mutesync.inspect.electron.background.main/done}
                                :compiler-options {:optimizations :simple
                                                   :source-map true
                                                   :source-map-include-sources-content true
                                                   :source-map-detail-level :all}
                                :output-to        "shells/electron/js/background/main.js"}
generated map files: main.js and main.js.map I am trying to use this in sentry but they aren't working and as suggested I tried validating this sourcemap: using this https://github.com/mozilla/source-map output: { source: null, line: null, column: null, name: null } using this https://www.npmjs.com/package/sourcemap-validator output: error: "The map is not valid JSON" shadow-cljs version: 2.11.15

thheller 2021-02-01T19:16:19.300300Z

it is valid json and the map is valid

thheller 2021-02-01T19:16:29.300700Z

that library just doesn't like it for some reason

thheller 2021-02-01T19:16:37.301Z

browsers like it fine

Atiq Gauri 2021-02-01T19:17:50.302400Z

how can I validate these map in any browser then

Atiq Gauri 2021-02-01T19:34:14.303300Z

https://github.com/danvk/source-map-explorer/issues/190