Fork me on GitHub
#off-topic
<
2022-10-10
>
phronmophobic00:10:08

how do cljc library authors handle dependencies that are only necessary for only one of clj or cljs?

delaguardo06:10:47

if this library is distributed as a jar then it is not possible to tell ahead in which context it will be used. so you either have an option to split the library in two packages (for clj and cljs) or don't try to separate dependencies. first approach will lead to complicated building and releasing phase, second - in some cases will download unnecessary resource.

delaguardo06:10:17

another option is to make dependency optional for both platforms, same way as clj-http makes cheshire optional. but this is definitely not a very generic solution

borkdude14:10:51

I think the latter option is more friendly though

phronmophobic18:10:26

👍 , thanks for the breakdown. I decided to just include the cljs dependency since it's pretty small. I did fork the dependency so that it doesn't include org.clojure/clojurescript so that users who don't care about cljs don't need to grab the cljs compiler.

👍 1
vemv10:10:23

such users could simply use :exclusions - clojurescript is a particularly usual exclusion (maybe you could declare the exclusion in your project? then consumers become responsible for pulling clojurescript themselves)

skylize17:10:09

Fyi for Chromium-based browser users: The Experiments page at chrome//:flags now has a #quick-commands flag that enables a ctrl-space activated fuzzy-search command palette. The available commands are pretty sparse, so ymmv. But it offers a few of the many actions that frustratingly have no keyboard shortcut. E.g. ctrl-space g enter matches an Add tab to group command, showing a list of tab groups to add the current tab to. Pressing enter again immediately chooses New group, moving the current tab to a new unnamed group. Otherwise use and then enter to pick an existing group. (Unfortunately not able to give the group a name through this command.)

😮 2
gratitude-thank-you 3