Fork me on GitHub

Closure compiler mailing list


I noticed that tools.namespace doesn't work for a few CLJS cases: 1. it does not understand string requires (which are typically used for NPM deps), it throws on them 2. it does not take into account :require-macros I'm maintaining a fork of tools.namespace that is compatible with babashka and fixed it in the fork. I am using this fork to detect which macro namespaces are used from a set of .cljs files, to calculate a hash and download the advanced build from elsewhere if it's already available in cloud storage. Is there any interest in receiving those fixes back (if they are considered appropriate)?

Alex Miller (Clojure team)13:11:41

Sure! I can help with that if you want to provide patches


@alexmiller sure. do I need to make a JIRA issue for both?

Alex Miller (Clojure team)14:11:22

a jira would be helpful just so we have something for tracking. if they are both in the bucket of "cljs compatibility", I think it could just be one jira


I'll describe the issues here, so perhaps @dnolen can verify if my changes make sense. Issue 1.

(ns foo (:require ["some-npm-dep"] [normal.cljs.dep]))
ns deps for this ns decl should return #{'normal.cljs.dep} and not throw on the string, which it does now. Arguably it should also return some-npm-dep but you can't statically know if this is a normal cljs dep or an NPM dep. But as the return value is expected to be symbols, I think it's safest to just ignore it.


Issue 2.

(ns foo (:require-macros [clj.dep :refer [x y z]]))
Should return a dependency on clj.dep but right now ignores :require-macros. I added :require-macros to the list of :use,`:require` to detect dependencies.

Alex Miller (Clojure team)14:11:06

I feel like maybe one or both of these are existing jiras


@borkdude yep that sounds right


@alexmiller I'll try to provide a patch for TNS-51 later this week. For the other issue I'll make a new JIRA + patch.

Alex Miller (Clojure team)16:11:48

@quoll @dnolen fyi re cljs math stuff (removes min + max, moves abs to core), also for the docstring fix

👍 1
Alex Miller (Clojure team)16:11:08

if you have a confidence level that cljs can support all (or nearly all) the math functions, that would be useful to know. doesn't have to be done, just looking for whether you believe it can be


Yes, I’m confident. I have implementations for almost everything now (not all tested). The most complex ones are tractable


They rely on bit operations which I’ve been able to completely duplicate in ClojureScript


I'm happy to see the collaboration on this!

💯 2