refactor-nrepl, which is the brain behind refactoring libraries like 
clj-refactor and clj-light-refactor uses:

1. find/find-namespaces-in-jarfile
2. file/clojure-file?
3. find/find-clojure-sources-in-dir
4. parse/read-ns-decl

And finally, dependency, file and track are used together to get a list of 
dependent namespaces, e.g. to find out which files are affected when a file 
or dir of files has been moved.

As we add refactoring support for cljs, tools.namespace is one of the 
libraries we're going to lean on.  Since refactor-nrepl is a side project, 
support for cljs in libraries like tools.namespace often end up being a 
deciding factor when debating which feature to build next.

I don't have a strong opinion on 3, but get-me-all-source-files with 
predicate functions for filtering might be nice, because the predicate 
functions themselves are somewhat useful.

Thanks for working on tools.namespace, it's been a joy to use when writing 
tooling!

Lars

On Friday, July 24, 2015 at 11:14:04 PM UTC+2, Stuart Sierra wrote:
>
> Hello to anyone and everyone writing tools for working with Clojure and 
> ClojureScript source files …
>
> I've been looking into adding better support for ClojureScript in 
> tools.namespace.
>
> It's not a trivial problem. Lots of places in tools.namespace assume there 
> is only one kind of source file. For Clojure 1.7 it got updated to include 
> .cljc files as well, but it's still hard-coded. I've collected some of my 
> notes in TNS-35: http://dev.clojure.org/jira/browse/TNS-35
>
> My question to you: if you maintain a tool or library which uses 
> tools.namespace:
>
>    1. Do you need/want ClojureScript support?
>
>    2. What namespaces (repl, find, dir, file, parse) do you call in 
> tools.namespace?
>
>    3. How would you like to distinguish between "get me Clojure sources" 
> and "get me ClojureScript sources"?
>
> Note: I am **not** proposing a full port of tools.namespace to 
> ClojureScript. Something like c.t.n.repl/refresh is too tightly coupled 
> to JVM Clojure, and equivalent tools already exist for ClojureScript.
>
> This is just about using tools.namespace to parse and analyze the 
> dependencies of ClojureScript source files, statically, the same way it now 
> does for Clojure source files.
>
> Thanks,
> –S
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to