This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-16
Channels
- # aleph (2)
- # announcements (1)
- # beginners (162)
- # calva (16)
- # cider (37)
- # cljdoc (9)
- # cljs-dev (2)
- # cljsrn (3)
- # clojure (86)
- # clojure-dev (17)
- # clojure-europe (3)
- # clojure-houston (1)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-spec (10)
- # clojure-uk (20)
- # clojuredesign-podcast (15)
- # clojurescript (7)
- # data-science (14)
- # datascript (1)
- # datomic (5)
- # emacs (8)
- # figwheel-main (8)
- # fulcro (25)
- # graalvm (1)
- # jobs (10)
- # jobs-discuss (4)
- # keechma (14)
- # leiningen (2)
- # off-topic (31)
- # onyx (1)
- # other-languages (4)
- # pathom (4)
- # pedestal (1)
- # re-frame (20)
- # remote-jobs (4)
- # shadow-cljs (25)
- # sql (6)
- # tools-deps (15)
- # vim (18)
- # xtdb (9)
Hey, I noticed that cuerdas doesn't work with shadow-cljs. Cuerdas bundles xregexp.js as a resource, but shadow-cljs seems to be messing with it. Running npm install xregexp
doesn't help, it then gives another error:
The required JS dependency "core-js/library/fn/array/is-array" is not available, it was required by "node_modules/@babel/runtime-corejs2/core-js/array/is-array.js".
Searched in:<my-project>/node_modules
You probably need to run:
npm install core-js/library/fn/array/is-array
Neither this instruction, nor npm install core-js
help.
Has anyone else had success using cuerdas "2.2.0" on the client with shadow-cljs?Can someone explain how to use shadow with CIDER?
I was able to get an absolute minimum with shadow-cljs.edn and a single :dev
build targeted for :node-script
, it works when I do shadow-cljs watch dev
in one terminal window and node target/app.js
in the other, but I just want to CIDER-jack-in.
When I jack-in-cljs:
- it first prompts me with the type of REPL, to which I say “shadow”, there’s also “shadow-select”, which I believe is the same thing.
- then it prompts me again for a build, I choose :dev
,
- then it prompts me for the third time, asking if I want to launch a browser (wtf?).
Anyway, it kinda works, but what bothers me - it doesn’t print anything, anywhere (unlike when I run the app like above). My :devtools {:after-load
function, I can’t tell if it’s firing or not. I tried setting (enable-console-print!)
and (node/enable-util-print!)
- it’s not printing
I also tried setting up deps.edn
with shadow-cljs
- and failed at that as well. Anyway - my end goal is to run Puppeteer scripts, I believe I have to use :target :node-script
for that. But why it’s not printing anything? prn
doesn’t appear to be working, neither js/console.log
. It’s not complaining, there’s simply no output anywhere
I probably can figure out how to set some elisp vars in .dir-locals.el so it doesn’t bother me with those silly prompts, but I can’t figure out how to print
@ag I can't help with the cider side of things since I don't use it. as for the shadow-cljs side of things you should NEVER call any of the enable-print methods since that messes with the print methods shadow-cljs already sets up
the print output is currently only available in the process in the launched node process
@ag https://www.blog.nodrama.io/shadow-cljs-cider/ I followed that and it seemed to be working ok (for browser target)
it prompts you to open a browser because most people are using CLJS in the browser.
@ag so the full steps should be:
1. Run cider-jack-in-clojurescript
2. Select shadow
3. Choose dev
4. Press n
to not open a browser
Once the build has completed once, in a terminal run the command:
node target/app.js
and you should see your console.log println etc. show up in the Node process terminal
Can dev http server redirect not just to index.html
but also other files? Currently I have the below files under the public folder. There are both static pages (`index.html`, log-in.html
, and sign-up.html
) and my single page app (`app/index.html`). I want the single page app to handle all the routing under the path /app/*, for example /app/profile. However, when loading /app/profile, the dev server falls back to public/index.html
. Any suggestion is welcome.
public/index.html
public/log-in.html
public/sign-up.html
public/app/index.html
@dawranliou I didn't check it locally but did you try to set multiple roots?:
Thanks. I just gave it a try but it didn’t work because path /app/profile
does not match any file under those two roots, and thus the default handler was called.
But I think you gave me a direction. The :push-state/index
key might be the one I am looking for.
This might not be exactly what I want but hope it’ll work. The right way to do it might be to write a custom handler:
Thanks again for helping out @alpox 🙂
@dawranliou No problem. I'm sure you'll figure out something that works for you 🙂