sci

Sam Ritchie 2022-06-12T12:12:50.583449Z

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?

borkdude 2022-06-12T13:05:25.208389Z

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

Sam Ritchie 2022-06-12T13:07:42.832229Z

Okay awesome. @borkdude 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 Ritchie 2022-06-12T13:10:26.067049Z

Actually @borkdude 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 Ritchie 2022-06-12T13:11:12.635889Z

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

borkdude 2022-06-12T13:12:54.094709Z

re https://clojurians.slack.com/archives/C015LCR9MHD/p1655039426067049?thread_ts=1655039125.208389&cid=C015LCR9MHD yes, this is the approach taken in sci.configs too

Sam Ritchie 2022-06-12T13:23:10.565209Z

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

borkdude 2022-06-12T13:23:46.176049Z

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

Sam Ritchie 2022-06-12T13:25:06.324989Z

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

borkdude 2022-06-12T13:25:34.505959Z

yeah sure, I also have borkdude/deps.clj

Sam Ritchie 2022-06-13T17:51:59.673699Z

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

Sam Ritchie 2022-06-13T17:52:33.031489Z

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

borkdude 2022-06-13T17:52:40.796829Z

@sritchie09 What are the pros/cons?

Sam Ritchie 2022-06-13T17:54:43.605229Z

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

Sam Ritchie 2022-06-13T17:54:54.277879Z

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

Sam Ritchie 2022-06-13T17:55:26.177939Z

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

borkdude 2022-06-12T13:05:54.492859Z

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

borkdude 2022-06-12T13:06:37.547069Z

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

🎉 1
Sam Ritchie 2022-06-12T13:23:57.291089Z

It does support a custom SCI config

👍 2
borkdude 2022-06-12T13:24:49.686789Z

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 Ritchie 2022-06-12T13:28:16.595489Z

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)