Fork me on GitHub
#shadow-cljs
<
2018-06-25
>
thheller10:06:58

@smnplk turns out there was a bug in shadow-cljs resolve rules that prevented firebase/app from working properly. fixed in 2.4.9.

๐Ÿ‘ 4
ClashTheBunny11:06:55

Hey @thheller, just wanted to follow up and let you know that RMWC works perfectly. I did a quick update to the shadow-reagent example with the buttons replaced with react components from that project: https://gitlab.com/randall.mason/shadow-rmwc-reagent-example/

๐Ÿ‘ 4
ClashTheBunny11:06:36

Weโ€™ll see if Google gets their act together and compiles the JSX in their version of the react wrapper.

mhuebert14:06:50

hmm, any ideas about an error like this:

FileNotFoundException: .../stest/node_modules/apollo-upload-client/lib/main (Is a directory)
        java.io.FileInputStream.open0 (FileInputStream.java:-2)
        java.io.FileInputStream.open (FileInputStream.java:195)
        java.io.FileInputStream.<init> (FileInputStream.java:138)
I tried adding this option:
:js-options {:resolve {"apollo-upload-client" {:target :npm
                                                           :require "apollo-upload-client/lib/main/index.js"}}}
where apollo-upload-client/lib/main/index.js is definitely a file, and then I still get:
ExceptionInfo: :resolve override for "apollo-upload-client" to "apollo-upload-client/lib/main/index.js" which does not exist
the file I am trying to compile:
(ns example.core
  (:require ["apollo-upload-client"]))

thheller14:06:03

@mhuebert is that after upgrading to 2.4.9?

mhuebert14:06:25

It is a fresh project so I am using 2.4.9 but havenโ€™t tried on an earlier version

mhuebert14:06:09

iโ€™ll try now

mhuebert14:06:39

compiles in 2.4.8

thheller14:06:20

"main": "lib/main",
  "module": "lib/module",

thheller14:06:33

would be impossibly hard for them to write lib/main/index.js instead ๐Ÿ˜›

thheller14:06:05

will fix, guess I removed a branch for that somewhere

theasp15:06:25

@thheller Did the default for node.js change to advanced compilation?

lilactown20:06:26

are there any tips to speeding up release builds?

lilactown20:06:43

atm we are running in jenkins. running npx shadow-cljs release build1 build2 is taking about ~360s

thheller20:06:29

I guess you are always recompiling from scratch then? ie. no cache?

thheller20:06:44

step #1: add cache ๐Ÿ˜‰

lilactown20:06:56

๐Ÿ˜‚ any tips on how to do that?

thheller20:06:39

no idea how to do it in jenkins but you just need to "keep" .shadow-cljs/builds directory

thheller20:06:55

make sure its persisted between builds

lilactown20:06:59

I'm kind of dumb at the CI stuff. we're using docker in a runner, so I know we can leverage some caching with the docker containers

thheller20:06:15

you can try running the builds after each other instead of concurrently but that probably won't help much since the threadpool should ensure that all cores are properly ulitilzed

thheller20:06:38

but running in parallel consumes more memory then running sequentially

thheller20:06:47

so if you are memory constrained that might help

lilactown20:06:12

ahh interesting

lilactown20:06:35

I would probably want to start the shadow-cljs server separately then

thheller20:06:53

you can use clj-run or run

thheller20:06:29

ie. write a (defn build-all [] (shadow/release :build1) (shadow/release :build2)) then shadow-cljs run that.ns/build-all

thheller20:06:56

but that won't do as much as caching would

thheller20:06:08

caching will probably bring it down to 60sec or so

thheller20:06:17

sequential maybe 330sec

thheller20:06:32

unless you are really really low on memory

thheller20:06:40

like 512mb or so

lilactown20:06:57

it could honestly be around that. it depends on how many other jobs are running

lilactown20:06:48

I'll fiddle with it for a bit and see if I can figure out how to persist the cache between builds. thanks @thheller ๐Ÿ™‚

thheller20:06:54

cache should be the best option. beyond that you can try messing with :jvm-opts ["-Xmx2G"] or so in shadow-cljs.edn

