Fork me on GitHub
#shadow-cljs
<
2018-12-15
>
lilactown01:12:48

with latest clojurescript master, I’m getting a stacktrace when I try and run a watch

lilactown01:12:03

82c10925eb8d9c3cecf23447ddf4e1342f120b69 (commit before HEAD of master) works fine, so it’s something in https://github.com/clojure/clojurescript/commit/6ccb629e365f46a9516e4defeced652cce9d4d35

Jon07:12:06

got a question, I want to build my code in dev mode and prod mode, so I created a macro to read from environment variable. however shadow-cljs runs a watch server, which means the code compiles in another process, by environment variable does not work when watch server is running. where should I put the variable now?

pez07:12:12

Not sure I follow, @jiyinyiyong. watch is only for dev mode.

Jon08:12:51

yep, watch server is running all the time, and I run watch on my own laptop.

Jon08:12:11

maybe I should change that. not trying CIs yet.

pez08:12:18

@jiyinyiyong one thing you can do is to checkout the project in another directory and run release there.

Jon08:12:25

maybe time for a CI.

metal 4
thheller11:12:27

> so I created a macro to read from environment variable

thheller11:12:05

@jiyinyiyong don't do that. it breaks caching as the cache won't invalidate if you change the env var

Jon07:12:03

release specific configs is still not enough. tried closure-define, no lick either. At last I switched to browser/nodejs(environment variables) for detecting environment.

Jon07:12:33

at runtime, rather than at compilation.

Jon07:12:29

I thought it would become more predictable if I could decide the environment during compilation. However that breaks caching you mentioned.

thheller11:12:38

@lilactown that commit is invalid. clojure doesn't like that either for me?

thheller11:12:48

{::spec/keys [:problems :fn :cljs.spec.test.alpha/caller]} data

thheller11:12:25

(let [{:spec/keys [:problems]} data]
  problems)

thheller11:12:42

CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec:
In: [0 0 0 0] val: :spec/keys fails spec: :clojure.core.specs.alpha/local-name at: [:args :bindings :binding :map :mb 0 :sym] predicate: simple-symbol?
In: [0 0 0 0] val: :spec/keys fails spec: :clojure.core.specs.alpha/seq-binding-form at: [:args :bindings :binding :map :mb 0 :seq] predicate: vector?
In: [0 0 0 0] val: :spec/keys fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map :mb 0 :map] predicate: coll?
In: [0 0 0 0] val: :spec/keys fails spec: :clojure.core.specs.alpha/map-special-binding at: [:args :bindings :binding :map :mb 0 :map] predicate: map?
In: [0 0 0 1 0] val: :problems fails spec: :clojure.core.specs.alpha/ns-keys at: [:args :bindings :binding :map :nsk 1] predicate: simple-symbol?
In: [0 0 0 0] val: :spec/keys fails spec: :clojure.core.specs.alpha/map-bindings at: [:args :bindings :binding :map :msb 0] predicate: #{:as :or :syms :keys :strs}
...

thheller11:12:46

in a clojure REPL?

thheller11:12:20

its not supposed to take keywords in :keys destructuring?

thheller11:12:26

{:clojure.spec.alpha/keys [problems fn], :clojure.spec.test.alpha/keys [caller]} data is the clojure variant. not sure why that was changed?

lilactown16:12:19

I wonder why when I tried it with the regular CLJS main REPL, Nashorn REPL, and figwheel it didn’t complain

thheller17:12:13

@lilactown shadow-cljs uses the core specs from clojure for CLJS. those are not included in normal CLJS yet

thheller17:12:35

(and I believe it defaults to clojure 1.8 which also didn't have them)

👍 4