This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
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.
https://github.com/babashka/tools.namespace/commit/8f44ac78798eaf7078cc9ad93fbe1f45bbe9c3c4#diff-cb6f40623e14bf72e25ddaf89bc83c20a3aafa5076ad2c8cadf98a4d609f0b70
https://github.com/babashka/tools.namespace/commit/a13b037215e21a2e71aa34b27e1dd52c801a2a7b#diff-cb6f40623e14bf72e25ddaf89bc83c20a3aafa5076ad2c8cadf98a4d609f0b70
Is there any interest in receiving those fixes back (if they are considered appropriate)?
Sure! I can help with that if you want to provide patches
@alexmiller sure. do I need to make a JIRA issue for both?
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.I feel like maybe one or both of these are existing jiras
@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.
:thumbsup:
@quoll @dnolen fyi re cljs math stuff https://clojure.atlassian.net/browse/CLJ-2673 (removes min + max, moves abs to core), also https://clojure.atlassian.net/browse/CLJ-2672 for the docstring fix
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