Fork me on GitHub
#clojurescript
<
2015-08-17
>
pat01:08:35

@dottedmag last I knew modern-cljs was very outdated

meow03:08:35

it doesn't take long for anything related to cljs to get outdated, in spite of whatever name it is given... 😉

meow03:08:55

and long right now is probably measured in days

nberger03:08:15

@arohner you said you had an issue with lein 2.5.2 about a dependency not being found... I tracked a similar issue in juxt/joplin down to a change in arguments parsing in lein run. Are you directly or indirectly using lein run?

tel03:08:06

anyone familiar with leaven?

tel03:08:58

or using quile’s component-cljs?

mfikes04:08:24

@jonas: Planck now works properly for clojure.string:

cljs.user=> (require '[clojure.string :as string])
nil
cljs.user=> (string/upper-case "foo")
“FOO”

dmich05:08:22

@meow: Windows since Vista has had symlinks. See mklink command.

dottedmag07:08:03

pkillean: Is there any better alternative?

pat07:08:35

@dottedmag: as far as the language itself any clojure resource is valid, semantics are the same

dottedmag08:08:17

pkillean: Thanks. I'm more interested in tooling and libraries than the language though: lein/boot/various REPLs/figwheel/testing libraries/whatever. I saw there is a bunch of "project templates", but what I'm looking for is actually a tutorial or a guide on various tools which covers enough to allow me to build the similar "template" myself, with a full understanding of what happens inside.

dottedmag08:08:53

cljs unraveled looks like a good starting point.

martinklepsch10:08:40

@dottedmag: Tenzing uses a lot of boot-* libraries, most having decent READMEs with instructions how to integrate them into your project

darwin10:08:37

I have this defrecord: https://github.com/darwin/re-frame/blob/3d72b79c4a26ba9db33424ab14a568277714e26a/src/re_frame/frame.cljs#L35-L48 and when compiling after lein clean, the compiler reports: WARNING: Protocol IHash implemented multiple times at line 35 checkouts/re-frame/src/re_frame/frame.cljs WARNING: Protocol IPrintWithWriter implemented multiple times at line 35 checkouts/re-frame/src/re_frame/frame.cljs I don’t understand why. Also IPrintWithWriter doesn’t seem to have effect.

darwin10:08:55

any ideas?

dottedmag10:08:16

martinklepsch: Thanks, I'll have a look

darwin10:08:03

ah, now I understand, defrecord implements IHash and IPrintWithWriter by default

darwin10:08:13

the question is how to override IPrintWithWriter implementation with my own

nberger10:08:53

@darwin: You could try with extend-type. It works with types defined with deftype, but I guess it also works with defrecord. An example (with deftype): https://github.com/andrewmcveigh/cljs.node.io/blob/aa216f93d65ac4e08b456e228cb5dbd723ab624e/src/cljs/js/url.cljs#L37-L40

darwin11:08:24

will try extend-protocol, thanks

casperc12:08:26

Anyone here got experience with OpenLayers in Clojurescript? I am trying to get the Cljsjs artifact (https://github.com/cljsjs/packages/tree/master/openlayers) to work, but it doesn’t seem to include the code when loading the app in the browser.

meow14:08:28

I added a bunch of comments so we could discuss the changes.

meow14:08:07

I think I took the right approach, but you are the expert. simple_smile

bhauman14:08:32

@meow: The comments are awesome as well as the commits simple_smile

bhauman14:08:50

@pat: very easy to work on eh?

bhauman14:08:45

@meow: very easy to work on devcards eh? One of the advantages of creating an environment to make dev easier.

meow14:08:42

@bhauman: Well, I don't have much experience with macros, so I was a little slow on that part. And not being familiar with the code base slowed me down as well. But I'm getting there.

meow14:08:59

At least I figured out enough to do what I wanted to do.

bhauman14:08:24

@meow: i really love how the devcards for source code display leave no doubt about what the code is and how it should be used.

meow14:08:04

@bhauman: glad you liked it! simple_smile

meow14:08:34

so I see comments in the code suggesting a desire to eliminate defcard-doc but things like these mkdn macros don't currently work in a regular defcard

meow14:08:12

was thinking it would be nice if they did work in defcard so defcard-doc could go away

meow14:08:56

but I didn't know if that's where you want to go or how big a job that would be so I considered that out-of-scope for now

cfleming15:08:49

@meow: @bhauman: I agree, the annotated diff is awesome +10

meow15:08:57

to be clear, the real issue is the api for defcard and whether it can be altered to support multiple chunks of docstrings.

meow15:08:31

@cfleming: oh, wow, thanks! simple_smile

bhauman15:08:46

@meow: the dispatch is very difficult, and would lead to lots of problems in the future. Better to keep defcard-doc

bhauman15:08:26

@meow: or (decard (doc ...)) or (defcard (str ... ))

meow15:08:36

@bhauman: I hear ya. I do very much like how flexible you've made defcard and how it eliminated so many of the other specialty cards.

meow15:08:11

yeah, those are certainly workable options

bhauman15:08:15

devcard-doc just looks nice though

timgilbert15:08:28

Hi all, anyone know if there’s some way to get lein-cljsbuild to return non-zero if it throws an error? I’m seeing this behavior locally:

% lein with-profile +qa cljsbuild once min
Compiling ClojureScript.
Compiling "resources/public/js/compiled/app.js" from ["env/qa" "src/cljs" "src/cljc"]...
WARNING: run! already refers to: #'clojure.core/run! in namespace: reagent.ratom, being replaced by: #'reagent.ratom/run!
Aug 17, 2015 11:19:37 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate extern input: /Users/tim/kontor/goldfinger/externs/jquery-1.9.js

Aug 17, 2015 11:19:37 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: ERROR - Duplicate extern input: /Users/tim/kontor/goldfinger/externs/materialize.js

Aug 17, 2015 11:19:37 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 2 error(s), 0 warning(s)
ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/tim/kontor/goldfinger/externs/jquery-1.9.js at (unknown source) line (unknown line) : (unknown column)
ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/tim/kontor/goldfinger/externs/materialize.js at (unknown source) line (unknown line) : (unknown column)
Successfully compiled "resources/public/js/compiled/app.js" in 17.564 seconds.

% echo $?
0

timgilbert15:08:08

Not sure why it’s reporting “successfully compiled” when there was an error

bhauman15:08:37

@timgilbert: I'm pretty sure that would require a commit. The idea here is that cljsbuild does autocompiling and doesn't normally stop if there is an error

timgilbert15:08:54

(To be clear, I know what the error is from an have fixed it, but this build sailed right through our CircleCI)

timgilbert15:08:37

@bhauman: even if I call it with once? I just want it to compile one time and tell me if something failed

bhauman15:08:48

@timgilbert: I'm not looking at the code right now. But the behavior you are getting is the behavior that is there, I'm pretty sure you would have to change cljsbuild to catch this.

bhauman15:08:01

@timgilbert: you should look at the build script route i.e. quick start. It will give you all the control you need for a production build.

timgilbert15:08:50

Do you mean boot or the like?

bhauman15:08:53

@timgilbert: you will probably have other requirements pop up for your production build as well and this will be helpful.

nullptr15:08:30

many people must have this problem already — i doubt they’re all manually scripting the compiler — surely there are ways around this?

nullptr15:08:34

actually, looking a bit closer — i think you are simply ignoring warnings

bhauman15:08:35

Manually scripting the compiler is no longer arduous and gives you the opportunity to do just what you want.

bhauman15:08:01

oh good point those are just warning

nullptr15:08:03

bhauman: agreed, but something as basic as compiler errors should fail the cljsbuild regardless

nullptr15:08:06

"Successfully compiled"

timgilbert15:08:18

There is a warning in there, but there are two errors as well

timgilbert15:08:35

WARNING: 2 error(s), 0 warning(s)

dottedmag15:08:48

That's confusing.

dottedmag15:08:56

Warning about presence of errors.

nullptr15:08:15

Very confusing! The fact that it says "Successfully compiled” i think is the thing you want to change...

timgilbert15:08:21

Yeah, I think that’s just the loglevel the message was printed at (purely guessing though)

timgilbert15:08:36

Possibly it’s just a bug in lein-cljsbuild for this specific error case of duplicate externs entries?

timgilbert15:08:04

Ah, I think that’s it, by just putting regular syntax error in a file I’m able to provoke a non-zero exit code

timgilbert15:08:39

Sorry for the noise everyone, will open a ticket with, I guess, lein-cljsbuild

bhauman15:08:05

according to that code the cljs compiler isn't throwing an exception for this type of Error but rather is reporting it instead.

timgilbert15:08:16

Yeah, looks like it

bhauman15:08:28

And this type of error is probably coming from Google closure and doesn't mean that anything is necessarily wrong with the build

bhauman15:08:12

duplicate externs not normally a big deal

shaunlebron18:08:18

is joel martin on slack?

nullptr23:08:25

Not difficult to see that dnolen is on vacation — let’s hope he isn’t doing anything dangerous… https://github.com/clojure/clojurescript/commits/master