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.
it would take integrating replicant into scittle
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.
I think it would be cool, especially if @christian767 could then use scittle examples on his website instead of just static code :)
probably the replicant.dom namespace is the most important one right? and it's mostly functions, no macros?
if so, integration should be fairly easy
There are probably quite a few most important namespaces. Some of which have macros.
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
Agree. Iβll see where this takes me. π
And I ported your todo app also to scittle
Here is the scittle branch https://github.com/jeroenvandijk/scittle/tree/replicant-tictactoe-example
I also did portfolio https://github.com/jeroenvandijk/scittle/tree/portfolio-example
awesome
And now I am experimenting with some livereloading like figwheel/shadow-cljs
I'll make a PR for the Replicant addition today
For replicant https://github.com/babashka/scittle/pull/108
@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/
So @pez go ahead if you want to
Yeah I agree about the configs. Was one of the reasons i didn't get to the PR before
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?
Whooo!
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 π
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
It should work, but I am still testing the integration
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
Replicant now works in this playground: https://babashka.org/sci.configs/
at least the dom namespace. we could add more stuff so we have a complete config before we release another scittle
@jeroenvandijk how do you envision reitit being used in scittle?
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
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
and that works in scittle? nice
(i added a locally compiled scittle there so it would work, but it needs to be using a future version)
you can try it quickly like this
git clone && cd scittle-replicant-todomvc && bb serve I disabled the persistent storage as it needs transit. And I hacked together a simple core.match
reitit.frontend now works in here: https://babashka.org/sci.configs/
That core.match shim π€―
Awesome stuff, thanks everyone! π
I'm wondering why https://babashka.org/scittle/replicant_tictactoe.html isn't accessible. @borkdude But it should? https://github.com/babashka/scittle/blob/main/resources/public/replicant_tictactoe.html
probably you have to add it to some copy script
Ah yeah I see it now, https://github.com/babashka/scittle/blob/19774245083a382a682be5b5f5d88cb5b24ea38f/script/release.clj#L8
It will be available with the next release I guess
not if someone doesn't update that script :)
ah sorry yeah, thought it was copying the whole dir
Will add it
@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?
Routing is mandated, but we can change the scittle version to do it without reitit.
Routing needs in todomvc are very simple π
right I guess you could just do it in JS
In ClojureScript, at least. π
@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
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]]))))
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
all working fine now ... off to do something perhaps
looking forward to your somethings
I don't have any deadlines, so kinda like Gaudi said about the Sagrada Familia ... the client will wait π π
@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)
Thanks for checking! With the todomvc example working, I should be good.
@jeroenvandijk any chance you could update the TODOMVC example in scittle without reitit?
@pez so only the replicant.dom interface is what you need for now? great
Replicant does have a very nice hiccup->string renderer, but I wonβt need that for the example I have in mind.
ah yes, the string namespace might be nice too
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?
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).
@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
ah gotcha, sorry, it wasn't added here: https://github.com/babashka/scittle/blob/main/resources/public/replicant_tictactoe.html
then it's all good, thanks
np
I'll add the replicant.string namespace then as well and then we're good for a scittle release I think
we can add other stuff later (the aliases stuff etc, I don't know yet if we need it, we'll see)
I'm totally star struck for having code as part of scittle π€©
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?
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
From what I saw in the reclojure talk aliases seem absolutely fabulous. β€οΈ
They can be quite handy, but are an optional addon.
I guess scittle replicant usage is limited to what I currently understand. If you teach me more, I'll add it over time :P
π
I was there during the reClojure talk, but there's only so much you can absorb in a day
Would be cool with the kanban example in scittle.
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
@borkdude I filled those 30 minutes to the brim. I had to cut a bunch of stuff too π
(FYI here is https://github.com/jeroenvandijk/scittle/commit/452d833128c69652db1f02983048f7c14b54608b seems to work fine here locally. I will make a PR later)
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
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
no the plugins are all the optional things, like hoplon is there too
https://github.com/babashka/scittle/tree/d9da6ffce10cc116ffbd9c58bba031aaf5a71f4d/plugins
Ok cool. And sci.configs is still ok for things like Portfolio?
yeah sure, sci.configs all the things
awesome π
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.
I'm trying to use Replicant and assume from the example that I don't need any deps. But I'm getting
(ns core 2 (:require [replicant.dom :as r]
^--- Could not find namespace: replicant.dom.
copying this issue getting Replicant started into the main thread
you do need to add the replicant plugin
you can find the plugins here: https://github.com/babashka/scittle/releases/tag/v0.7.28
Ah ok