scittle

pez 2025-06-16T07:28:45.710519Z

What would it take to support #replicant in Scittle, to us it instead of Reagent? I am curious because I want to create examples using Scittle for webviews in VS Code/Joyride, without bringing in React to the party.

borkdude 2025-06-16T07:30:56.272479Z

it would take integrating replicant into scittle

pez 2025-06-16T07:33:08.061779Z

Would that be of interest to you? I can have a look at it and see if I understand what’s involved, and just generally do the work.

borkdude 2025-06-16T07:33:48.954359Z

I think it would be cool, especially if @christian767 could then use scittle examples on his website instead of just static code :)

😁 1
πŸ˜… 1
🀘 2
borkdude 2025-06-16T07:34:17.725169Z

probably the replicant.dom namespace is the most important one right? and it's mostly functions, no macros?

borkdude 2025-06-16T07:34:48.773749Z

if so, integration should be fairly easy

pez 2025-06-16T07:38:59.741289Z

There are probably quite a few most important namespaces. Some of which have macros.

borkdude 2025-06-16T07:39:21.824849Z

probably best to add it to https://github.com/babashka/sci.configs first (in the playground all libs are exposed) and then we can use that config in scittle

pez 2025-06-16T07:40:20.903069Z

Agree. I’ll see where this takes me. πŸ˜ƒ

2025-06-16T08:22:36.325109Z

@pez I already did this, but didn't create a pr yet

πŸ”₯ 1
2025-06-16T08:22:59.534279Z

And I ported your todo app also to scittle

2025-06-16T08:23:49.614079Z

Here is the scittle branch https://github.com/jeroenvandijk/scittle/tree/replicant-tictactoe-example

2025-06-16T08:24:02.259829Z

I also did portfolio https://github.com/jeroenvandijk/scittle/tree/portfolio-example

borkdude 2025-06-16T08:24:02.270559Z

awesome

2025-06-16T08:24:40.378369Z

And now I am experimenting with some livereloading like figwheel/shadow-cljs

2025-06-16T08:25:22.657729Z

I'll make a PR for the Replicant addition today

🀩 1
2025-06-16T08:36:48.194379Z

For replicant https://github.com/babashka/scittle/pull/108

borkdude 2025-06-16T08:44:42.257319Z

@jeroenvandijk Thanks for the PR, merged. I still think it's better to first move this to sci.configs so we can see if @pez is still missing namespaces for his vscode examples in the playground. The sci.configs playground is auto-deployed here after every PR: https://babashka.org/sci.configs/

borkdude 2025-06-16T08:44:58.415679Z

So @pez go ahead if you want to

2025-06-16T08:45:21.466489Z

Yeah I agree about the configs. Was one of the reasons i didn't get to the PR before

2025-06-16T08:46:35.430179Z

I will also add a PR for reitit as I had to add that to make the todomvc work. Should I add that to sci.configs as well?

pez 2025-06-16T10:10:01.000389Z

Whooo!

pez 2025-06-16T10:12:51.800059Z

Would you like to do the sci.configs update for Replicant, @jeroenvandijk? I would like to, but I have started a lot of things lately without finishing πŸ˜ƒ

2025-06-16T10:13:48.545969Z

Yeah of course, i just did two PRs here https://github.com/babashka/sci.configs/pull/53 and https://github.com/babashka/sci.configs/pull/54

2025-06-16T10:14:11.437299Z

It should work, but I am still testing the integration

2025-06-16T10:40:51.547019Z

Here is the todomvc @pez https://github.com/jeroenvandijk/scittle-replicant-todomvc This includes the compiled versions of Scittle. I will try to add it to the playground in a bit

borkdude 2025-06-16T12:01:16.775449Z

Replicant now works in this playground: https://babashka.org/sci.configs/

4
🀯 2
❀️ 4
3
borkdude 2025-06-16T12:02:25.410229Z

at least the dom namespace. we could add more stuff so we have a complete config before we release another scittle

borkdude 2025-06-16T12:06:57.638389Z

@jeroenvandijk how do you envision reitit being used in scittle?

borkdude 2025-06-16T12:07:31.247119Z

someone asked for a routing library in bb. maybe I should add reitit to bb as well... but it sounded like a heavy dependency to me, but perhaps it's ok

2025-06-16T12:08:04.256599Z

Yeah I don't have a specific urge for it yet, but I had to add it to port @pez his todomvc to scittle https://github.com/jeroenvandijk/scittle-replicant-todomvc/blob/main/src/todomvc/router.cljs#L2-L3

borkdude 2025-06-16T12:08:34.459459Z

and that works in scittle? nice

2025-06-16T12:08:41.681769Z

(i added a locally compiled scittle there so it would work, but it needs to be using a future version)

2025-06-16T12:10:33.504559Z

you can try it quickly like this

git clone  && cd scittle-replicant-todomvc && bb serve

2025-06-16T12:11:02.892259Z

