Fork me on GitHub
#sci
<
2022-06-12
>
Sam Ritchie12:06:50

Q on best practices… I am currently making a cljs wrapper of mathbox-react, which will expose 54 reagent components. I want users to be able to easily use those from, say, Clerk, which means they need to be exposed inside SCI. My plan now is to build a ready-to-go :namespaces context entry by calling sci/create-ns on all of the namespaces (one for each component), so the user can merge than in to their context. Is this the right pattern for making a library simple to consume via SCI?

borkdude13:06:25

@sritchie09 That's absolutely the right pattern :) That's what we're doing here too: https://github.com/babashka/sci.configs

Sam Ritchie13:06:42

Okay awesome. @U04V15CAJ I'll embrace this style and make a separate repo for the SCI config, as that looks like the slimmest option for the user

Sam Ritchie13:06:26

Actually @U04V15CAJ just to confirm, the idea here is that this ships NO dependencies… but that's fine since if you Don't require a specific library’s namespace this wont cause an error?

Sam Ritchie13:06:12

Is a dot in a project name allowed for a maven artifact btw?

Sam Ritchie13:06:10

I see dashes all the time, just assumed there was some restriction!

borkdude13:06:46

Nope, there is for example org.clojure/tools.cli etc

Sam Ritchie13:06:06

nice. then maybe I’ll do mathbox.cljs instead of mathbox-cljs

borkdude13:06:34

yeah sure, I also have borkdude/deps.clj

Sam Ritchie17:06:59

@U04V15CAJ would you recommend moving the sicmutils config OUT of the main project?

Sam Ritchie17:06:33

Slightly different case since sicmutils has an sci dependency already for its own use. I do need to migrate to copy-ns

borkdude17:06:40

@sritchie09 What are the pros/cons?

Sam Ritchie17:06:43

The main pro is it the current style is going to be quite awkward to maintain as I split up the build

Sam Ritchie17:06:54

Which didn’t occur to me until you asked that question :)

Sam Ritchie17:06:26

awkward because I will need one SCI config for each module, and the current one is equivalent to all of those merged together

borkdude13:06:54

Does clerk support a custom SCI config or do you have to fork clerk for this?

borkdude13:06:37

(phew, I just caught a delayed train alternative in time on my way home from Berlin)

🎉 1
Sam Ritchie13:06:57

It does support a custom SCI config

👍 2
borkdude13:06:49

I gotta check that out then. Maybe the idea we had @mkvlr about making an interactive README for your cljs library could be achieved with a clerk static build

Sam Ritchie13:06:16

I guess you’d have nothing to ADD to the custom context unless you also took over the cljs build process for clerk like I do here: https://github.com/sritchie/programming-2022/blob/sritchie/reactbox/dev/user.clj#L15-L19 so, no fork, but mildly involved especially when producing a custom static build (which I haven’t managed yet)