This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-05
Channels
- # aleph (90)
- # announcements (4)
- # aws (2)
- # beginners (61)
- # calva (2)
- # cljs-dev (8)
- # cljsrn (12)
- # clojars (4)
- # clojure (42)
- # clojure-europe (1)
- # clojure-finland (1)
- # clojure-greece (2)
- # clojure-houston (1)
- # clojure-italy (3)
- # clojure-nl (30)
- # clojure-spec (41)
- # clojure-uk (87)
- # clojurescript (44)
- # cursive (12)
- # data-science (11)
- # datomic (24)
- # defnpodcast (1)
- # fulcro (18)
- # hyperfiddle (1)
- # jobs (2)
- # juxt (11)
- # kaocha (3)
- # london-clojurians (5)
- # mount (2)
- # nrepl (2)
- # off-topic (9)
- # onyx (25)
- # other-languages (1)
- # parinfer (3)
- # pathom (5)
- # pedestal (3)
- # portkey (1)
- # re-frame (21)
- # reagent (24)
- # remote-jobs (7)
- # schema (2)
- # shadow-cljs (59)
- # spacemacs (5)
- # specter (7)
- # sql (9)
- # tools-deps (13)
I have a problem with cljs-http
, the following request works fine:
> curl -XPOST http://localhost:3000/save_annotations -H "Content-Type: application/json" --data "@resources/test/request_test.json"
but this code
(defn ^:export save-annotations
[]
(go (let [results (.getElementsByClassName js/document (name "res"))
response (<! (http/post "/save_annotations" {:post-params {:key1 "value1" :key2 "value2"}}))]
(prn reponse))))
returns this
> XML Parsing Error: syntax error
> Location: http://localhost:3000/save_annotations
> Line Number 1, Column 1:hello! I have a regex, that works in clojure, but if I evaluate it in clojurescript i get an error: #"<\/span>"
cljs error : #object[SyntaxError SyntaxError: invalid regular expression flag s]
, which is a :js-eval-exception
@kah0ona This works in KLIPSE:
(def r #"<\/span>")
(re-find r "</span>")
http://app.klipse.tech/this also works in a REPL, but not in the source: (re-find (js/RegExp. "</span>") "</span>")
oh wait, I was in a CLJC file. This works: #?(:cljs (println (re-find (js/RegExp. “</span>“) “</span>“)))
I think your problem is that you don’t have to escape slashes:
(println (re-find #"</span>" "</span>"))
Trying to set up a docker file to run clojurescript by shadow-cljs for some friends who might not have java installed. Does anyone have an example doing this? Trying to figure out how to mount the source directories so it can live reload and also not screw up permissions?
@dpsutton I had a docker setup about a year ago with figwheel and back then the biggest issue was that mounted directories between the OS (MacOS in this case) and the container were really slow. The situation might have improved since.
@dpsutton if I remember correctly @lilactown did some docker stuff with mounted directories
Using the different file watcher solved most of the problems, but there were also some corporate firewall issues that just ended up making it not worth it
For what it's worth, we use docker compose to make it easy to mount source directory is as volumes. There wasn't really anything special that we had to do for Shadow clj s
I’m using docker on CI when building uberjars and I was suffering the slowness there as well. A workaround in that case was to build the uberjar under /tmp or some other unmounted dir inside the container. I don’t know if this strategy could be leveraged with code hot-reloading tools. I guess there are many many files are they’re changing all the time and all of them need to be visible to the host?
Here’s my old docker-compose
which you can maybe use as a starting point if interested https://gist.github.com/vharmain/9dda15880b1b93ede2ec2045040b0d26
One gotcha is to have a volume for .m2
so java-deps don’t get downloaded again and again.
Anyways I came to same conclusion as @lilactown that it was too much of a hassle and started running hot reloading tools on the host.