scittle

borkdude 2023-01-05T10:37:34.645829Z

https://github.com/babashka/scittle: execute Clojure(Script) directly from browser script tags via SCI! v0.5.14 (2023-01-05) • Fix destructuring in defmethod (by upgrading SCI)

👌 4
🚀 2
Bingen Galartza Iparragirre 2023-01-05T07:31:41.137939Z

Hello! Is not being able to destructure defmethod parameters a known limitation? or maybe a bug? For example, with the following code:

(defmulti greeting :language)

(defmethod greeting :english
  [{:keys [friend]}]
  (prn (str "Hello " friend)))
I get the following error:
---- Scittle error ------------------------------
Message:  Could not resolve symbol: friend
Data:      {:type :sci/error, :line nil, :column nil, :file "profile_picker.cljs", :phase "analysis"}
Location: profile_picker.cljs:11:8 scittle.js:587:452
Phase:    analysis scittle.js:587:452
----- Context ------------------------------------ scittle.js:587:452

07  (defmulti greeting :language)
08  
09  (defmethod greeting :english
10    [{:keys [friend]}]
11    (prn (str "Hello " friend)))
           ^--- Could not resolve symbol: friend
12  
13  
14  (defn main
15    []
16    (let [settings (rf/subscribe [::settings/settings])] scittle.js:587:452
Thank you!

borkdude 2023-01-05T08:50:42.646729Z

This is fixed in a new version of SCI. I’ll release a new version of scittle, then this will be supported

Bingen Galartza Iparragirre 2023-01-05T09:15:49.609199Z

Great, thanks!

borkdude 2023-01-05T10:36:39.543699Z

0.5.14 is now released

Bingen Galartza Iparragirre 2023-01-05T11:40:33.353009Z

Wow, that was fast! Thanks a ton

borkdude 2023-01-05T11:43:06.437519Z

Sure. If you're comfortable sharing, let us know what you're doing with scittle :)

Bingen Galartza Iparragirre 2023-01-05T13:54:16.847069Z

Sure! We are building a web-based wizard for the https://www.gethop.dev/ . For bootstrapping new HOP projects we are using edn files, but they are a bit long and tedious to edit. So we wanted to have a UI that would facilitate that job. As we are experienced in building web applications in CLJS we thought Scittle would be a perfect fit because: • We can integrate it in our https://github.com/gethop-dev/hop-cli (based on Babashka) using http-kit server. • It's easy to setup and we don't need to incorporate any CLJS compiler. • It has all the ingredients we need to build a simple UI with technologies that we already master: reagent and re-frame

borkdude 2023-01-05T13:55:30.092159Z

awesome

Bingen Galartza Iparragirre 2023-01-05T13:56:08.966029Z

Still early stage (no styling yet), but looking good.

👍 1