This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-14
Channels
- # announcements (7)
- # aws (1)
- # babashka (1)
- # beginners (19)
- # calva (9)
- # clj-commons (4)
- # clj-kondo (64)
- # clj-on-windows (27)
- # cljsrn (12)
- # clojure (127)
- # clojure-bay-area (3)
- # clojure-europe (25)
- # clojure-hungary (7)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (5)
- # clojure-survey (2)
- # clojure-uk (22)
- # community-development (5)
- # core-async (19)
- # cursive (29)
- # datascript (8)
- # events (1)
- # fulcro (2)
- # graalvm (3)
- # jobs (1)
- # lsp (155)
- # malli (18)
- # nbb (6)
- # off-topic (86)
- # pathom (2)
- # rdf (18)
- # re-frame (9)
- # releases (2)
- # scittle (24)
- # shadow-cljs (33)
- # xtdb (4)
Hey. I pasted the contents of https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.js into a https://script.google.com/home script file and the "Execution log" says ReferenceError: window is not defined
. Do I need window if I just want eval_string
? I'm not really sure how this would work but I wanted to be able to write a Google App Script in clojure (well sci really).
The window
object isn't referenced directly by scittle but this may be an artifact of how it's compiled by CLJS / shadow-cljs
Else the squint method is a bit ugly too, by having to copy paste the output to test every time
just compiling a generic :target :esm
script with SCI + eval_string should get you there, but if you end up copy pasting JS to a Google Apps console anyway, I'd go with squint since the output is much smaller
$ npx squint-cljs --show --no-run -e "(defn foo [x] (+ x 1 2 3))"
var foo = function (x) {
return (x + 1 + 2 + 3);
}
;
export { foo }
Photoshop scripting says it supports Node.js, NPM, and React with ES6. supports a limited version of chromium.
They list these as usupported:
• Drag and drop
• iFrames
• HTML5 Canvas
• window.location
• data
attributes and font-face
• unsupported libs
◦ jQuery
◦ Vue.js
▪︎ (although some people have reported success)
• window.event.cancelBubble = true
◦ Instead, use event.stopPropagation()
• getElementsByClassName(something)
◦ Instead, use document.querySelectorAll("something")
Given this which SCI runtime might be most appropriate/powerful?
#squint already seems to work for simple scripts. But I would like to be able to use cljs libs and and more idiomatic clj.
I haven’t really tried the plugin/toolchain out yet.
But do you see any dealbreakers for running #scittle or #nbb ?
Or like you suggested in https://clojurians.slack.com/archives/C034FQN490E/p1665767911847449, maybe a custom SCI script with libs bundled?