Fork me on GitHub
#clojurescript
<
2015-08-31
>
dnolen01:08:14

ClojureScript now has as many contributors as Clojure despite being significantly younger. Keep 'em coming simple_smile

zentrope01:08:24

bronsa: lein cljsbuild once ;; with clojure at 1.8.0-alpha3.

zentrope01:08:58

bronsa: I've not (yet) tried to factor out everything to isolate where the prob is.

ghadi02:08:19

alpha4 has a nasty compiler bug i introduced

ghadi02:08:33

zentrope: consider it broken please

ghadi02:08:47

But the exception you got seems unrelated

zentrope02:08:08

Yeah, same error.

zentrope02:08:51

I gotta go run an errand, but after that, I can try using a script, removing cljsbuild from the equation.

zentrope02:08:11

Works with alpha2, but 3 or 4 tanks it with that error.

zentrope02:08:38

Wait! Issue seems to be with cljs 1.7.122. 1.7.48 works just fine with 1.8.0-alpha4.

zentrope02:08:57

@ghadi, @bronsa : ClojureScript 1.7.107 and 1.7.122 break when using >= Clojure 1.8.0-alpha3.

tel02:08:45

Anyone know why codox might choke on clojurescript? It’s dumping a significant number of "WARNING: Use of undeclared Var” lines

bronsa02:08:42

@ghadi: uh? which bug?

bronsa03:08:54

ah, the locals clearing one

bronsa03:08:53

@dnolen: clojure isn't exactly a project I'd base my "acceptable number of contributors" expectancy off of simple_smile

bronsa03:08:40

@dnolen: OTOH I see cljs has almost 50% more commits then clj, that I consider impressive and kudos to you

mfikes03:08:32

Dan Motzenbecker created a nifty command line tool Natal, which sets up a ClojureScript React Native app for you via a single command, like

natal AwesomeApp
https://github.com/dmotz/natal

bronsa03:08:05

@zentrope yeah I can reproduce the error, looks like a (clj) compiler bug. I'll investigate

dnolen03:08:06

@bronsa Clojure's contribution numbers are significantly different from other serious language projects that people actually use for real work.

dnolen03:08:26

s/are/are not

dnolen03:08:00

@mfikes: that awesome!

mfikes03:08:40

@dnolen: Yeah, it is like a lein template on steroids simple_smile

dnolen03:08:15

@tel: I do not recommend Codox for documentation. ClojureScript for JSDoc is rapidly improving. Hopefully YUIDoc can be the standard solution in the near future

dnolen03:08:32

Support for JSDoc I mean

tel03:08:02

Ah! Interesting. Are there references somewhere on how to use it?

dnolen03:08:59

@tel there's nothing to do. Doc strings become JSDoc

dnolen03:08:45

What's missing is a ClojureScript YUIDoc template

bronsa03:08:13

@zentrope: managed to find a minimum reproducible example, http://dev.clojure.org/jira/browse/CLJ-1809 if you want to keep an eye on it

tel03:08:19

@dnolen I see that now. Never worked with YUIDoc before, though

tel03:08:40

can you just throw yuidoc at the output dir somehow and get it to generate docs, that doesn’t seem to work naively

dnolen11:08:56

@tel yes that works, but again you need a template for it to really work

ricardo13:08:10

Is there already a nice threejs wrapper in ClojureScript? My search’s coming up empty… but then again I also had a hard time finding the threejs Clojurescript playground which I did know existed.

ricardo13:08:22

Considering writing one, but don’t want to reinvent the wheel.

ricardo13:08:12

There seems to be the three-year-old https://github.com/jasapp/cljsthree

rauh13:08:58

Is anybody using prismatic/schema in CLJS? If I want to, can I strip out any schema usage/data in advanced compilation to make a small build? Or would I have to write such a wrapper (macros)?

pesterhazy14:08:28

