Fork me on GitHub
#cljs-dev
<
2015-10-06
>
bensu12:10:24

@oskarth: your write up is very good. https://gist.github.com/oskarth/de185c3e7e108af54619 What is the case you want to move forward? C? or B & C?

oskarth12:10:09

B and/or C

oskarth12:10:42

@bensu and thanks. I don't know if this is a good direction, but it seems as if (a) you can detect if source is a single file (b) filter out other notifications here: https://github.com/clojure/clojurescript/blob/3ecf5aff4151b10d8abf2376f8fae735c61f28a6/src/main/clojure/cljs/closure.clj#L1799-L1804

oskarth12:10:10

I feel like I'm missing something with the single segment file story. Why is this important?

bensu12:10:06

I don't have final say in anything but, single segment namespaces are a problem in Clojure JVM and ClojureScript respects that: http://stackoverflow.com/questions/13567078/whats-wrong-with-single-segment-namespaces

bensu12:10:03

The issue that might be more relevant is to allow you to watch only one file at a time. As you discovered this seems to be more of a limitation of the underlying watch mechanism than ClojureScript's design.

oskarth12:10:21

So assuming you have a file called hello.cljs in current directory, what's its namespace if it isn't just hello?

oskarth12:10:40

One thing that boot et al allows is to do more scripting, so you can even start without a namespace, and then add that in organically as a script turns into a real project. I think this is how a lot of JS dev is done too, so it would be neat to have something similar for CLJS

bensu12:10:12

but it will throw warnings

bensu12:10:15

I'm not sure I follow, what prevents you from writing a script when using a two-segment namespace like hello.core?

oskarth12:10:14

Nothing, except then the namespace doesn't match the filename. But maybe that's fine too?

bensu12:10:06

No, that is not fine simple_smile I meant having hello/core.cljs with (ns hello.core)

oskarth12:10:08

My point was just that I might be missing something with watching a single file because I didn't understand what the single segment namespace limitations design imposes

oskarth12:10:51

Ah right, so yeah issue remains. The use case is just having a single file without any directories for easy scripting, just like in bash, racket, go, js, etc

bensu12:10:37

Ahh ok, what you are missing is the convenience of not having an extra dir.

dnolen12:10:21

@oskarth: there’s no reason that’s not supported other than nobody’s worked on it and at this point that means few users see it as a priority

dnolen12:10:53

I think it would probably be conservative to say 90% of users are using ClojureScript for the web

oskarth12:10:10

@dnolen: cool, I want to give it a stab. Tinkering with checking parent dir if source is a single file. Does that approach makes sense?

oskarth12:10:02

I'm looking at the closure/watch function

dnolen12:10:50

@oskarth: I don’t have ideas about the the approach, my brain is too far into some other things to empty my cache for this at the moment.

oskarth12:10:26

Ok no worries, if I get something up and running that seems reasonable I'll put it up on JIRA

dnolen12:10:31

my only advice, keep it simple - ideally this only should unlock what’s already there.

dnolen12:10:01

far as I know passing a single file to cljs.closure/build was always supposed to work, watch may be another story.

dnolen12:10:12

but again I don’t know.

oskarth12:10:15

Yes. Watch uses Java API that only supports checking dir

dnolen12:10:32

low JIRA priority issue + patch welcome.