This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-11
Channels
- # announcements (21)
- # aws (2)
- # babashka (20)
- # beginners (47)
- # bristol-clojurians (2)
- # calva (63)
- # cider (24)
- # clj-kondo (22)
- # cljs-dev (3)
- # cljsrn (6)
- # clojars (3)
- # clojure (147)
- # clojure-europe (21)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (70)
- # clojurescript (37)
- # core-logic (6)
- # cursive (4)
- # data-science (2)
- # datomic (99)
- # events (1)
- # figwheel-main (20)
- # fulcro (26)
- # graalvm (6)
- # graphql (5)
- # kaocha (8)
- # leiningen (20)
- # meander (22)
- # nrepl (4)
- # off-topic (27)
- # pathom (5)
- # pedestal (3)
- # re-frame (20)
- # reagent (4)
- # shadow-cljs (43)
- # spacemacs (11)
- # tools-deps (55)
- # tree-sitter (6)
- # vim (8)
- # xtdb (18)
- # yada (14)
Hi! I'm new to shadlow-cljs and I'm searching for a better testing workflow. I'm targetting a nodejs project and right now I have a :node-test
target working, which is great, but the console output is a bit plain and I'm looking for editor integration to spot any failure more easily and focus on failing tests directly in an editor. I tried VSCode Calva, but the tests commands dont work with shadow-cljs yet. Is it better with Cursive or Cider ?
I’m not sure about Cider, but sadly Cursive’s test integration doesn’t work with CLJS yet.
Calva uses CIDER's tech for testing, so I doubt it will look any better there... Wdys@U051BLM8F?
Handling ClojureScript is not rocket science and would mostly involving piping some ClojureScript evals to the eval middleware, as obviously we can’t run ClojureScript directly, as we do with Clojure.
Is there a way to set repository infomation, like the maven using settings.xml or lein using ~/.lein/profiles.clj ?
I'm using https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html as the basis for self-hosting a compiler in an application. It works well on development, but if I try to do release
with it, it complains about not having access to goog
-namespace.
It seems to be loading the bootstrap stuff from the output folder I have assigned but the evaluation itself fails. I'm using re-plumb for now, is it something to do with that? Should I just stop using it and switch to the built-in one mentioned in the blog post instead?
If I test the https://github.com/mhuebert/shadow-bootstrap-example.git example and do a release build, it complains about the same:
base.js:5319 Uncaught ReferenceError: goog is not defined
at eval (/js/bootstrap/js/75b50edc.cells.lib.js:1)
at eval (<anonymous>)
at Object.goog.globalEval (base.js:251)
at Object.shadow.cljs.bootstrap.browser.script_eval (base.js:5513)
at Object.shadow.cljs.bootstrap.browser.execute_load_BANG_ (base.js:5516)
at base.js:5526
at goog.async.run.processWorkQueue (base.js:5326)
On lein & figwheel the release build with simple optimizations worked. Do I need to deploy the development version as is in order for this to work with shadow-cljs?
@U32ST9GR5 you need to set :compiler-options {:optimizations :simple}
for your "host" build. :advanced
(the default) is not supported.
@U05224H0W the optimizations: simple was already in place. I'll add the output-wrapper and see what happens!
output-wrapper: false
solved the issue for me. Thanks again for your fast response. So, I'm guessing the output-wrapper is a function that basically hides the goog from being globally available and removing that fixes it.
Hello! Any tips for incrementally migrating a React app to ClojureScript? I.e. for a while I am going to have both cljs Fulcro components/files and React .jsx files in the same project, using each other. How do I compile this mess? The React files of course use .jsx and possibly require Babel. Thank you!
hmm then it is probably best to keep everything separate and assign things to a global that is shared
Thanks a lot!
another option is trying to pass everything through shadow-cljs but processing the jsx via babel first. https://shadow-cljs.github.io/docs/UsersGuide.html#_javascript_dialects
thank you!
Not sure about fulcro but with reagent that would be easy you make a react-native lib with your react app and use r/adapt-react-class to use the react components
Is there a way to not append #!/usr/bin/env node
at the beginning of a node-script target, besides removing it afterward with sed? (in order to compile in the nodejs deps with webpack)
if you intend to consume from webpack you should likely be using :node-library
though
Does anyone use shadow-cljs with devcards or an equivalent, e.g. storybook?
several people do yes. https://github.com/nubank/workspaces is neat
Ahh thanks — I new I’d seen something else!
is it possible that shadows silently fails to create the output file but still says done? I see the following in circle ci:
[:api] Compiling ...
Done in 37.24s.
and then from time to time a task fails saying the file doesn't exist, which I can confirm by running a ls
after shadow, the file isn't therein the pass this has happened when the CI system kills the shadow-cljs process because it was consuming too much ram
try limiting the ram via :jvm-opts ["-Xmx1G"]
. see https://shadow-cljs.github.io/docs/UsersGuide.html#jvm-opts