@rauh, you should be able to disable it (search for set-compile-fn-validation! here: https://github.com/Prismatic/schema)

pesterhazy14:08:51

that's how it would work in clj at least, dunno about cljs

rauh14:08:44

Yeah that's what I used in clj. But I mean: I can see that the s/defn (etc) attaches the schema as meta data. If it's never used, does clojurescript strip it out (and all of schema)?

martinklepsch14:08:16

Would be an interesting usecase for custom :closure-defines

pesterhazy14:08:49

ah, you're worried about space, not runtime performance

pesterhazy14:08:54

not sure, my guess it it'll end up in the build but won't make a big difference (you'd have to measure it, however)

niquola14:08:31

How to

var-get
in cljs?

sgrove14:08:03

@bhauman: So I think the problem may be that when I save a CSS file once, it shows up twice in the notifications: https://www.dropbox.com/s/5zpxktph11bllhb/Screenshot%202015-08-31%2007.41.53.png?dl=0

bhauman14:08:10

@sgrove: are you pre-processing it?

sgrove14:08:35

Ultimately I would like to be, but not in this case - just editing a straight css file, adding/removing a single char

bhauman14:08:16

@sgrove: also I'd be interested to see the actual script that that includes the file initially

sgrove14:08:43

Hrm, I thought the actual file path “/resources/public/css” vs the http url path “/css” might be a problem, but looks like it’s loading it fine (and the current behavior is what I would expect)

dnolen14:08:58

@nicola: you can just deref

niquola14:08:23

@dnolen thx, as i see it works same way in clj too?

bhauman14:08:12

@sgrove: I'll look into it, I'm working on the client right now

bhauman14:08:27

@sgrove: thanks for the report

sgrove14:08:10

@bhauman: I’m happy to help - is there anywhere I should look? I was trying to track down if the same file was getting reported twice (maybe calling (set ..) as a quick hack) to watchtower

bhauman14:08:14

@sgrove: I think the client error is interesting

bhauman14:08:56

@sgrove: I'd like to look at it there maybe something that I changed in this last release that is causing a problem

bhauman14:08:03

@sgrove: hmmm do you think your editor is autosaving the file?

sgrove15:08:15

No, only happens on explicit C-x C-s

sgrove15:08:22

I’ll test with text edit to be sure

sgrove15:08:42

@bhauman: Nope, same behavior in TextEdit

sgrove15:08:46

I assume it’s because the server is detecting the same file twice and sending it

bhauman15:08:30

@sgrove: yeah that is strange though. I wonder if your css paths overlap or something.

bhauman15:08:51

@sgrove: in the end I should just make sure they are unique

sgrove15:08:27

You mean for the :figwhel :css-dirs entry?

bhauman15:08:29

@sgrove: oh I know why. You have multiple builds

bhauman15:08:27

@sgrove: I'm just guessing now. But again I'm going to make sure that they are unique.

sgrove15:08:09

There should only be one, but I do have a reference to figwheel in my profiles.clj, I’ll remove that and double check

sgrove15:08:26

@bhauman: Yup! That seems to have been it

sgrove15:08:38

Now just a single file entry shows up, and no error

sgrove15:08:51

(the css changes aren’t actually taking place, but no error!)

bhauman15:08:54

@sgrove: so two identical paths

sgrove15:08:14

Yeah, so the timeout to replace the same link node presumably had a race condition

bhauman15:08:48

@sgrove: if you reload the app in the browser and then try the css changes, does it work

sgrove15:08:14

Let me clear/restart everything

sgrove15:08:32

Alright, in chromium, with only a single fresh build, changing a css file causes the browser to be notified and the new nifty cljs logo to show, an additional <link> tag is inserted into the head, then the previous <link> tag is removed, but no CSS changes take place. Right-click open-resource-in-a-new-tab shows the css file indeed has the change

sgrove15:08:39

Let me try Chrome

sgrove15:08:17

Same behavior

sgrove15:08:38

One moment, could be overwritten by some garden stuff...

sgrove15:08:53

(probably the problem, pebcak)

sgrove15:08:13

Yup, that was it - I’ve been experimenting with styles-in-code and some stuff there, so I had a <style> tag with @import directives, that was overridding the link file in the <head>

sgrove15:08:29

Awesome, thanks @bhauman, my designer will be a much happier person.

sgrove15:08:44

Now I just have to learn to live without weasel and friends

bhauman15:08:29

@sgrove: I'm fixing that right now

bhauman15:08:38

@sgrove: I'm fixing the incompatability with the native cljs browser repl code

bhauman15:08:13

@sgrove: just fixed the distinct css file issue as well

bhauman15:08:44

@sgrove: just released 0.3.9-SNAPSHOT if you want to see if weasel is compatible with it

sgrove15:08:27

Will give it a try now

sgrove16:08:01

I think we’re good to go - I saw one SO, but can’t repro at all now (tried lots of different ways), and everything seems to be working smooth

shaun-mahood16:08:41

@bhauman: If I'm loading 2 CSS files (screen and print, generated from garden), figwheel should be blinking up the logo twice, right? It does it in both 0.3.8 and 0.3.9-snapshot. Moving to 0.3.9-snapshot and will let you know if I run into any problems.

bhauman16:08:42

@sgrove: hmmm let me know if it happens again. Both figwheel and weasel (browser.repl) are patching goog.base I tried to make it so that it can happen in any order.

bhauman16:08:44

@shaun-mahood: only one blink per message from the server and the server is probably only sending one message

shaun-mahood16:08:02

@bhauman: ok, I'll play around with things and see if I can figure out what's happening - sometimes getting one blink, sometimes 2, sometimes none.

sgrove16:08:46

@bhauman: Thanks again for everything

bhauman16:08:14

@shaun-mahood: sounds like when the files are getting detected. Look at the messages in the dev console are the css files grouped?

bhauman16:08:32

my guess is that sometimes they are and sometimes they aren't

shaun-mahood16:08:51

@bhauman: there are 3 different messages I'm getting for different edits - notified of file changes, loaded these files, and loaded CSS files. It looks like it's related to how cursive saves the files, the double blink looks like it only happens when cursive sends things ungrouped.

bhauman16:08:54

probably not cursive but the generation from garden

shaun-mahood16:08:37

@bhauman: I'm still getting css updates (which load and change the styles) that don't come with a blink - figwheel does give the "loaded css files" message.

shaun-mahood16:08:33

Yeah, it may be garden - seems to happen when I am moving between a garden file and a non-garden file, get one message sent from cursive and one from garden

shaun-mahood16:08:02

@bhauman: Ok, just confirmed that both 0.3.8 and 0.3.9-snapshot have the same no blink "loaded css files" message. If you care about fixing it I'm happy to help, but it doesn't bother me otherwise. Mainly want to test the new snapshot

shaun-mahood17:08:56

@bhauman: I think so - I'm using it to test my print stylesheet right now, and the print preview is updated when I make the changes. Not sure how else to check.

bhauman17:08:21

@shaun-mahood: does the link tag change after reload?

bhauman17:08:04

@shaun-mahood: I'm just wondering if your styles are doing something strange to hide the notification

bhauman17:08:44

like a race condition where the print style takes to the page and overrides the screen style for a second

tel17:08:10

so if I throw YUI Doc at a :optimizations :none cljs project it doesn’t really pick up any definitions. JSDoc does a bit better, but it’s still kind of weird

tel17:08:27

anyone have experience using these tools to document a cljs project?

shaun-mahood17:08:42

@bhauman: The link tag does change after reload. I did have a style to hide the figwheel notification on the print stylesheet, took it out and still have the same thing happening.

tel17:08:52

If I throw it just at my own project’s output directly then it actually picks up nothing at all

shaun-mahood17:08:50

@bhauman: Strangely, if figwheel gets the message right after another message it blinks the notification twice, but if it comes on it's own there is no notification. I'll see if I can replicate it in a new project with just figwheel and garden.

martinklepsch19:08:50

I find this article interesting http://glenmaddern.com/articles/css-modules — wondering if people have played with such approaches in ClojureScript

martinklepsch19:08:53

Also there’s a #C06DTLT5X channel in here! 👍

shaun-mahood19:08:08

@bhauman: I can only reproduce the problem when there are 2 separate garden builds, pointing to 2 separate .clj files, where one of the stylesheets is brought in with media="print"

bhauman20:08:17

@shaun-mahood: yeah I didn't plan for that type of flow. I can se why its a problem.

shaun-mahood20:08:24

Even then it is sporadic

bhauman20:08:48

@shaun-mahood: this could be fixed I guess, if you want to file an issue, just need to handle the asynchrony better for css file loads

shaun-mahood20:08:58

@bhauman: I'm leaning towards the side of not worrying about it, since it seems to only be an issue of the figwheel loading display. I can file an issue and provide a sometimes-reproducible case, if you think it's important enough to work on.

bhauman20:08:16

@shaun-mahood: it would be nice to record it. Not hard to fix I don't think.

shaun-mahood20:08:34

@bhauman: Ok, will file away

markbillie20:08:13

is anyone using a datepicker with om?

xificurC21:08:48

is there a concise css guide someone could point me to? I just wanted to put 2 elements next to each other and see there's a whole science around, well, everything regarding css

bhauman21:08:10

@xifi: lookup display: inline-block for simple situations

zentrope21:08:49

There's also that flexbox stuff.... shudder

xificurC22:08:52

@bhauman: : yeah, inline-block, floats... reading around for 30 minutes, it's ridiculous! You'd expect to be able to simply define stuff like this in a declarative language

darwin22:08:49

@xifi: use <table> like back in the nineties 😉

xificurC22:08:08

well at least that was obvious 😛

xificurC22:08:10

I mean if someone said tables you knew how to put 2 things next to each other in 5 minutes. No need to go read a book about it

darwin22:08:35

btw. today I was studying CSS grid layout, and I thought my head just gonna explode: http://www.w3.org/TR/2015/WD-css-grid-1-20150806/

zentrope22:08:18

I just put a div with a given height in, the absolutely position the other stuff inside it. Works great.

xificurC22:08:35

@zentrope: that's a fixed size then though isn't it. I mean how will it show when you make the browser window small? How will it show on a smartphone?

darwin22:08:44

tables are great, didn’t want to write source-code layouter for my editor, so I let browser do all the hard work via deeply nested tree of tables, like a boss 😜

zentrope22:08:20

@xifi: You can "position: fixed" the div as well, so that it will grow relative to the window.

darwin22:08:37

it was probably a stupid idea I’m going to regret sooner or later 😉

xificurC22:08:25

@zentrope: so now I also need to look that up 😄 Didn't anyone abstract over this yet?

zentrope22:08:02

For, say, a nav bar across the top, div.nav-bar {position: fixed, top: 0, left: 0, right: 0, height: 30px}

zentrope22:08:39

Then div.nav-bar div.sign-out {position: absolute; right: 15px; }.

zentrope22:08:12

The sign-out div will always be pinned to the right edge, the nav-bar to the top, left and right, etc, etc.

zentrope22:08:46

If you want elements to stretch, use “vh” and “vw” units, rather than “px”.

zentrope22:08:20

None of which in any way argues your main point: it’s a mess. ;)

zentrope22:08:39

It’s like C++ or Scala. Everyone boils it down to a sub-set language they can manage.

xificurC22:08:38

@zentrope: heh yeah. I need a 10-page best practices guide

martinklepsch22:08:08

@xifi: I’m not sure how approachable it is for beginners but I really enjoy working with http://basscss.com

whacked22:08:22

anybody have experience with emacs+cider browser repl "No such namespace" for files in the same src directory?

whacked22:08:53

the style and scope of the namespace error changes based on the various versions of clojurescript / cider / nrepl, so it's been really nasty to work with

whacked22:08:30

fwiw I've also made profiles.clj fixed based on https://gist.github.com/tclev/04bca1350b4157a0abc4

whacked22:08:02

which uses cider-nrepl 0.10.0-SNAPSHOT and nrepl 0.2.10

whacked22:08:26

last month I resorted to a workaround by downgrading to clojurescript 0.0-2511, lein-cljsbuild 1.0.3, lein-figwheel 0.2.1-SNAPSHOT, weasel 0.4.2

whacked22:08:44

but i really can't tell what is breaking where

whacked22:08:13

anyone got a charmingly working chestnut repo with the latest versions going?

xificurC22:08:47

@martinklepsch: looks quite nice, a bit big for starters, but a reasonable attempt

martinklepsch22:08:10

@xifi big as in code size?

xificurC22:08:50

@martinklepsch: big as in modules and definitions

xificurC22:08:16

although maybe for css this is one of the smaller ones, who knows simple_smile

xificurC22:08:54

ah there are some guides, just what I need, thanks!