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?
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
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?
I feel like we did something for that already
but I don't use webworkers - I think maybe @kommen might have worked on this?
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
into or apply vector?
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 :<>
.
@p-himik yes thats my usecase
ok i dont know what react fragments is, need to look it up
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
.
okay, i was trying to make something like (menu {:prop xx :prop yy :items [(item {:prop...}]})
where i in menu need to inject the :items into the menu div
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.15it is valid json and the map is valid
that library just doesn't like it for some reason
browsers like it fine
maybe this helps https://clojureverse.org/t/server-side-decoding-of-javascript-sourcemaps/1591/3?u=thheller
how can I validate these map in any browser then