Fork me on GitHub
#shadow-cljs
<
2018-10-29
>
souenzzo01:10:07

There is docs about how to add a single cljs file on a (possibly) complex react/jsx/npm project?

lassemaatta07:10:06

@thheller: I think I may have figured out the problem I had yesterday (lot's of provide conflicts). I happened to notice that the .jar of one of our dependencies (https://github.com/vimsical/re-frame-utils) from clojars contains a directory called out (6.2 megabytes), which in turn contains cljs, goog, .. re_frame, .. reagent.. and a bunch of other compiled js libraries. Now I'm no expert on building packages, but that doesn't seem quite right?

thheller07:10:35

@lasse.maatta yes. that is not correct and should not be done

Wilson Velez16:10:09

Hi, I’m moving from leiningen and figweel to shadow-cljs.

Wilson Velez16:10:10

I’m doing a single re-frame app that has a db.cljs file with the specs and a handler.cljs file with the database initialization. after the initialization there is an interceptor used for debug

Wilson Velez16:10:21

(def check-spec-interceptor
  (after (partial check-and-throw :custodian_assets.db/db)))

Wilson Velez16:10:23

but I’m getting this error

Wilson Velez16:10:27

alpha.cljs:71 Uncaught Error: Unable to resolve spec: :custodian_assets.db/db
    at Object.cljs$spec$alpha$reg_resolve_BANG_ [as reg_resolve_BANG_] (alpha.cljs:71)
    at Object.cljs$spec$alpha$Specize$specize_STAR_$arity$1 (alpha.cljs:128)
    at Function.cljs$core$IFn$_invoke$arity$1 (alpha.cljs:124)
    at Function.cljs$core$IFn$_invoke$arity$1 (alpha.cljs:141)
    at Function.cljs$core$IFn$_invoke$arity$2 (alpha.cljs:359)
    at custodian_assets$handlers$check_and_throw (handlers.cljs:14)
    at Function.G__14213__2 [as cljs$core$IFn$_invoke$arity$2] (core.cljs:4268)
    at re_frame$std_interceptors$after_$_after_after (std_interceptors.cljc:313)
    at Object.re_frame$interceptor$invoke_interceptor_fn [as invoke_interceptor_fn] (interceptor.cljc:68)
    at Object.re_frame$interceptor$invoke_interceptors [as invoke_interceptors] (interceptor.cljc:106)

Wilson Velez16:10:02

What am I missing?

hoopes16:10:13

Hi, quick question - I’m trying to use https://github.com/gadfly361/soda-ash/blob/master/src/soda_ash/core.cljs , which has (:require [cljsjs.semantic-ui-react]… in it. This adds about 600 files to my dev build, but when it’s compiled for production, only the actually used components will remain, or b/c it’s cljsjs, it’ll keep the whole semantic ui code? Thanks!

thheller16:10:59

@hoopes all will be included yes

hoopes16:10:33

so cljsjs stuff (i think i heard you say this in a podcast?) is best to avoid when using shadow?

thheller16:10:35

you can only requite whatever you need manually but when including the root package everything will be included

thheller16:10:58

no its the same if you import (:require ["semantic-ui-react" ...])

hoopes16:10:19

right, but the soda-ash lib uses cljsjs, so i should avoid that lib in shadow (?)

thheller16:10:56

soda-ash yes thats a problem if it always imports everything

hoopes16:10:03

gotcha - thanks!

hoopes17:10:17

does it make sense to try to control two different browser apps from a single shadow-cljs.edn file?

hoopes18:10:54

and/or does it make sense/is it possible to change source paths per app? or does the namespacing make that irrelevant? (sorry, my first cljs app…)

thheller19:10:10

@hoopes :source-paths can only be configured once per shadow-cljs.edn, not per build. you run have multiple builds per config though that is perfectly fine. only code used in a build will actually be compiled

hoopes19:10:25

ok, great, thanks again

littleli20:10:35

Hi all. I have confusing issue regarding paths. How to solve situation where application in prod sits on some path like http://mydomain.com/coolapp but in dev there is no need for /coolapp path? in index.html I have /coolapp but then having issues with paths in dev.

littleli20:10:36

what I did... I split builds, paths and on dev I add clumsy /coolapp prefix but I hate idea that files are now copied to different locations 🙂