my main issue right now is to disable minification for some function: init, enable and disable. gnome shell calls those function to do the work. But the current setup minifies those names.
I'm getting
[2020-11-20 20:08:05.240 - INFO] duplicate resource com/fulcrologic/fulcro/mutations.cljc on classpath, using jar:file:/home/buidler/.m2/repository/com/fulcrologic/fulcro/3.4.3/fulcro-3.4.3.jar!/com/fulcrologic/fulcro/mutations.cljc over file:/home/buidler/project/src/app/com/fulcrologic/fulcro/mutations.cljc
But I don't understand why. I want to use my file, not the version in the jar file. Looking at these instructions https://shadow-cljs.github.io/docs/UsersGuide.html#_patching_librarieswhich version is this? it should be using the file not in the jar always but that kinda depends on which version you use?
thheller/shadow-cljs {:mvn/version "2.8.107"}
yeah thats rather old. dunno how it was handled back then. try 2.11.7
also when you use tools.deps it kinda depends which version you are using there
there was a version that didn't sort :paths first
Should I be concerned much about a shadow-cljs upgrade breaking my application in some way?
since the upgrade also involves upgrading CLJS and the closure-compiler that can always happen
don't know what you are doing so can't rule it out
but most of the time the upgrade is smooth and without issues
:paths ["src/app" "resources" "src/test"]
I made a Gnome Extension with ClojureScript that does nothing useful !!! thanks @thheller for support 🙂
I need to clean up the code and then submit a proper PR and document it
I think I got it. Looks like I have to restart shadow-cljs whenever there's a modification.
Hey there 👋 I’m building an app that requires an in-browser-evaluator, and so, I’m using the shadow-cljs-bootstrap functionality. I’ve mostly followed the https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html. I’m having trouble creating a release of my app with the bootstrap target. I get a “goog is not defined” error. Works in dev mode. Not sure what I’m missing.
the app build must use :compiler-options {:optimizations :simple}
for release to work
Yeah, I tried that as well. I also mentioned that above. Same error, “goog not defined”.
well goog is not defined
is what you get when it is :advanced
and not :simple
so might have been in the wrong place or had a typo or so
Hrm, double checking.
Yeah, same error. Not sure what I’m missing: https://github.com/nilenso/in-browser-evaluator/blob/master/project.clj#L30-L45
assuming you are loading /js/compiled/app.js
in your HTML? I mean where exactly do you get that error?
oh wait .. I know sorry
you also need :output-wrapper false
in the compiler options
In app
or bootstrap-support
?
app
💯
Just read up about the output-wrapper in the user guide as well.
Thanks @thheller ❤️
And thank you for making shadow-cljs 🙇
Might be worth adding this as a note in the blog post, or in the user-guide, perhaps.
yeah just added it to the blog post 🙂
👌 that was quick
Here’s my project.clj: https://github.com/nilenso/in-browser-evaluator/blob/master/project.clj
I’ve tried setting compile options to :optimizations :simple
. That doesn’t work either.
If I compile app
and bootstrap-support
separately in dev mode, it works. i.e shadow-cljs compile app bootstrap-support
.
@thheller while I have you here, another question: I would like the compiler state to be refreshed every time I run eval. Is there a way to do this?
well as I said you can reset the compiler state
but you cannot reset the JS runtime state so you can create (defn foo [] ...)
will create cljs.user.foo = function() ...
. resetting the compiler state will remove the definition from the analyzer
(foo)
will then result in a warning but it eval'd will call the old cljs.user.foo
well technically you can also reset cljs.user
I guess
Right now, I’m hacking this by using a different namespace for every eval 😛
But that hack is coming apart now, so I’d rather fix it the right way.
Seems like I might have to run boot/init
to refresh every time?
But I remember trying that, and not succeeding.
I don't know what you mean by "compiler state to be refreshed"?
I mean you can reset the compiler state but that doesn't reset the runtime state so that wouldn't do much