thheller20:06:06

this would put the max memory for the jvm at 2gb

thheller20:06:54

whatever makes sense for the machine the build is running on. this can sometimes help a bit but nothing like caching would

๐Ÿ‘ 4
lwhorton21:06:52

hey guys, does shadow-cljs support git shas as dependencies, or should i move my whole dep tree to deps.edn and deal with it there?

thheller21:06:14

no, not supported. only via deps.edn + :deps true

๐Ÿ’• 4
lilactown23:06:20

is there some incantation to see the dependency tree of my project using just shadow-cljs (not lein or deps.edn)?

lilactown23:06:48

also does it support exclusions?

lilactown23:06:37

because this is currently failing:

:dependencies
 [[cider/cider-nrepl "0.16.0-SNAPSHOT"]
  [binaryage/devtools "0.9.7"]
  [devcards "0.2.5"]
  [re-frame "0.10.5"
   :exclusions
   [reagent "0.7.0"]]]

lilactown23:06:28

shadow-cljs - dependency update failed - java.lang.Character cannot be cast to clojure.lang.Named

richiardiandrea23:06:11

Hello folks! I am doing:

(ns my-ns 
  (:require [azure-storage :as az-storage]))
but I receive
conflict on "az-storage" by "azure-storage" used by "shadow.js.shim.module$azure_storage"
{:tag :shadow.build.ns-form/require-conflict, :ns-info {:rename-macros nil, :renames {}, :meta {:source "ep-cloud.azure", :file "repl-input.cljs", :line 1, :column 5, :end-line 1, :end-column 19}, :ns-aliases {clojure.spec.alpha cljs.spec.alpha, lodash.upperfirst shadow.js.shim.module$lodash_upperfirst, fs shadow.js.shim.module$fs, bunyan shadow.js.shim.module$bunyan, pg shadow.js.shim.module$pg, process shadow.js.shim.module$process, util shadow.js.shim.module$util, clojure.pprint cljs.pprint, dotenv shadow.js.shim.module$dotenv, lodash.camelcase shadow.js.shim.module$lodash_camelcase, lodash.kebabcase shadow.js.shim.module$lodash_kebabcase, ajv shadow.js.shim.module$ajv, aws-sdk shadow.js.shim.module$aws_sdk}, :use-macros nil, :excludes #{}, :name ep-cloud.azure, :js-aliases {"azure-storage" shadow.js.shim.module$azure_storage}, :imports nil, :requires {node-util util, ep-cloud.define ep-cloud.define, shadow.js.shim.module$azure_storage shadow.js.shim.module$azure_storage, cljs.core cljs.core, gobj goog.object, goog goog, goog.object goog.object, util util, az-storage shadow.js.shim.module$azure_storage, azure-storage azure-storage, shadow.js.shim.module$util shadow.js.shim.module$util, def ep-cloud.define}, :seen #{:require}, :uses nil, :require-macros {cljs.core cljs.core}, :flags {:require #{}}, :js-deps {"azure-storage" {:as az-storage}}, :deps [goog cljs.core ep-cloud.define goog.object shadow.js.shim.module$util shadow.js.shim.module$azure_storage util azure-storage]}, :merge-key :requires, :sym az-storage, :ns azure-storage}
ExceptionInfo: conflict on "az-storage" by "azure-storage" used by "shadow.js.shim.module$azure_storage"
	clojure.core/ex-info (core.clj:4754)
	clojure.core/ex-info (core.clj:4754)
	shadow.build.ns-form/merge-require (ns_form.clj:245)
	shadow.build.ns-form/merge-require (ns_form.clj:238)
	shadow.build.ns-form/process-symbol-require (ns_form.clj:292)
	shadow.build.ns-form/process-symbol-require (ns_form.clj:281)
	shadow.build.ns-form/process-require (ns_form.clj:323)
	shadow.build.ns-form/process-require (ns_form.clj:320)

richiardiandrea23:06:28

what does the above mean?

richiardiandrea23:06:44

I don't need the require?

richiardiandrea23:06:50

I cannot alias it?

richiardiandrea23:06:58

rename to only storage seems to solve it