Fork me on GitHub
#clojurescript
<
2016-07-22
>
dnolen12:07:35

@krchia you may be misunderstanding how Closure modules it supposed to work. It only really makes 1 build and then effectively splits them into modules. What instructions are you following?

krchia17:07:51

@dnolen my understanding is probably really weak here. im using the official clojurescript wiki page on compiler-options as a reference, and i’m assuming that it should build multiple js files if it’s successful?

hueyp17:07:59

is it possible to have a namespace contain both a macro for cljs and clj e.g. I want defthing to be applicable but different depending on cljs vs clj?

hueyp17:07:20

@anmonteiro: any examples in your projects I could peek at? 🙂

anmonteiro17:07:13

that’s like the simplest case possible

hueyp17:07:29

perfect 🙂 thanks!

dominicm17:07:25

@bhauman: I have a PR to send tonight. Your example gave me enough to build upon and test with.

dnolen18:07:51

@krchia I believe there’s an example on how to build modules besides the short compiler option description

dnolen18:07:13

and yes you should get multiple files - assuming of course you’ve actually supplied the options correctly

krchia19:07:43

@dnolen: i’ll try to find that resource, thanks 🙂

dnolen19:07:55

@krchia I may be wrong and it might not exist, if not somebody should write that up

dnolen19:07:04

more low hanging fruit - pretty sure there’s a JIRA ticket about that one

dominicm20:07:31

@bhauman: Did you deploy a snapshot by any chance?

dominicm20:07:27

I just realised how recently you merged. I didn't look at the timestamp. My apologies for being a pest

misha21:07:38

greetings! is there any difference from the cljs point of view between importing classes defined-and-exported as

export default class MyClass extends Component
//vs.:
export class MyClass extends Component
export default MyClass;
is it (def MyClass (js/require "../components/MyClass")) in both cases? (in js it is:)
import MyClass from '../components/MyClass';
//vs.:
import { MyClass } from '../components/MyClass';

juhoteperi21:07:49

@bhauman: @dominicm: Got the repl working with latest commit!

misha21:07:05

it turns out you need to add (.-default):

(def MyClass (.-default (js/require "../components/MyClass")))
if a class is defined this way:
export default class MyClass extends Component

shaun-mahood21:07:11

@darwin: Going to finally try out either cljs-devtools or dirac - any recommendation on which to go with or info on the differences between the 2?

darwin21:07:12

@shaun-mahood: start with cljs-devtools, when you get familiar with it, you can think about using dirac

darwin21:07:39

dirac assumes use of cljs-devtools, those two tools are not mutually exclusive, dirac goes beyond what can be implemented in cljs-devtools

darwin21:07:17

good luck 🙂

arohner22:07:09

are there any libs/docs/guides for doing small, inline CLJS scripts?

arohner22:07:52

I have a webpage that needs to remain conventional, for speed, but I’d like to put a small inline CLJS script on it to do email collection, so I’d like the compiled JS to be tiny.

shaun-mahood22:07:21

@arohner: Any cljs on the page/cache already?

shaun-mahood22:07:38

No ideas from me then, I've not seen anything specific outside of utilizing google closure modules and dead code elimination. Hope you find something good and put in in version 2 of your book (I've skimmed it but haven't had the time to go through it in detail yet, looking like I'll learn a lot of good stuff though).

martinklepsch22:07:26

@arohner: only use goog and avoid using persistent collections 😛

arohner22:07:07

@martinklepsch: yeah, that’s kind of my thinking. Writing JS-in-CLJS and minimal goog is what I’m after

arohner22:07:29

but it’d also be nice to have a macro/lib thing to handle the inline build, so I can just stick that in my server-side hiccup

martinklepsch22:07:03

ah. I prefer leaving the building to build tools 🙂

martinklepsch22:07:15

Gotta sleep, much success @arohner

arohner22:07:22

thanks. later