Fork me on GitHub
#clojurescript
<
2020-02-27
>
Aleed02:02:48

has anyone used crdt data types in cljs?

Aleed02:02:13

i’m considering using https://github.com/yjs/yjs in a project but not sure how much of a pain it would be mixing these data structures

pithyless09:02:01

Have not used it myself, but this is related and may be useful: https://text-crdt-compare.surge.sh/

Sebastián12:02:10

Hi everybody! Maybe this has been already asked but, has anybody managed to use vim-fireplace with clojurescript? I’ve been trying with shadow-cljs and figwheel but got no luck 😞

Lone Ranger14:02:19

I feel your pain. Not with that specifically but I feel like most people after trial and error find some setup that works and then just stick with that for about 5ish years at least haha. I know I should probably switch to shadow-cljs but I only figured out how to use figwheel-main with emacs after several months of trial/effort lol

🙃 4
Ian M15:02:14

With shadow, if you are running the dev server you can :Connect to the port it starts the nrepl server on, and then :Piggieback {your shadow app name} to it after that. Not ideal but does work

Sebastián15:02:54

I tried that, I have ran shadow-cljs watch app and in vim I run the :Connect 3333: (nrepl port is configured to be the 3333), after that I do the`Piggieback :app` and I get “No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.”

Sebastián15:02:32

My shadow-cljs.edn file looks like this:

{:source-paths ["src"]
 :dependencies [[cider/cider-nrepl "0.21.1"]]
 :nrepl {:port 3333}
 :dev-http {8080 "resources/public/"}
 :builds {:app {:target :browser
                :output-dir "target/browser"
                :modules {:main {:init-fn example.core/main!}}
                :devtools {:after-load example.core/reload!}}}}

Ian M15:02:40

are you loading the app in your browser?

Sebastián17:02:18

It was a lein figwheel initialized project which I was trying on. I created an example app using npx create-cljs-project and got it easily working as you stated. Thanks a lot @UMP2T9H7Y

👍 4
Lone Ranger14:02:53

Does anyone have a recommendation to an automated testing alternative to lein doo (using deps.edn and/or shadow-cljs)?

Lone Ranger14:02:32

(preferably deps.edn cause I haven't learned shadow-cljs yet :face_with_rolling_eyes: )

restenb14:02:00

what kind of app are you testing?

Lone Ranger14:02:38

but not the components, just regular clojurescript functions

Lone Ranger14:02:04

I've been running tests from repl/browser and that's fine but want to get a ci/cd thing going. Travis or the like

Lone Ranger14:02:32

will use lein doo if necessary but I've been enjoying the minimalism of deps.edn

restenb14:02:13

kinda in the same boat myself, been looking at lein doo for integration testing of a re-frame app as well

restenb14:02:36

though I like cljs-test-display https://github.com/bhauman/cljs-test-display and might just use that along with re-frame-test for the clojurescript stuff

restenb14:02:52

mostly just testing event handlers and want to quickly inspect the feedback

Lone Ranger14:02:55

ok great I'll check that out

Lone Ranger14:02:07

yeah I hear ya

restenb14:02:24

also check out figwheel-main's testing features https://figwheel.org/docs/testing.html

restenb14:02:23

i haven't started using figwheel main in my apps yet due to some problems with legacy setup, but it has provisions for integrations CLJS tests to CI

Lone Ranger14:02:41

out of curiosity is it an issue converting project.clj to deps.edn?

aisamu14:02:56

It depends on how much you're relying on lein features

Lone Ranger14:02:21

true, lein has a lot of good features that it's hard to get away from. I still use it for library projects because it's great for shipping