Fork me on GitHub

Hello! I need check some regex on frontend side, f.e. emails, phones, etc. I found out a lot of examples, but they are different for Java and JS. Which ones should I use in Clojurescript? Maybe there are some shared examples?


I tried using wasm from Clojurescript, using the new way from but it doesn't work as easily as react does. Does someone has a clue, current state at


@ivana you should follow JavaScript regex examples


@gklijs you didn't include the package.json so it's a bit hard to tell what will happen


@noisesmith, @lilactown assessment is correct - you cannot share data between two independent JS contexts - this always true - it doesn't matter what JS environment you're talking aobut

✔️ 8

@dnolen added package.json


@gklijs I think the problem is that the file name doesn't correspond to the require - I have a feeling this is a case not covered in the Node module resolver - nothing really to do with WASM


I would just try a different dependency


feel free to open a ticket about the issue - about resolution (not WASM)


I'm trying to set up smoke tests with etaoin on a clj/cljs project, that should be easily runnable both from the repl and as tests in CI and locally


does anyone have some example set up I can look at (steal)? we are using to set up the whole system, which poses the first questions since I'd like to have both jetty servers running at the same time in the repl. So in general I was thinking that I could do something like

(defn fixture-driver
  "Executes a test running a driver. Bounds a driver
   with the global *driver* variable."
  (e/with-firefox {} driver
    (binding [*driver* driver]

(defn config
  (-> dev-config
      (merge (figwheel-config "automation"))
      ;; the port change is just for convenience locally
      ;; to avoid conflicting with the running jetty
      (assoc-in [:server/jetty :port] 3334)))

(defn start-everything
  (ig.repl/set-prep! config)

(use-fixtures :once start-everything)
(use-fixtures :each fixture-driver)
but I have a few problems already, if anyone has done something similar I'd love to have a look how you did it


the first weird thing is with figwheel-main

------- Figwheel Main Status -------
Currently available: automation, dev
No builds are currently being built.
but if I try to restart the build
1. Caused by clojure.lang.ExceptionInfo
   A build with id "automation" is already running.
so somehow it's running but I can't access it or it's just confused I'm not sure


@andrea.crotti might want to also ask in #figwheel-main


yes thanks @dnolen, I asked here because I was just looking for the whole set up if anyone had suggestions, I can probably figure out the problems with the various pieces, just to check that my approach made sense


@andrea.crotti this looks pretty figwheel-main specific to me


one thought is that this seems like it could become overly complicated - I don't know why you would want figwheel running in your testing setup


build once, run your tests - seems like a removing a lot of unneeded complexity


uhm well the pieces involved imho are kaocha+etaoin+figwheel-main+jetty+sassc (mostly managed via integrant) for example


ah yes I probably can avoid running figwheel you're right


yes, just remove that bit - I think you can get it working just fine


i'd like to expose a javascript object that a js library requires to have certain functions on - what is the idiomatic way to do that in cljs?


current thought is to:

(def myobj
    #js {"apiFnOne" (fn [_] (println "hi"))})


that works

👍 4
Adrian Smith18:05:36

hey, I'm following the new webpack guide here: and was wondering once I have a repl up with the -r flag, what port/repl type do I need to connect to if I want to access it in Cursive?


@sfyire no port configuration is necessary


somebody recently asked this question on ClojureVerse, it's trivial to make it work


ClojureScript REPL is modeled after clojure.main


so you can literally use the clojure.main option in cursive and just pass the additional parameters from the guide

Adrian Smith18:05:06

Is my REPL configuration correct?

Adrian Smith18:05:57

ohh I've got to run with deps but can't select that for some reason, will try re-creating


right you probably need to import existing project using the deps template

👍 4
Adrian Smith18:05:47

cool got it working, is it possible with an emacs configuration?


what is an emacs configuration?


its straightforward in inf-clojure and should be straight forward with piggieback and nrepl but i haven't tried that route yet


@sfyire every REPL tool I'm aware of should work with standard ClojureScript REPL at this point


so that includes Emacs


I got working again with :bundle target. The problem is actually in, where I introduced an :output-to option in doo-opts . So you specify the post-webpack output file (`main.js`) there. This dep in your project adds support for the new doo-opt :output-to

doo {:git/url ""
     :sha     "6b23f6dda71576898e98a8c10188fa777b1af0b0"}
I might have got it all wrong in other ways, but at least that fixed my problem. Use at your own risk.