Fork me on GitHub
#clojurescript
<
2017-09-23
>
puzzler04:09:22

I'm getting an error when I compile a cljs file using lein-cljsbuild, the latest version of clojurescript, and the Clojure beta1 (but not alpha16). Seems to be generating code with the new ##Inf and ##NaN literals that aren't getting parsed correctly. Is this a known problem, or is there something I'm doing wrong?

puzzler04:09:59

Specifically ##Inf and ##NaN are making their way into the javascript file, and of course, javascript does not recognize those literals.

puzzler04:09:29

This is on code that doesn't actually utilize ##Inf and ##NaN in the clojurescript file.

puzzler05:09:56

The above is from the core.js file where it defines the Clojurescript hash function. Note how it takes cases on ##Inf and ##-Inf, which don't exist in Javascript.

twillis14:09:11

apologies if this question has already been asked but I'm having a devil of a time figuring this out. font-awesome is an npm dependency but it's just css and fonts (no js). how do i work something like that into the build process so that they are dropped in a place they can be found. it's probably even more complicated for me in particular since this is an electron app using descjop. Anyone have any ideas?

twillis14:09:17

FWIW, i tried npm-deps and install-deps but nothing seems different

levitanong14:09:35

@twillis first off, do you use leiningen or boot?

levitanong14:09:36

@twillis install-deps should create a node_modules folder in your project folder. I’m not too familiar with lein, but in boot, I add the relevant node_modules subfolder to my list of resources, then because now I have access to them in the classpath, I “move” files over to where they need to be.

twillis15:09:36

ok I'll play around with resources I did see a lein-resource plugin but it's not quite what I need for the electron app which admittedly is already making the build process pretty weird

twillis15:09:51

thanks for your help @levitanong

levitanong15:09:05

@twillis no problem. Wish I could be of more help.

bostonaholic15:09:02

@twillis there is also the #electron channel you can try

twillis15:09:50

thanks @bostonaholic i joined. so it looks like lein-resource gives me the same abilities i'm used to in ember builds so that will do for now.

felipebarros18:09:58

Is there a current alternative to [Domina](https://github.com/levand/domina)? I mean, to fully separate HTML and CSS development from ClojureScript?

felipebarros18:09:59

I'm following the Modern CLJS tutorial and find myself in a similar situation:

felipebarros18:09:08

> Many Clojure web applications use Hiccup for HTML templating. If > the programmer is also the designer, then Hiccup is ideal. However, > most developers are bad at design. We need to work with people who are > good at design and who don't need to care about Clojure. ClojureScript > One proposes one approach to templating which allows designers to work > with HTML, CSS and images without having to set an eye on Hiccup data > structures or those pesky parentheses.

felipebarros18:09:46

My coworker is great and HTML and CSS and I focus on other stuff. domina seems to be deprecated nowadays.

yury.solovyov19:09:56

One case might be to just teach your coworker hiccup. It might be faster (learning I mean) than you expect

yury.solovyov19:09:21

Just need to prepare him/her somehow, like, "See, we're using this thing where angle brackets are square and you don't have to close tags"

yury.solovyov19:09:49

Same if there is Jade/Slim experience

twillis19:09:39

i did just that with a designer on a project and they got comfortable with it pretty quickly. Now i'm wanting to get them to use garden instead of sass 🙂

felipebarros21:09:00

@yury.solovyov Yeah, I was afraid that it would be the case. My coworker is very change resistant, but if it is the best way I'll attempt to convince him. Thanks.

felipebarros21:09:14

@twillis Mind talking a bit more about garden? Never heard of it.

felipebarros21:09:49

@twillis just checked the project on GitHub, I don't need any more convincing. 🙂 Seems really nice.

dominicm21:09:41

I'm not sure exactly what your constraints are. But it's perfect for "I don't want to learn, make it work"

twillis22:09:48

@dominicm I spent last weekend porting a bunch of sass stuff to garden. and it was pretty straightforward for the most part though I'm still fuzzy on what the extend equivalent is. i just ended up merging 2 vectors and hoping for the best. there is one drawback though in that 2.0 of garden is going to have some breaking changes and it's waiting on spec to stabilize i think also one bug(fixed in 2.0) when you have :pretty-print false for minification in lein-garden things like 0px, 0%, 0em etc...get the units stripped for some reason. and then the browser (at least chrome) flags the rule as invalid.