Fork me on GitHub
#clojurescript
<
2015-07-07
>
jwm02:07:27

I kneed I kneeed

Paco02:07:09

I also want one!!!!!

locks03:07:59

do those stickers ship to portugal troll

eggsyntax05:07:59

@mfikes of many hours ago: I too am really looking forward to a new edition of ClojureScript: Up and Running. Anyone have any idea when that's likely to happen?

estsauver05:07:28

Hey, has anyone written up a comparison of https://github.com/cemerick/clojurescript.test and cljs.test?

belucid09:07:05

@chrisoakman: what's the trick to get a sticker?

entrobe10:07:15

is that bad?

dnolen10:07:45

@entrobe: no, definitely awesome simple_smile

escherize10:07:24

super awesome, good on ya, @shaunlebron

Petrus Theron11:07:14

I'm having trouble getting Boot to require my Clj macros in Cljs. Asked in #C053K90BR, but not getting an answer and it's a bit time-sensitive.

Petrus Theron11:07:08

In build.boot, I have (set-env! :source-paths #{"src/clj" "src/cljs"} ..., but when I :require-macros my clj macro in cljs, boot complains: clojure.lang.ExceptionInfo: No such namespace: plus.utils at line 1 ...

Petrus Theron11:07:32

Does Boot need a special setting to compile macros?

dnolen11:07:40

@petrus doubtful. Just needs to be on the classpath.

dnolen11:07:11

however src/clj/plus/utils.clj must exist

dnolen11:07:44

namespaces and location on the classpath must directly correspond

Petrus Theron11:07:30

@dnolen: checked that. Does boot need any special dependencies, like clojure itself to allow this?

dnolen11:07:54

@petrus: I would keep checking, what you are describing is close to impossible

dnolen11:07:04

something is wrong with your classpath configuration

dnolen11:07:35

investigating anything but your classpath is a wild goose chase

dnolen11:07:50

@petrus: like Lein, boot should have a way to dump the computed classpath

Petrus Theron11:07:34

Got it working. My mistake was that I added plus.utils to app.cljs.edn.

Petrus Theron11:07:45

And it was complaining because that wasn't a cljs path, but a clj path 😕

Petrus Theron11:07:11

screwed myself because the error was so similar

dnolen11:07:28

right but rule of thumb whenever you see an error like that

dnolen11:07:34

don’t look for weird reasons

dnolen11:07:37

it’s always simple

dnolen11:07:57

the compiler could not resolve the namespace on the classpath

dnolen11:07:59

that’s it

jrychter14:07:28

Having built a moderately-sized ClojureScript app, I'm now wondering: how do people handle upgrades/deploys? I do need to restart the JVM. My client-side code uses Sente and can handle disconnects/reconnects, but that doesn't help much if the CSRF tokens are invalid after a JVM restart. I'm looking for advice (perhaps somebody wrote a blog post or a book chapter :))

jrychter14:07:28

And BTW, the app is now live with a demo at https://partsbox.io/ — I'm very happy with the performance I'm getting pretty much out of the box. I used ClojureScript, React, Rum, DataScript, Sente+Transit on the client side and RethinkDB on the server side.

samueldev14:07:12

@jrychter: runs pretty smooth, is the source up online?

samueldev14:07:23

curious to see the source of your 'edit' inputs

samueldev14:07:37

they're slick and I'll be looking to implement something similar shortly

jrychter14:07:11

@samueldev: no, no plans to open-source the whole thing, but I can definitely share some code. Do you mean my "input+button" component? (edit+OK)?

jrychter14:07:10

I haven't found a good way to generalize the UI components. It seems the web requires a thousand various forms of an edit component, each one with subtly different behavior.

samueldev14:07:18

exactly that

samueldev14:07:27

some plain text of a property of a part

samueldev14:07:29

with an edit link

samueldev14:07:35

which turns it into a big input with a save button

dnolen14:07:51

my branch of cljs.tools.reader running via JavaScriptCore is now under 2X of the JVM version 😄

meow14:07:26

@jrychter: Looks great!

teslanick14:07:29

That is incredibly cool; I suppose this bodes well for an "Om Native"

dnolen14:07:31

40ms on my work machine to parse 10000 lines of cljs.core via JVM tools.reader, 70ms under JSC

teslanick14:07:59

Not really Om, but more like CLJS as a great option on iOS.

dnolen14:07:08

@teslanick: well this is much bigger than Om Native

dnolen14:07:21

neither V8 nor SpiderMonkey are shabby

jrychter14:07:13

@samueldev: if you use Rum, I can send you the code for my input+button component. The 'edit' thing is actually done in the parent component.

jwm14:07:17

@jrychter I'd recommend filling out demo / demo in the login form when you use the button

samueldev14:07:54

@jwm I second that, took me a sec to find the small text telling me how to log into the demo simple_smile

jwm14:07:05

hehe it's just because I am extreeeemely lazy

jwm14:07:16

only when it comes to demo apps for some reason

jrychter14:07:18

@jwm I'd actually prefer to just log the user in automatically, but there is only so much time… Thanks for the comments, though. I thought this was obvious and it seems I'm wrong.

jwm14:07:28

no it is obvious

samueldev14:07:32

It's obvious

jwm14:07:34

people are just stupid simple_smile

samueldev14:07:36

in the sense that it took me less than 5s to fidn it

samueldev14:07:45

but its not as obvious as taking me 0.1s to find it

jwm14:07:52

yeah its one of those 5seconds for each and every person or 5 seconds for you to add hehe

andrewmcveigh14:07:56

@dnolen: That’s seriously awesome!

jrychter14:07:09

I guess I could quickly add placeholder text, that would be more visible.

dnolen14:07:19

@andrewmcveigh: yeah coming up on 100X faster than master 😉

andrewmcveigh14:07:47

@dnolen: hah. Not surprised!

dnolen14:07:18

yeah the goal is for ClojureScript under JS engines to be no worse than 2X over the JVM version

dnolen14:07:30

optimizing tools.reader is a good step towards showing this can be done

enn14:07:12

I’m trying to port a library from cljx to cljc … having never really used either before. The Clojure version seems to build and test fine but there seems like some kind of issue with the cljsbuild. main.js always ends up the same length no matter what changes I make, and doesn’t seem to include any function names I’d expect from my code. And when I try lein cljsbuild tests I get ERROR: cemerick.cljs.test was not required., even though it was. Any pointers on where to begin looking to debug this for a complete Clojurescript and cljsbuild novice?

jrychter14:07:45

@dnolen: thanks to perf work like this, I can build apps that get impressive performance out of the box. I mean, I haven't even started to seriously think about performance.

dnolen14:07:06

@jrychter: interestingly bootstrapping has mostly been useful to determine code gen issues with :optimizations :none.

dnolen14:07:22

the main benefit here is that you’ll see less disparity between :none and the higher optimizations settings

dnolen14:07:25

and that’s definitely a good thing

andrewmcveigh14:07:53

I’m kinda ambivalent about perf on core libs. Obviously it’s crucial, but on the other hand it means the implementation is less … nice

andrewmcveigh14:07:36

It would be awesome to have a reference implementation, that wasn’t concerned with perf at all.

jrychter14:07:43

An interesting data point: I'm seeing some disadvantages to compiling the entire app with Closure. It works great for single-page apps, but not necessarily so well for larger sites (like E-commerce).

dnolen14:07:56

@andrewmcveigh: for core libs it’s critical, I don’t see why implementation matters much for critical machinery.

dnolen14:07:24

@jrychter: I’m assuming you haven’t looked into modules, this is what Google does

andrewmcveigh14:07:46

@dnolen: just for looking at, reading, learning.

dnolen14:07:05

@andrewmcveigh: right that’s just a different thing entirely

dnolen14:07:19

but I generally don’t want to use software that was written for reading/learning simple_smile

jrychter14:07:21

No one like @dnolen to make you look silly 😄 — yeah, this might help.

dnolen14:07:15

@andrewmcveigh: but to your point, no I would not copy most of the changes I made to tools.reader

dnolen14:07:29

but tools.reader isn’t a typical application - it’s one giant hot loop

andrewmcveigh14:07:01

@dnolen: no, I agree. Just musing

dnolen14:07:23

@andrewmcveigh: one interesting thing is that a lot of these optimizations are quite boring and could be automated if we had more / better type inference

dnolen14:07:39

a future Google Summer of Code project perhaps

andrewmcveigh14:07:45

Now that would be great.

dnolen14:07:19

yeah I started on it at one point but got busy with other things, definitely doable in a summer

jrychter15:07:33

@jwm @samueldev Thanks for your comments on the demo login — I now implemented auto-login. So, if you click the "instant demo" link, it will automatically log you in.

zoldar15:07:45

@jrychter: when registering, I was able to define a password shorter than 8 chars - don't know if that's intended

jrychter15:07:08

@zoldar: yes, that's intended. Less than 8 chars is seriously too short these days.

jrychter15:07:43

@zoldar: Oops, you meant you were able to define it — that's a bug, then simple_smile

zoldar15:07:34

@jrychter: actually, when I simply press enter having empty password input it also seems to proceed but locks on spinner

jrychter15:07:04

@zoldar: the password length check is missing completely. Forgot about it. Will be fixed.

zoldar15:07:34

@jrychter I'm not an expert on usability but standard input for a password may make some people edgy, especially when they are working on a computer somewhere in public

jrychter15:07:41

@zoldar: I thought about this — and I don't know which is better. If I go with a password field, then I'd need two of them. And, do many people really still use "normal" passwords instead of auto-generating them via 1Password or similar?

mattly15:07:05

what I’ve done in the past is had a “show” button integrated into a single password field, that toggles it between a password and a text input

zoldar15:07:18

@jrychter: you'd surprised how that's still a quite niche practice 😉 however in case of a subset of your potential clients it may look different

mattly15:07:26

and, many many people still type in normal passwords 😞

mattly15:07:46

even people who are otherwise savvy to 2FA

jrychter15:07:09

@mattly oh, that's a neat idea, thanks!

zoldar15:07:59

yeah, nice idea indeed, need to remember that

zoldar15:07:52

@jrychter: is the ability to define storage with an empty name intentional?

jrychter15:07:36

@zoldar: well, not necessarily, but it doesn't matter. If you want an empty name, that's fine, they are referenced by id anyway.

zoldar15:07:53

@jrychter: While I can't create a part with an existing name, I can rename a part as such

jrychter15:07:19

@zoldar: thanks. I'd suggest you direct-message me with these, as they are not of much interest to the other folks here simple_smile

zoldar15:07:37

@jrychter: yeah, true, sorry

jwm15:07:48

I wonder why I haven't seen create user prompts with random password feature built in

iae15:07:51

What do you mean? For registration?

jwm15:07:59

I know they have oauth integration but it'd be cool to see random password as a default capability

mattly16:07:54

that’s a good idea too

mattly16:07:08

though for new stuff I have control over, I’m going with a medium-style passwordless signup

mattly16:07:34

you can set a password later if you want, but otherwise it just sends temporary login emails

mattly16:07:48

if something demands a password, then it should also demand 2FA

nullptr16:07:58

dnolen: thanks for sharing, have been looking forward to this

rauh16:07:25

Already on HN

bhauman16:07:43

@dnolen: any other great talks online (buy you) that I've missed over the last month or so?

dnolen16:07:14

@bhauman: I think EuroClojure beat QCon by 5 weeks so … 😉

brettevans16:07:17

@dnolen: Watching now! Been waiting for either of those videos to pop up.

Petrus Theron16:07:50

Using secretary for routing, how could I add metadata to describe the permissions of a route, so that I can extract it later on? Having no luck with (with-meta {:perm :private} (defroute my-route "/user/:id" [id] ...)

rauh17:07:08

@petrus: Your with-meta parameters are switched.

noisesmith17:07:22

@petrus: also, typically a def* macro should take the metadata of the symbol you provide and merge that into the metadata on the created var (defroute ^{:perm :private} my-route ...) though I can make no promise that secretary properly implements this

noisesmith17:07:15

because calling with-meta on a var doesn't alter the var, so just calling with-meta wrapping the defroute is not sufficient to actually attach any metadata to the actual var as stored in the ns

noisesmith17:07:10

note that with-meta doesn't even actually work, but the ^{} syntax does what we expect

bhauman18:07:09

@dnolen: amazing talk sooo exciting...

dnolen18:07:21

@bhauman: glad you liked it!

bhauman18:07:39

@dnolen: cursors give you contextual update as well

dnolen18:07:42

@bhauman: will probably be showing off some Om Next via Figwheel at TXJS

dnolen18:07:24

@bhauman: they do but components annotated with queries have all the context they actually need.

dnolen18:07:12

and in the end it’s just more flexible wrt. swapping in a new kind of store

dnolen18:07:23

whether that is DataScript or actual Datomic

bhauman18:07:35

@dnolen: indeed it seems much much better. Will reflect more on it. Maybe falling back to local state more for app state makes sense.

bhauman18:07:48

app-state = ui-state

dnolen18:07:44

@bhauman: the programming model really doesn’t change that much actually

dnolen18:07:57

I just can stop answering questions about cursor bugs / issues

samueldev18:07:04

@dnolen: excellent, excellent talk

bhauman18:07:27

@dnolen: this is very very cool

dnolen18:07:09

@bhauman: fingers crossed 😉 but I’m hopeful. Things have been moving a bit slower since queries introduce a new kind of state.

dnolen18:07:34

so you have app-state, component local-state, and component local queries

dnolen18:07:05

users only really have to juggle queries & local-state. But it means the implementation needs more thought.

dnolen18:07:09

still I think the visibility benefits are pretty huge

dnolen18:07:20

you can always ask your app for the total data it needs at any point in time.

dnolen18:07:31

and ask for whatever query represents it’s current state

dnolen18:07:34

it’s more REST than REST!

bhauman18:07:02

@dnolen: that part of the demo was priceless.

bhauman18:07:11

@dnolen: oh and here is all our data

gtrak18:07:29

I feel like these models might work well for relational/graph-traversal kinds of data use-cases, but not as well for things like aggregations. I'm in the middle of writing a bunch of stuff on top of elasticsearch (where things are generally denormalized), and hoping to use something like om.next/datascript for app state at least, and write facades for the other stuff. Just thinking out loud, but I wonder if anyone's considered the limits of the relay/graphql model and how to account for different views (of varying complexity) on possibly the same data.

bhauman18:07:33

and here is our complete query

dnolen18:07:16

@gtrak: aggregations don’t need to happen in restricted query language

bhauman18:07:18

gtrak: its still very flexible right?

bhauman18:07:38

@gtrak: you can escape the model easiliy

dnolen18:07:12

@gtrak: aggregations are often complex, potentially things you don’t want to compute on the fly, or need to be collected from elsewhere

dnolen18:07:26

that’s the whole point of adopting the Falcor/JSONGraph router idea

dnolen18:07:38

any key can be virtual and not sourced from a real DB or whatever

gtrak18:07:55

ah, there's the missing piece then

dnolen18:07:31

yes, it’s really worth not just watching the talk, but going back through the Relay/GraphQL & Falcor/JSONGraph talks for more context

dnolen18:07:34

and gap-filling

dnolen18:07:42

only so much I could cram into 50 minutes

gtrak18:07:54

I watched the falcor talk earlier today simple_smile. though keys are not functions, but the path to the key might be enough to build around.

dnolen18:07:17

yeah but they are thinking about arbitrary functions

dnolen18:07:28

and Relay/GraphQL at FB already supports that

dnolen18:07:41

which of these things Clojure(Script) applications should adopt only time will tell

gtrak18:07:19

we're stock react.js at the moment, but i'm looking for use-cases to shove cljs in there as well simple_smile

gtrak18:07:39

i feel like this query domain is going to be a good one for that

samueldev18:07:32

@dnolen so when is om next gonna be a thing we can get our hands on? the issues you described (and subsequent resolutions via om next) are all precisely the answers to questions I found myself asking when I built an om app this past weekend

dnolen18:07:14

@samueldev: all development happens on Om master

dnolen18:07:42

basics working, but need to sort through queries and some other things before I make any kind of bigger announcement

gtrak18:07:28

the amd/commonjs modules work and jvm-less bootstrapping is exciting for npm projects, for those of us who don't get to work in a pure cljs codebase, and I'm guessing what the clojure community comes up with for query infrastructure will be easier to adapt than relay whenever that drops.

dnolen18:07:59

@gtrak: right though the amount of work to make a JVM-less thing work with NPM is … significant

dnolen18:07:27

more realistic to have a Lein/boot NPM plugin that transforms NPM modules into something CLJS can use

gtrak18:07:43

yea, ideally it needs good two-way interop, IME javascript guys aren't going out of their way to learn a new build system to use a language they can't understand.

dnolen18:07:52

@gtrak it’s just a non-goal, we’re on the JVM, we just don’t have the time to care that much about the NPM ecosystem or tooling

dnolen18:07:08

so if somebody else builds that great - we’re not going to do anything beyond what I talked about at EuroClojure

gtrak18:07:51

having to boot up a jvm for closure advanced-mode once for a production build makes sense to me (we don't want to port that), and there's no multiplatform tools.nrepl, but, I think if it were easy enough to, say, write a webpack loader for cljs source, that would be good for my team.

dnolen18:07:49

@gtrak: that doesn’t make any sense to me. Google Closure is WebPack for JS part except that it does way more.

dnolen18:07:11

if you’re talking about accommodating a Node.js server-side team - that’s just way out of scope.

gtrak18:07:21

nah, not talking about server-side

dnolen18:07:15

combining ClojureScript with non-Closure tooling doesn’t make much sense.

gtrak18:07:21

the distinction i'm making is the cljs tooling currently calls closure, the webpack loader is inverted, so more generally, just need to be able to compile files via external calls from JS.

gtrak18:07:02

which I think probably isn't that hard, and is work needed to support repl loading.

dnolen18:07:11

I’m having a hard time understanding what you are suggesting or why you can’t just call out to Closure, build your CLJS and then load that via WebPack

dnolen18:07:45

either Closure controls the build, or WebPack controls build

dnolen18:07:48

both seem feasible today

gtrak19:07:48

ooo, thanks

zane19:07:19

Watching the EuroClojure Om Next talk, and man is it a relief to see the confusion / issue we've been having with Om (function closures being at odds with React) addressed.

jwm20:07:22

that was a great talk

jwm20:07:39

really got my hyped up and in a problematic way wanting to wait hehe

adamfrey20:07:34

I'm writing CLJS to target Node following the wiki, and I noticed that I change the optimizations option to :advanced, my main function isn't receiving any command line arguments. Printing out js/arguments gives me #js {:0 nil}, while under normal optimization it returns what I passed in: #js {:0 ("sample.txt")}. Is there something else I need?

cfleming20:07:46

So seriously, Elm is amazing, and mostly not due to the language. The attention paid to approachability for new devs is incredible.

cfleming20:07:07

(no offence to all present who toil long and hard on CLJS tooling, of course)

cfleming20:07:29

Evan's talk at Curry On is definitely worth a watch when the videos go up.

gtrak20:07:27

it probably helps that it's a js-only lang

dnolen20:07:36

@cfleming: yeah I’ve been following Elm since the very beginning, very cool stuff and Evan is a great presenter. Looking forward to seeing the presentation.

cfleming20:07:18

@dnolen: Yeah, I talked to him for a while, really smart, nice guy.

dnolen20:07:20

@cfleming: this said while all these things are important, none of that work has ever translated into many serious users of Elm - I talked to the folks at Prezi about this when I was at Craft.

cfleming20:07:17

@dnolen: True, I'm actually not sure how long it's been around - I feel like I've started seeing people talking about it in the last 6 months or so?

dnolen20:07:07

I saw it presented at StrangeLoop in 2012

cfleming20:07:26

Ok, so it's been a while.

dnolen20:07:40

I keep tabs on pretty much every serious compile to JavaScript project

dnolen20:07:47

My experience so far has been pretty much everything thing that people complain about wrt. to ClojureScript are pretty much exactly the reasons anyone uses it in anger at all.

dnolen20:07:59

JVM dependencies, Closure integration, no eval, etc. etc.

bhauman20:07:29

cfleming: I have heard the opposite when it comes to actually trying to create something larger. But my sample is just one dev. the gist is easy to start easy to create demos but when you get past that ...

cfleming20:07:38

Sure, and I think some things (like Light table, for example) are often very beginner friendly but lack features that actual users need.

cfleming20:07:18

But it seems like we're not far from having both in CLJS, and I'm pretty inspired to try to get there.

dnolen20:07:27

@cfleming: but I think Evan’s points are bigger than Elm so I enthusiastically checkout everything he ever does/says.

dnolen20:07:33

it's consistently good stuff.

cfleming20:07:45

Otherwise I'll be teaching my daughter Elm and moving her to CLJS later simple_smile

bhauman20:07:49

cfleming: I do wonder if Elm solves the FRP graph or if it creates a bunch of stateful cells?

cfleming20:07:30

@dnolen: Oh absolutely, in his talk he basically showed no code at all and didn't mention FRP at all - I still only have a vague idea of what Elm even looks like.

dnolen20:07:01

@cfleming: yes I would say his more recent “mission” is to get the great ideas out into the open away from academic jargon

cfleming20:07:42

@dnolen: Right, he talked a lot about that, and even suggested friendlier alternatives for phrases that functional PLs tend to use in their blurb.

dnolen20:07:52

he presented last year at my studio in Brooklyn, was an awesome talk on Arrow-ized FRP and Elm’s innovations around that.

cfleming20:07:17

Nice, that would have been great.

bhauman20:07:55

@dnolen: just created a react class hot loading proxy thing. https://gist.github.com/bhauman/b39cfad51c9d48037b69 it's hilarious that I haven't really had the need for one.

dnolen20:07:09

@bhauman: I haven’t used FRP in anger but I will say that I generally just don’t like it. It feels too much like Rx (for obvious reasons). A matter of taste but I just want to write code, not wire together combinators.

bhauman20:07:58

@dnolen: I agree, I tried it with great interest with FlapJax but eventually the implicit state got seriously unweildy

bhauman20:07:40

@dnolen: react really does it for me

gtrak20:07:33

my experience with react in js is that 6 months later, only the people that have tried systems like clojure or haskell have any idea how to use it right.

gtrak20:07:01

'a discipline of immutability' is hard to teach

bhauman20:07:53

@dnolen: if you get a chance to look at the gist above and reflect on wether something like this will have a place in or alongside Om Next.

dnolen20:07:41

@bhagany: not sure what I’m looking at

bhauman20:07:51

@gtrak: at the same time it looks like there is some serious momentum. Dan Abramov's Redux is getting some real traction very quickly

gtrak20:07:55

being forced to use cljs would make it easier for junior devs to have fewer decisions to make

dnolen21:07:06

@bhauman: is this because you want to hot load a specific component?

dnolen21:07:10

and not re-render the whole thing?

bhauman21:07:30

@dnolen: local state isn't preserved across reloads

dnolen21:07:50

@bhauman: yeah you won’t even need this simple_smile

bhauman21:07:05

how are you doing this?

dnolen21:07:07

in Om Next you have helpers now to set a components props and force re-render

dnolen21:07:18

React warns but the warnings are meaningless

dnolen21:07:51

already confirmed w/ the React team, they’re there to catch JavaScript mistakes

dnolen21:07:00

but for ClojureScript irrelevant

gtrak21:07:45

@bhauman: yea, using a well-documented lib would certainly make things easier, some of the pain is from preexisting ember.js work simple_smile

gtrak21:07:49

I've done dirty, dirty things

dnolen21:07:30

@bhauman: I even confirmed with Sebastien Markbage that this is in fact how Relay works

dnolen21:07:42

except they have deeper hooks to avoid the warnings I believe.

dnolen21:07:26

@bhauman: so basically you easily write a thing that drives

bhauman21:07:26

@dnolen: can we update the underlying class though?

dnolen21:07:46

@bhauman: we just make a normal JavaScript class for every component

bhauman21:07:51

@dnolen: lifecycle hooks and all?

dnolen21:07:00

I dumped all the functional stuff, creates too many problems

dnolen21:07:04

it’s just JS classes

dnolen21:07:09

so easy to patch at runtime.

dnolen21:07:36

and with queries you can get very crazy

bhauman21:07:43

@dnolen: oh!!!!! so the new classes have methods on the prototype and thus they are reloadable.!!!!!

dnolen21:07:53

I didn’t show this but query fragments have the component class as metadata

dnolen21:07:01

all kinds of madness is possible

bhauman21:07:08

@dnolen: oh and this is very cool

dnolen21:07:32

@bhauman: yeah, just change the prototype

dnolen21:07:36

no more protocols in the way

bhauman21:07:19

@dnolen: this is soo soo sweet, well time to dump that code I just wrote.

bhauman21:07:51

well it was kind of an exercise to show Dan what a hot reloader looks like in CLJS

dnolen21:07:46

@bhauman: we also build an entire index that we keep up to date.

dnolen21:07:02

so possible to get at every mounted component

bhauman21:07:17

@dnolen: this is just getting better

bhauman21:07:24

for some reason simple_smile

dnolen21:07:30

learn from your mistakes 😉

bhauman21:07:19

@dnolen: I'm looking at your defui* code and I'm thinking you may want to use a defonce on line https://github.com/omcljs/om/blob/master/src/om/next.clj#L127 as this will keep the local state stable across live class changes 😉

bhauman21:07:46

@dnolen: unless I'm completely wrong about that

dnolen21:07:38

@bhauman: I think this needs to be configurable please open an issue about this

dnolen21:07:48

@bhauman: I’m thinking the best way is with a Closure define

dnolen21:07:56

we can read this out in the macro

dnolen21:07:04

and then easy to configure with all build tools

dnolen21:07:24

:closure-defines {:om-hot-load true}

bhauman21:07:48

Darn didn't know about closure defines.

dnolen21:07:14

lol, there really are a dizzying array of options

bhauman21:07:16

I'm using a pattern in the gist above. defui -> redefui

dnolen21:07:21

not even sure myself how I keep track of it all 😛

bhauman21:07:54

@dnolen: where is that available in macro namespace?

bhauman21:07:04

@dnolen: not namespace but env

dnolen21:07:17

(get-in @env/*compiler* [:options :closure-defines :om-hot-load])

bhauman21:07:39

I'm a gonna use that for devcards as well

bhauman21:07:03

Right now it's just in options :devcards true

bhauman21:07:08

Issue filed

cfleming23:07:57

@dnolen: The Node.js section of the CLJS quick start says: "...we do not output main.js to the out directory. This is important due to the way that Node.js resolves JavaScript source files."

cfleming23:07:20

@dnolen: Does Node.js require the js output in the root of the project, or in CWD, or something?

dnolen23:07:05

no it’s a bit more subtle than that

dnolen23:07:16

we need to hack Node.js so it can load Google Closure namespaces

dnolen23:07:47

maybe you can put it in :output-dir but never tested that nor worked on support for that

dnolen23:07:00

as it’s really not that important for application dev

cfleming23:07:38

Ok, having the generated JS output in the module root causes problems for Cursive, since I can only exclude directories from indexing

dnolen23:07:06

@cfleming: patch welcome, I’m not going to work on this simple_smile

dnolen23:07:19

it’s the smallest population of ClojureScript users by far

cfleming23:07:48

Ok, fair enough. So currently, the hack looks in CWD for the JS files?

dnolen23:07:15

it does not

dnolen23:07:23

everything is relevant to the location of goog

dnolen23:07:57

we use a version of Google Closure’s own hack for Node.js

dnolen23:07:21

originally worked on by Nick Santos when he was at Google on the Closure Compiler team

cfleming23:07:43

Ok. I'll try :output-dir, and if that doesn't work I'll see whether I can find time to investigate.

dnolen23:07:46

is the relevant file, this is what the main file will load

dnolen23:07:37

I’m pretty tired of working on Node.js support

dnolen23:07:43

if people want to use it, fix it simple_smile

cfleming23:07:08

Ok. This is for a user on the ML, I'll see if they feel like fixing it simple_smile

dnolen23:07:20

yes I’m done working on things I don’t use

dnolen23:07:24

the ball is now in the community’s court