I disabled the persistent storage as it needs transit. And I hacked together a simple core.match

borkdude 2025-06-16T12:14:04.360549Z

reitit.frontend now works in here: https://babashka.org/sci.configs/

πŸŽ‰ 2
pez 2025-06-16T12:16:43.783599Z

That core.match shim 🀯

2
cjohansen 2025-06-16T12:21:03.922459Z

Awesome stuff, thanks everyone! πŸ™

❀️ 2
borkdude 2025-06-16T13:30:31.087989Z

probably you have to add it to some copy script

2025-06-16T13:33:13.831029Z

It will be available with the next release I guess

borkdude 2025-06-16T13:33:46.598869Z

not if someone doesn't update that script :)

βœ”οΈ 1
2025-06-16T13:34:22.638349Z

ah sorry yeah, thought it was copying the whole dir

2025-06-16T13:34:25.139209Z

Will add it

borkdude 2025-06-16T15:54:14.597659Z

@jeroenvandijk I'm a little conservative with adding stuff to scittle's normal distribution. I think replicant is fine since it seems to gain traction, but we could probably hold off on reitit, I don't think it has that much value in scittle. so perhaps we can change the Todo MVC to not use reitit? Or does the standard TODO MVC app it's compared against use some form or routing?

pez 2025-06-16T16:01:10.000489Z

Routing is mandated, but we can change the scittle version to do it without reitit.

cjohansen 2025-06-16T16:02:41.428219Z

Routing needs in todomvc are very simple 😊

borkdude 2025-06-16T16:02:58.668679Z

right I guess you could just do it in JS

pez 2025-06-16T16:12:10.552609Z

In ClojureScript, at least. πŸ˜ƒ

2025-06-16T17:05:49.144529Z

@borkdude yeah I understand your concern. I was also thinking about this especially since I have some other ideas for libraries that I would like to use. I can imagine that it eventually would be a big maintenance burden with version conflicts or just updating versions to keep up. I will try to find an alternative for the routing in this case anyway

pez 2025-06-16T17:18:39.156059Z

I do this for routing in another replicant app:

(js/window.addEventListener "hashchange" #(ax-fx/event-handler {} [[:ax/handle-hash]]))
And it is handled like so:
(defn handle-hash [event-handler {:keys [app/benchmarks]}]
  (let [location-hash (-> js/window .-location .-hash)
        benchmark (when (seq location-hash)
                    (keyword (subs location-hash 1)))]
    (cond
      (contains? (set (benchmark/ordered-active-benchmarks benchmarks)) benchmark)
      (event-handler {} [[:ax/set-benchmark benchmark]])

      (string/starts-with? location-hash "#")
      (event-handler {} [[:ax/fetch-gist (subs location-hash 1)]])

      :else
      (event-handler {} [[:ax/set-benchmark :loops]]))))

πŸ‘ 2
2025-06-16T18:31:38.088749Z

Thanks for the suggestion @pez. I have removed Reitit with a minimal change to the routing namespace. It seems to work https://github.com/jeroenvandijk/scittle-replicant-todomvc/commit/3ec06a8c6971889c65f959db3dfcdcf68628641a#diff-4f5c206a74689134c7f616c38f76ca8f250e62d85e5cf90e39c9cb34493e694b

🀘 1
ray 2025-11-10T22:09:18.245489Z

all working fine now ... off to do something perhaps

borkdude 2025-11-10T22:10:01.028129Z

looking forward to your somethings

ray 2025-11-10T22:29:43.549529Z

I don't have any deadlines, so kinda like Gaudi said about the Sagrada Familia ... the client will wait πŸ˜‡ πŸ˜†

πŸ˜† 1
borkdude 2025-06-17T11:07:37.749629Z

@pez Anything else from replicant you need before a scittle release (tomorrow) that currently doesn't work in https://babashka.org/sci.configs/? (I'll remove reitit but will include replicant in the normal scittle release)

pez 2025-06-17T11:51:05.095059Z

Thanks for checking! With the todomvc example working, I should be good.

borkdude 2025-06-17T11:55:07.531339Z

@jeroenvandijk any chance you could update the TODOMVC example in scittle without reitit?

borkdude 2025-06-17T11:55:36.261809Z

@pez so only the replicant.dom interface is what you need for now? great

pez 2025-06-17T12:00:41.917249Z

Replicant does have a very nice hiccup->string renderer, but I won’t need that for the example I have in mind.

borkdude 2025-06-17T12:01:01.718799Z

ah yes, the string namespace might be nice too

borkdude 2025-06-17T12:01:34.089079Z

I guess it can be used as a hiccup-in-cljs replacement kinda @christian767? If you only use that for example, would it carry much more weight to it than just using another hiccup library?

cjohansen 2025-06-17T12:05:41.393139Z

Replicant's string renderer is useful in combination with Replicant's dom renderer since they implement the exact same "dialect" of hiccup. If you're just rendering strings, it doesn't add much (other options are faster).

