Fork me on GitHub
#shadow-cljs
<
2020-11-21
>
Buidler01:11:34

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_libraries

Buidler01:11:43

I think I got it. Looks like I have to restart shadow-cljs whenever there's a modification.

thheller10:11:09

which version is this? it should be using the file not in the jar always but that kinda depends on which version you use?

Buidler12:11:58

thheller/shadow-cljs {:mvn/version "2.8.107"}

thheller12:11:37

yeah thats rather old. dunno how it was handled back then. try 2.11.7

thheller12:11:18

also when you use tools.deps it kinda depends which version you are using there

thheller12:11:26

there was a version that didn't sort :paths first

Buidler13:11:29

Should I be concerned much about a shadow-cljs upgrade breaking my application in some way?

thheller14:11:04

since the upgrade also involves upgrading CLJS and the closure-compiler that can always happen

thheller14:11:24

don't know what you are doing so can't rule it out

thheller14:11:35

but most of the time the upgrade is smooth and without issues

Buidler01:11:38

:paths ["src/app" "resources" "src/test"]

Eugen01:11:12

I made a Gnome Extension with ClojureScript that does nothing useful !!! thanks @thheller for support šŸ™‚

Eugen01:11:30

I need to clean up the code and then submit a proper PR and document it

srihari06:11:11

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.

srihari06:11:08

Iā€™ve tried setting compile options to :optimizations :simple . That doesnā€™t work either.

srihari07:11:04

If I compile app and bootstrap-support separately in dev mode, it works. i.e shadow-cljs compile app bootstrap-support .

thheller10:11:18

the app build must use :compiler-options {:optimizations :simple}

thheller10:11:31

for release to work

srihari12:11:26

Yeah, I tried that as well. I also mentioned that above. Same error, ā€œgoog not definedā€.

thheller12:11:59

well goog is not defined is what you get when it is :advanced and not :simple

thheller12:11:11

so might have been in the wrong place or had a typo or so

srihari12:11:59

Hrm, double checking.

thheller12:11:57

assuming you are loading /js/compiled/app.js in your HTML? I mean where exactly do you get that error?

thheller12:11:09

oh wait .. I know sorry

thheller12:11:20

you also need :output-wrapper false in the compiler options

srihari12:11:38

In app or bootstrap-support?

srihari13:11:33

Just read up about the output-wrapper in the user guide as well.

srihari13:11:20

Thanks @thheller ā¤ļø

srihari13:11:38

And thank you for making shadow-cljs šŸ™‡

srihari13:11:19

Might be worth adding this as a note in the blog post, or in the user-guide, perhaps.

thheller13:11:48

yeah just added it to the blog post šŸ™‚

srihari13:11:57

šŸ‘Œ that was quick

srihari13:11:58

@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?

srihari13:11:34

Right now, Iā€™m hacking this by using a different namespace for every eval šŸ˜›

srihari13:11:31

But that hack is coming apart now, so Iā€™d rather fix it the right way.

srihari13:11:57

Seems like I might have to run boot/init to refresh every time?

srihari13:11:19

But I remember trying that, and not succeeding.

thheller14:11:39

I don't know what you mean by "compiler state to be refreshed"?

thheller14:11:10

I mean you can reset the compiler state but that doesn't reset the runtime state so that wouldn't do much

srihari04:11:06

Iā€™m looking for something similar to a repl refresh, I guess. Where the functions/vars not currently in the file arenā€™t in the registry? I want every ā€œeval-strā€ to be without the context of the previous eval. So if a function foo was defined with the previous eval, calling (foo) with a new eval shouldnā€™t work.

thheller09:11:54

well as I said you can reset the compiler state

thheller09:11:39

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

thheller09:11:54

(foo) will then result in a warning but it eval'd will call the old cljs.user.foo

thheller09:11:39

well technically you can also reset cljs.user I guess