Fork me on GitHub
#shadow-cljs
<
2018-12-12
>
pez08:12:50

@thheller Revisiting that cljfmt problem with clojure.string being used without proper require, I found that it happens in rewrite.cljs: Here: https://github.com/rundis/rewrite-cljs/blob/5ed0980d4fc65ba00780deadb3cf245d742bfeb9/src/rewrite_clj/parser/string.cljs#L39 This is quite a bit more problematic than if it had been in cljfmt itself, because the latter is actively maintained, and PRs pulled, but it is not so with rewrite-cljs. Is my only option now to use my own version of rewrite-cljs, or is there something I can tell shadow-cljs that will make it handle this omission? Seeing that it does handle it when I have my lib compiled as a :node-library, but maybe that is totally accidental depending on if the clojure module has been required by some other piece of code earlier in the compile cycle? (I have the full stack trace, if that is of any help.)

pez08:12:07

(I am already using my own fork of cljfmt, tracking upstream tightly, so it is not the end of the world if I have to fork rewrite-cljs to patch this, but if it can be avoided, I would rather avoid.)

thheller10:12:59

@pez not sure. right now fork is your only option I think. let me think about it. maybe I can work around it somehow.

pez10:12:36

Thanks. I have forked and have everything working with the npm-module as I had with the node-library, so I am good right now. 😃

pez10:12:47

With some luck the PR is small and important enough for the maintainer to stir and pull it in.

Jakub Holý (HolyJak)12:12:51

Hi @thheller, had you time to think any more about https://github.com/thheller/gatsby-cljs and StaticQuery support there? Thank you!

tbrooke16:12:14

@holyjak @thheller keep me posted on any efforts re: gatsby I’m a shadow-js newbie and this seems like a good starter project

thheller12:12:45

@holyjak no. no time to do so.

😿 12
pez14:12:26

@thheller: when I build my npm-module using :release some .js files are totally empty. Buildling using :compile works. Is there something that I loose by not using :release?

thheller14:12:21

@pez they become empty because the closure compiler decides they are unused and eliminates everything

thheller14:12:30

add ^:export hints for fns you want to keep

thheller14:12:26

and yes release is pretty much always worth it

thheller14:12:43

you can switch to :optimizations :simple for node though

royalaid16:12:12

@thheller is there a way to provide build opts to build-report? looking at the source it doesn't seem so

thheller16:12:56

what kind of build opts? its purpose is to show what your release build looks like so it uses your builds release config

royalaid16:12:53

The same ones that can be provided to release

thheller16:12:19

an example please. no idea what you are after

royalaid16:12:51

Yeah, 1 sec

royalaid16:12:29

So we use this function to build our release

(defn release
  "Build :browser release, with advanced compilation"
  ([] (release "local"))
  ([release-flag]
   (shadow/release* (-> (config/get-build! :browser)
                        (assoc ::release-flag release-flag)) {})))

royalaid16:12:12

I would like a way to provide that build/release config to build-report to track bundle sizes and such

royalaid16:12:17

that help at all?

thheller16:12:28

whats the purpose of the ::release-flag?

royalaid16:12:55

To set at the command line between our env's, test, staging, prod, etc

thheller16:12:46

how or where do you use that though? the compiler doesn't use that anywhere?

royalaid16:12:08

1 sec I actually have to dig it up

royalaid16:12:41

(inherited this project so some part of the code base are a bit of mystery to me still)

thheller16:12:10

as for the build reports there currently is no option to let you edit the config before compiling

thheller16:12:34

but I could probably add a similar thing so you can modify the the build config similar to release*

hoopes17:12:24

hi, sorry for what's probably a simple question, but has anyone used npm fonts with shadow-cljs? like, once i npm install --save some-font, what's the preferred method for actually using it?

thheller17:12:15

@hoopes shadow-cljs does not support any fonts or css so you'll have to use the usual tools for that

hoopes17:12:35

gotcha - thanks!

royalaid19:12:35

For investigating and the info

royalaid19:12:56

Saves me some time from trying to plug it together right now