This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-20
Channels
- # announcements (16)
- # aws (1)
- # babashka (24)
- # beginners (54)
- # calva (25)
- # cider (4)
- # cljs-dev (2)
- # clojure (16)
- # clojure-dev (39)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-uk (4)
- # clojurescript (66)
- # core-async (16)
- # cursive (13)
- # datomic (15)
- # deps-new (1)
- # duct (22)
- # fulcro (20)
- # jobs-discuss (1)
- # kaocha (3)
- # lsp (11)
- # malli (8)
- # off-topic (38)
- # other-languages (18)
- # polylith (18)
- # portal (15)
- # react (2)
- # reagent (9)
- # reitit (7)
- # releases (10)
- # reveal (1)
- # sci (13)
- # shadow-cljs (3)
- # specter (4)
- # sql (4)
- # xtdb (16)
Is there a way to use scittle in the body of a document (ie. dynamically)?
Yes! I'm getting it all spun up now to make sure I'm not crazy haha 🙂
Alright, so this might be a little crazy - but I'm playing with Pluto.jl which is a reproducible notebook for Julia, and it has the ability to run JS in the cells to create custom UI components. My goal here is to try to use cljs to write the components instead of js.
In the cells, I try to do the example of creating my-alert
from the docs but am getting a "Couldn't execute script" error
The JS is being run through a async call
let execute_dynamic_function = async ({ environment, code }) => {
// single line so that we don't affect line numbers in the stack trace
const wrapped_code = `"use strict"; return (async () => {${code}})()`
let { ["this"]: this_value, ...args } = environment
let arg_names = Object.keys(args)
let arg_values = Object.values(args)
const result = await Function(...arg_names, wrapped_code).bind(this_value)(...arg_values)
return result
}
Oh wait, yeah that throws out the script type
I guess that leads me to my next question - is there a way to call scittle without the script tag, like through a JS interface?
@me1310 there is a JS interface, but intentionally not well documented yet, so early adopters can test it out first :)
https://github.com/borkdude/scittle/blob/main/src/scittle/core.cljs
See ^:export
Ah brilliant!