This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-27
Channels
- # announcements (3)
- # babashka (35)
- # babashka-sci-dev (42)
- # beginners (27)
- # calva (7)
- # clj-kondo (18)
- # cljs-dev (1)
- # clojure (40)
- # clojure-europe (141)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (40)
- # clojurescript (15)
- # community-development (4)
- # cursive (54)
- # events (1)
- # fulcro (8)
- # helix (5)
- # hyperfiddle (22)
- # introduce-yourself (6)
- # jobs (3)
- # joyride (26)
- # lsp (7)
- # music (1)
- # nbb (7)
- # off-topic (28)
- # pathom (120)
- # pedestal (3)
- # podcasts-discuss (2)
- # portal (2)
- # rdf (2)
- # releases (20)
- # rewrite-clj (9)
- # shadow-cljs (26)
- # spacemacs (1)
- # sql (13)
- # vim (10)
- # xtdb (63)
How can I get a REPL JS Runtime connection if my stack looks like ( shadow cljs
➡️ `webpack` ➡️ `storybook web app` ) ?
just need to manually require("./path-to-output/shadow.cljs.devtools.client.browser") in the JS somewhere
no guarantee the REPL works at all though, better just use shadow-cljs browser-repl
without webpack or storybook
1. Thanks so much for the rapid response, let alone for like single-handedly making shadow-cljs lol.
2. Going to try your first option, as it is :npm-module
.
3. I apologize, but I am unsure what your suggestion means with "better just use ... without webpack or storybook", could you clarify?
I suspect the latter, I think? Still new to clj/s, but I mainly want REPL-powered IDE language features
basically when you jack in, you'll pick the browser REPL option which will open a new window that all your REPLing will run in
the downside is you might not have all of the namespaces loaded that are in the storybook build by default, but you can eval them manually to get your tooling to pick it up
Reporting that I got it working via both the browser REPL + "with storybook", in the sense that for the latter:
1. It doesn't "connect" to the browser devtools console, all eval results print to the storybook watcher
Thanks so much, you two.
Now ( maybe related? ) would you have any tips, @U05224H0W for getting binaryage/cljs-devtools
(or similar) custom formatting working within the storybook page/console?
I tried reading around the shadow docs, and I don't know the difference between binaryage's cljs-devtools
/ devtools
libs nor if the references to them matter for the shadow -> webpack -> storybook flow. I imagine it'd be a similar task to above, where I'd have to require
the right module?
the problem is that :npm-module
builds don't have a clear entry point. so there is no place for shadow-cljs to enforce loading of certain namespaces
and if you want to try a REPL require("./path-to-cljs-output/shadow.cljs.devtools.client.browser.js")
Ah, I think we have good entry points for that. So, it's the preload file you listed, and not something like the binaryage/cljs-devtools
https://github.com/binaryage/cljs-devtools/blob/master/docs/installation.md#install-it-manually? And this is to get custom formatting working, right?
Trying my listed approach I get NOT installing CLJS DevTools 1.0.6 under advanced build. See
But I'm running shadow-cljs watch :stories
, with these shadow configs:
:stories {:compiler-options {:optimizations :simple}
:devtools {:console-support true
:enabled true
:preloads [binaryage/cljs-devtools]}
:entries [amperity.storybook.core]
:output-dir "out"
:target :npm-module}