Fork me on GitHub

@thheller is there a way to load a namespace that, for example, sets up custom test clojure.test/report handlers and stuff?


I would go for preload but I remember last time we discussed about why it is not in :node-test


Hey everyone I'm finally ready to share what I have been working on. I call it Shadow JAM a JAMstack build tool built with Shadow CLJS. At the moment it's a very rough prototype. Would love it if others with more clojure experience could chime in and help me make it better. I'd love it to have a lot more polish before it lands on something like Reddit as I think it would bring a lot of interest to how much better the experience can be building Progressive Web Apps in Clojure/Script than the alternatives.

🙂 4

Would love your feedback on this @thheller


I'll try to go over it soon. saw a few rough mistakes and you should really turn this into a proper library. people cloning all this code is absolutely not ideal and makes it extremely hard to upgrade in the future.


Yea it’s really rough, I can point to many mistakes. I either don’t know how to fix them or my domain confidence is somewhat lacking. I do plan to turn it into a library. I’ve had people telling me I should make it public so that others can help with it.


Hey everyone. I am trying to use shadow-cljs for electron development. I used this repo Everything works except live reloading. Din't find how to enable it. In terminal I see compilation after changes but nothing is happening in electron app.


@endenwer the setup in that repo is a bit broken. try changing the config to

  {:target :browser
   :output-dir "resources/public/js"
   :asset-path "js"

   :modules {:renderer {:init-fn app.renderer.core/start!}}

   :devtools {:after-load app.renderer.core/start!}}


and then removing the blank (start!) call from the app.renderer.core ns otherwise it'll be called twice on startup


but that should do it


@thheller Thanks. It works, but I also had to update shadow-cljs version. I can submit pr with all changes if it makes sense.




my plans include making official templates/examples for all of these


Cider repl shows this WARNING: No Clojure project was detected. The refactor-nrepl middleware was not enabled. (You can mute this warning by customizing 'cljr-suppress-no-project-warning'.) Can I somehow fix it?


I think you need to add to your deps but better ask someone actually using cider. I have no idea what its for.


is there a way to get Cursive to also resolve symbols from JS libraries?


when connected to a shadow-cljs repl


for example I have (ns myns.core (:require ["xregexp" as xregexp])) and can use it fine, stuff like (def my-re (xregexp "some.*regex" "g")) works fine, but Cursive shows xregexp cannot be resolved


it's not a big deal of course, just wondering whether I'm doing something wrong


@samuel.wagen no that is not currently supported by cursive unfortunately


fair enough, just wanted to be sure I'm not missing something 🙂


congrats for the clojurists together funding!


Yes, someone just told me about the funding. Great to hear! I guess it still is a bit more symbolic than real pay, but, boy, does shadow-cljs deserve the recognition!


When using the :npm-module target what will my-constant be exported as for something like (def ^:export my-constant 5.662)?


nvm, I tested and see that it got named my_constant.


Why could it be that the cljs-repl complains about no application connected? I have started the app and I get this when I start the cljs repl:

$ npx shadow-cljs cljs-repl :calva
shadow-cljs - config: /Users/pez/Projects/clojure4vscode/shadow-cljs.edn  cli version: 2.4.26  node: v10.1.0
shadow-cljs - connected to server
[3:1]~cljs.user=> 1
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.
It seems to tell me that it is connected to the server, but then complains that it is not. This used to work, and I don’t think I have changed something that should make it stop working. Funny thing is that the nREPL client in Calva can connect and can do everything I tell it, except evaluating (which gives the same error message as trying to evaluate from the REPL prompt).


@pez I'm assuming you switched to :npm-module?


Building to a local directory, not in node_modules, if that makes any difference for this problem.


Congrats congrats, happy to see the project receiving recognition from the community!

🎉 4

Are JS includes (described in run through the Closure Compiler with advanced compilation during a release build? If so, is there a way to turn it off for those files?


@thheller was not being able to use the REPL the price to be payed for switching to :npm-module? 😃


@pez :npm-module doesn't have a clearly defined entrypoint and as such cannot properly "preload" the devtools client. you can load it manually from JS though. so assuming you do import ... from "shadow-cljs/your.ns"; somewhere


hmm doh. do you actually use import or require?


well either way the point is to load shadow-cljs/shadow.cljs.devtools.client.browser before any other CLJS import


@koz yes they run through :advanced but no you can't turn that off (currently). why would you want to?


It seems to be mangling some of my objects, for instance I’m declaring something like var kb = this.quill.keyboard; (which has an addBinding() method, which I call via kb.addBinding(). When I run it through advanced compilation, it turns kb.addBinding() into something like b.rE(), which it can’t find (I believe b still resolves to this.quill.keyboard, but it doesn’t have an rE() function on it).


I can try to draw up a simple repro case since there may be other variables at work here.


@koz did you try shadow-cljs check your-build? you should be getting a warning for that case


Let me try that, thanks @thheller


This library continues to amaze me, great work.


didn't check if its easily possible to do externs inference for JS


but check should find the problem. since you already know the problem though you can just create the externs/your-build.txt with one line addBinding


Awesome, I’ll try that - completely missed that section, sounds like a useful option.


is quill not imported via shadow-cljs? wonder why it doesn't respect the addBinding method


It’s a transitive dependency of react-quill


(which is imported via shadow)