Fork me on GitHub
#clojurescript
<
2019-11-20
>
Joni Hiltunen07:11:15

I tried different Java versions.. also, I can run it fine, just can't build the jar. it works if I remove either +re-frame or +shadow-cljs, but with both I can't build the jar

p-himik09:11:00

Seems like an issue with dependencies, similar to this one: https://github.com/thheller/shadow-cljs/issues/488#issuecomment-486732296 It probably makes sense to ask at #shadow-cljs You can also create an issue it the Luminus template bugtracker.

thheller10:11:24

indeed this is caused by outdated dependencies. should be

[com.google.javascript/closure-compiler-unshaded "v20191027"]

   [org.clojure/google-closure-library "0.0-20191016-6ae1f72f"]
   [org.clojure/google-closure-library-third-party "0.0-20191016-6ae1f72f"]

thheller10:11:01

one of the reasons why I recommend running shadow-cljs standalone so you don't have to deal with this. 😛

p-himik10:11:24

@U05224H0W Is there a way to get the list of correct dependencies automatically?

thheller10:11:56

what do you mean? lein deps :tree will likely tell you about the conflict?

thheller10:11:25

but on another topic ... shadow-cljs shouldn't be included when building an uberjar

thheller10:11:31

so you likely have you dependencies in the wrong profile

p-himik10:11:46

Ah, I see. Piping it into less hides the "override" messages. Also, is :deps true susceptible to this issue?

p-himik10:11:33

Probably yes, if I include Closure myself.

thheller10:11:28

not sure. might be,

thheller10:11:03

I hate that the closure compiler has so many breaking changes but thats life ...

p-himik10:11:17

But if shadow-cljs requires it, why would anyone want to require a specific version explicitly?

thheller10:11:32

the problem is conflict resolution

thheller10:11:38

in lein whichever comes first is picked

thheller10:11:58

and some libraries that shouldn't have a clojurescript dependency have one, thus bringing with it the closure compiler

thheller10:11:24

so if shadow-cljs is the "first" depdendency it should win over others

thheller10:11:28

but often it isn't first

p-himik10:11:10

I see. Thanks!

thheller10:11:23

the dep conflict may still happen if it is first though

thheller10:11:49

in shadow-cljs.edn it automatically enforces that nothing else can depend on clojurescript by adding automatic exclusions

thheller10:11:08

so it avoids those problems at least

thheller10:11:28

I think deps.edn resolves this in a better way by actually comparing versions

thheller10:11:39

but I think the versioning scheme of the closure compiler has "issues"

p-himik10:11:01

Although the dependencies in deps.edn are listed in a map, so it's a bit strange to talk about order here at all. But maybe it's an array-map...

thheller10:11:13

order absolutely shouldn't matter

thheller10:11:16

it is bad that they do

thheller10:11:33

deps.edn actually attempts to resolve conflicts which makes it better

thheller10:11:49

lein just takes whatever comes first without even attempting to resolve anything

p-himik10:11:22

Seems like it just uses Maven resolver. Yeah, Maven was "fun" to work with.

thheller10:11:23

well I guess in lein depth matters so the more direct the higher change of getting in

Joni Hiltunen16:11:10

Thank you both so much

Eliraz08:11:53

is there (--> ...) in clojurescript ?

Eliraz08:11:07

and if there is, what does it do?

orestis08:11:52

There’s -> and ->> which are called thread first and thread last macro

orestis08:11:36

They are the same in ClojureScript

Eliraz09:11:14

but there are no threads in JavaScript

Eliraz09:11:49

it's just the naming? lol

danielstockton09:11:18

Threading like a needle, not OS threads

Eliraz09:11:06

oh yeah I just read about it. it's super cleaver. I mean, why don't every language has this?

roman01la09:11:10

some of them have it, in a form of |>

grounded_sage10:11:08

What are people using to interop with js promises? A library or just plain cljs?

knubie19:11:22

@grounded_sage I've used promesa which is pretty nice

actonDev11:11:12

hi all! anyone else has the problem with figwheel.main, if when launching the build&repl the first build fails cause of some error in my code the reset action won't do anything. I always in this scenario have to fix the causing error and restart the build&repl which is slow.. Any advice?

dnolen14:11:28

@grounded_sage plain cljs works fine - there's a patch for interop with core.async in the works

👍 20
kwrooijen15:11:50

Hi, is there a standard way to include assets (CSS, Images) to a CLJS dependency? Basically I want to write re-frame components in separate library from my main project. But the component library also has CSS (SCSS) that needs to be included.

kwrooijen15:11:15

Or would I have to create an NPM package for my assets?

kwrooijen15:11:00

I would have to write garden instead of SCSS. Sadly that isn’t really a solution for my problem (business related). But thank you for the suggestion

lilactown15:11:13

you can include the files in the jar of the dependency, then have a process to copy them from the class path into your app's static resources

kwrooijen15:11:11

Thanks, I’ll try that

knubie19:11:36

Does clojure/script have an answer for local-first software? https://news.ycombinator.com/item?id=21581444

lukasz19:11:13

I'd say this is not a Clojure specific concern, but rather a question of how something is built e.g. does it rely on storing data locally or in a remote service.

knubie19:11:52

That's true. I was just thinking of if there was something like PouchDB/CouchDB but for clojure/script / datomic / datalog

knubie19:11:00

something that integrates nicely with the clojure ecosystem

lukasz20:11:19

It depends 😉 If you're building a collaborative editor or something in that vein - edit script or more powerful CRDT-based solutions might be the way to go. If it's only keeping single user's local state persisted, then even something like browser's local storage might be enough. I'm not aware of solutions similar to CouchDB except for... Just using Couch/Pouch from Clojure 🙂

macrobartfast20:11:10

a newly created app via lein new luminus myapp +mongodb +re-frame +swagger +auth in which I've activated figwheel via the emacs repl does not consistently show changes or additions to routes on the swagger-ui webpage made in services.clj... thoughts?

macrobartfast20:11:22

side note: I am unclear on the slackiquette in posting such a question here as opposed to #luminus where there is likely many less eyeballs (albeit more topically skilled ones) but I'm open to education on that.

macrobartfast20:11:57

also, cross-posting is a temptation when I'm eager to resolve an issue, but I'll bet that's not considered a good thing to do.

macrobartfast20:11:34

regarding the issue, I noticed that a new endpoint followed by a save will appear on manual page reload and then additional endpoints and changes inconsistently; evaluating the whole buffer in emacs doesn't seem to make a difference; either way figwheel doesn't reload the page (I don't really expect it to but am not sure why I don't; seeing changes after a manual refresh is good enough for me... but of course a figwheel hot reload would be, well, hot); once a new route or changes no longer appear on the swagger-ui webpage changes/additions do not appear until repl restart.

macrobartfast20:11:50

it's crossed my mind that route changes don't get evaluated until a repl restart for whatever reason, but I don't know.

lilactown21:11:22

there’s a number of people doing things that seem related to building local-first software in the clojure + datalog area

lilactown21:11:51

replikativ is a system being built for doing the kind of distributed CRDT stuff that the HN thread talks about

lilactown21:11:42

the differential dataflow project also seems related at a high level