2025-06-17T12:06:27.052149Z

@borkdude I've removed the Reitit dependency in the TodoMVC example (https://github.com/jeroenvandijk/scittle-replicant-todomvc). But maybe you are thinking this was added to the Scittle repo? I can do that too if you want

borkdude 2025-06-17T12:07:33.421319Z

ah gotcha, sorry, it wasn't added here: https://github.com/babashka/scittle/blob/main/resources/public/replicant_tictactoe.html

borkdude 2025-06-17T12:08:08.906509Z

then it's all good, thanks

2025-06-17T12:08:19.964409Z

np

borkdude 2025-06-17T12:08:22.924249Z

I'll add the replicant.string namespace then as well and then we're good for a scittle release I think

borkdude 2025-06-17T12:08:48.718369Z

we can add other stuff later (the aliases stuff etc, I don't know yet if we need it, we'll see)

πŸ‘Œ 1
cjohansen 2025-06-17T12:09:11.335809Z

I'm totally star struck for having code as part of scittle 🀩

pez 2025-06-17T12:11:37.632149Z

The alias stuff is part of the string and dom namespaces, isn’t it? The todomvc example doesn’t use aliases, so maybe it it is stripped out?

2025-06-17T12:12:21.960839Z

I don't remember touching it and actually didn't know about aliases. So I didn't add it πŸ˜… But looks useful at some point

pez 2025-06-17T12:13:34.610519Z

From what I saw in the reclojure talk aliases seem absolutely fabulous. ❀️

😊 1
cjohansen 2025-06-17T12:14:58.253629Z

They can be quite handy, but are an optional addon.

borkdude 2025-06-17T12:15:38.860759Z

I guess scittle replicant usage is limited to what I currently understand. If you teach me more, I'll add it over time :P

cjohansen 2025-06-17T12:15:50.746869Z

πŸ˜„

borkdude 2025-06-17T12:16:30.953089Z

I was there during the reClojure talk, but there's only so much you can absorb in a day

pez 2025-06-17T12:16:38.465739Z

Would be cool with the kanban example in scittle.

πŸ‘ 1
2025-06-17T12:17:15.752319Z

I'm currently playing with a local setup of scittle with livereload (like cljs-josh, but also with error reporting) and portfolio. I think this setup can be great πŸ™‚ I will share a PoC at some point

πŸ™ 1
cjohansen 2025-06-17T12:21:51.688549Z

@borkdude I filled those 30 minutes to the brim. I had to cut a bunch of stuff too πŸ˜‚

2025-06-17T12:24:12.776419Z

(FYI here is https://github.com/jeroenvandijk/scittle/commit/452d833128c69652db1f02983048f7c14b54608b seems to work fine here locally. I will make a PR later)

1
borkdude 2025-06-17T12:27:51.782729Z

I'm fine with adding replicant to the default scittle distribution. for stuff like portfolio and more it might be better to build your own scittle and put it on NPM. This is a demo of how plugins are used and added: https://github.com/babashka/scittle/blob/d9da6ffce10cc116ffbd9c58bba031aaf5a71f4d/plugins/demo/README.md?plain=1#L5 I guess we need to move this doc to the docs because it's hard to find. you can add as many plugins as you like (in the scittle repo or your own fork) and host it on npm

2025-06-17T12:30:39.393889Z

Ah cool, thanks makes sense. Yeah I was wondering if something like this was possible. So it doesn't require a completely seperate build? I was assuming that the build with plugins needed to be part of one original build, but if not then this would be great

borkdude 2025-06-17T12:31:03.949289Z

no the plugins are all the optional things, like hoplon is there too

2025-06-17T12:31:21.371979Z

Ok cool. And sci.configs is still ok for things like Portfolio?

borkdude 2025-06-17T12:31:30.926269Z

yeah sure, sci.configs all the things

2025-06-17T12:31:40.362179Z

awesome πŸ™‚

pez 2025-06-17T12:35:16.707579Z

https://github.com/cjohansen/lookup and https://github.com/cjohansen/m1p would be nice to provide in Joyride. They may make sense for scittle too.

ray 2025-11-09T21:03:32.696119Z

I'm trying to use Replicant and assume from the example that I don't need any deps. But I'm getting

ray 2025-11-09T21:03:36.117919Z

(ns core 2 (:require [replicant.dom :as r] ^--- Could not find namespace: replicant.dom.

ray 2025-11-09T21:06:29.287099Z

copying this issue getting Replicant started into the main thread

borkdude 2025-11-09T21:14:48.328219Z

you do need to add the replicant plugin

πŸ™πŸΌ 1
borkdude 2025-11-09T21:16:38.643379Z

you can find the plugins here: https://github.com/babashka/scittle/releases/tag/v0.7.28

ray 2025-11-09T23:03:21.408479Z

Ah ok