Clojurians
#clojurescript
<
2016-03-01
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

chrisn02:03:33

The cljs compiler is trying to load the file as clojure not as clojure script. That is the issue. Were it trying to load the file as cljs it would work.

chrisn02:03:34

Note the clojure lang RT stuff... That isn't in the cljs path.

isaac03:03:20

How to reload cljs refered macros.

isaac03:03:52

I need restart my repl when I edited the macro that referenced by cljs file

thomasdeutsch09:03:36

Hi everyone. I am stuck, getting a simple regular expression to work. (re-matches #"/[^\(]*/" "foo(bar)") should return foo becaue it should match everthing until the first (. i do not know what i am doing wrong.

thomasdeutsch09:03:05

i am getting nil

stepugnetti09:03:40

@thomasdeutsch try removing the forward slashes.

thomasdeutsch09:03:49

if i remove the forward slashes.. it somehow creates a loop so that my browser-window freezes

mcgivernsa09:03:33

doesn't re-matches work on the full string? it seems like you want re-find

mcgivernsa09:03:44

or to match but throw away the rest of the string

mcgivernsa09:03:23

in addition to removing the forward slashes, you don't need to escape the ( in a character class

mcgivernsa09:03:59

so (re-find #"[^(]*" "foo(bar)") returns "foo"

thomasdeutsch11:03:44

ahh, i get it. thanks @mcgivernsa

stephenway19:03:56

Hey all. Looking for some help with working with React and Om to render an svg with a use tag but getting “React.Dom.use not a function” error. (dom/svg #js {:viewBox 0 0 100 100”} (dom/use #js {:xlinkHref “/path/to/icon.svg”}))

dnolen19:03:42

@stephenway: there’s an #C06DT2YSY channel now

stephenway19:03:52

@dnolen: Right, I’ll move my question to there. Thanks

venantius20:03:22

do people have a recommended development flow for working with ClojureScript libraries that doesn’t involve figwheel?

venantius20:03:19

I forget what @dnolen does. Do you use Cursive for CLJS development?

dnolen20:03:15

I use Figwheel with Cursive as well as the Node REPL

richiardiandrea20:03:39

@venantius: boot has its own reloading tooling, or you can use boot-figwheel

venantius20:03:02

I’m trying to enable clojurescript support for a traditionally clojure-only lib

venantius20:03:18

it’s not going to get used in a browser context, which makes me think that the Node REPL is the way to go

mfikes20:03:35

@venantius: I will frequently use :reload like an animal. simple_smile

venantius20:03:59

I’m always curious about boot but I don’t necessarily want to go through the headache of converting an existing project.clj to a boot file

venantius20:03:05

@mfikes: elaborate?

mfikes20:03:19

(require ‘foo.core :reload)

mfikes20:03:37

Old-school way of reloading code simple_smile

venantius20:03:02

I’m fine with file-watched-reloading or manual reloading

mfikes20:03:10

Ambly or Planck for me

venantius20:03:17

I’m just not used to developing clojurescript in a non-browser context

venantius20:03:23

forgot about planck

mfikes20:03:47

I’ve never developed ClojureScript targeting the browser simple_smile

mfikes20:03:53

But I’m sure I will

venantius20:03:57

@mfikes: you might be my hero for this

venantius20:03:08

I was worried about having to do some serious configuration grappling

venantius20:03:57

ambly seems more specifically targeted to iOS development

mfikes20:03:13

@venantius: Yes.

venantius20:03:26

this makes me so happy

venantius20:03:29

tears of joy

mfikes20:03:06

@venantius: To be honest, for developing straight ClojureScript code, the REPL that you get with Quick Start is cool. If you put your src dir in the classpath, you can require :reload till your heart is content.

mfikes20:03:31

rlwrap java -cp /path/to/cljs.jar:/another/path/to/src clojure.main -m cljs.repl.node and rock on

venantius20:03:07

stupid question, perhaps, but why is that better than just planck -c /path/to/src ?

mfikes20:03:30

@venantius: If you use Planck, then you are necessarily targeting bootstrapped ClojureScript

venantius20:03:48

is there anything wrong with that?

mfikes20:03:41

@venantius: Not in my opinion simple_smile simple_smile But… If you are careful, then the result will also work in JVM ClojureScript. Should be OK if you have mild macro usage.

venantius20:03:59

I believe that the library I’m working on has no macros

venantius20:03:04

I should check that, but I think that’s the case

venantius20:03:13

still, they’re relatively simple

venantius20:03:22

I don’t…think…there is a significant difference

mfikes20:03:23

@venantius: If you use Emacs or Cursive, it is also possible to use them with Planck: https://github.com/mfikes/planck/blob/master/site/src/ides.md

venantius20:03:47

I mostly use vim and the terminal. I’ve been toying with Cursive lately when I’ve been working on http-kit

mfikes20:03:25

@venantius: If you start using Planck, feel free to ping me via DMs so as to not clog up this channel. I’ll be happy to help.

venantius20:03:55

sounds great. really appreciate the help; this sounds like a really nice workflow. and great job on Planck. stars repo

edbond20:03:53

CommonJS/AMD/ES6 Module support (in progress)

cfleming21:03:42

@venantius: Make sure you check out IdeaVim if you’re not already

mfikes22:03:07

@venantius: Also, since Clojure REPL support exists for vim, I suspect the same technique used for Cursive works for any IDE that supports a Clojure REPL: https://github.com/mfikes/tubular (In general, prevalent Socket REPL support is going to be a nice thing IMHO.)

escherize23:03:15

I'm trying to find a function that will take a string of valid(?) clojurescript and return a datastructure. I'm looking at replumb, but don't really see what I want there

smw23:03:39

You want something like json? EDN?

smw23:03:23

What data structure do you want?

escherize23:03:37

I want EDN, actually

escherize23:03:21

but, sorry if I'm not super clear - I need the cljs to be evaluated.

smw23:03:22

I think you can clojure.edn/read-string

smw23:03:51

limited to the EDN subset of clojurescript

escherize23:03:52

I think that'll work for

(f "[:h2 \"hi\"]") 
;;=> [:h2 "hi"]

escherize23:03:54

Right. I guess the case I'd like is...

(f "(defn my-thing []
  [:ul (for [x (range)])
   [:li x]])
(my-thing)")

;;=> [:ul ([:li 0] ,,,,]

escherize23:03:57

I hadn't seen this, Thanks I'll have a read