Fork me on GitHub
#shadow-cljs
<
2020-03-28
>
lilactown00:03:27

what’s recommended for RN + shadow-cljs development these days, expo or react-native’s CLI?

lilactown02:03:45

I went with react-native’s CLI

lilactown02:03:08

I’m noticing with the latest shadow-cljs version, that preloads and :dev/after-load aren’t working

lilactown02:03:20

:preload namespaces are never loaded and :dev/after-load are never run

Aleed04:03:18

iirc shadow-cljs does not work out of the box with react-native, only with expo. I’d recommend starting with expo anyway, since it’s easier to setup and use

thheller08:03:10

of course it works out of the box

👍 4
thheller08:03:33

@lilactown sounds like you are maybe using lein/deps.edn and have a dependency version conflict?

lilactown15:03:28

I only have shadow-cljs and helix as dependencies. I am using deps.edn I was trying out just putting shadow-cljs in deps.edn; I haven’t installed it via npm. would that produce a similar effect?

thheller16:03:01

you should always have it installed via npm but don't see how it would affect this

lilactown21:03:48

This is my deps.edn:

{:paths ["src"]
 :deps {thheller/shadow-cljs {:mvn/version "2.8.94"}
        lilactown/helix {:local/root "../helix"}}}
how would I look for a dependency conflict in this case?

thheller21:03:11

likely isn't a dependency conflict then

thheller21:03:22

just check via clj -Stree to be sure though

thheller21:03:53

probably something else if the versions are all correct. dunno what though.

lilactown16:04:30

I don’t know what happened, but I restarted shadow-cljs a couple times and it started working :man-shrugging:

lilactown16:04:47

shadow-cljs + react-native is super slick! I appreciate it a lot

thheller08:03:01

which causes goog.define to not work which in turn causes the devtools to not load at all

otwieracz08:03:18

Hey, I suddenly started getting errors:

The required JS dependency "core-js/library/fn/parse-int" is not available, it was required by "node_modules/@babel/runtime-corejs2/core-js/parse-int.js".

Search in:
        /c/Users/Slawek/Work/foo/bar/node_modules
You probably need to run:
  npm install core-js/library/fn/parse-int

See: 
My dependencies are:
:dependencies [[reagent "0.8.1"]
                [secretary "1.2.3"]
                [venantius/accountant "0.2.4"]
                [re-frame "0.10.5"]
                [day8.re-frame/http-fx "0.1.6"]
                [re-com "0.9.0"]
                [com.andrewmcveigh/cljs-time "0.5.2"]
                [re-frisk "0.5.3"]      ;NOTE enable only for debugging
                ]
have you seen something like that?

thheller08:03:46

npm package version conflict

otwieracz08:03:29

How can I debug this?

thheller08:03:42

npm ls and see which packages are doubled

thheller08:03:09

mostly look for core-js

arttuka11:03:12

Hi, if I have a CLJS library (from Clojars) with its own package.json file and I want to use that library in another project, do I have to declare the library's dependencies again in that project's package.json or can I somehow tell shadow-cljs to look at the library's package.json as well?

thheller11:03:50

that library must include a deps.cljs file with {:npm-deps {"a-dependency" "version"}}

arttuka11:03:57

thanks! I tried to google this but failed to find an answer.

Spaceman13:03:03

I installed shadow-cljs as follows:

npm install -g shadow-cljs
Then I created a shadow-cljs.edn file, with the following:
{:source-paths
 ["src/cljs" "src/cljc" "dev"]
 :dependencies
 []
 :builds
 {:app
  {:target :browser
   :output-dir "resources/public/js/compiled"
   :asset-path "/js/compiled"
   :modules {:myapp {:entries [myapp.system]}}}}}
Then in the already running clj repl, I do M-x cider-connect-sibling-cljs, and select the shadow repl option. But I get that shadow-cljs Clojurescript REPL is not available. How do I get shadow cljs to work?

thheller13:03:54

same answer as in #cider 😛

awb9920:03:50

I am using shadow-sljs with lein project.clj for dependencies,

awb9920:03:23

will shadow-cljs respect :managed-dependencies ?

thheller20:03:52

lein handles that. shadow-cljs is never even looking at project.clj

awb9920:03:43

:lein   {:profile "+cljs"}

awb9920:03:04

But when I configure shadow-cljs to use leiningen for dependencies

thheller20:03:41

again ... lein handles that 😛

thheller20:03:16

all shadow-cljs does is lein with-profiles +cljs run -m shadow.cljs.devtools.cli ...

thheller20:03:30

so whatever you configure in project.clj will apply but it has nothing to do with shadow-cljs

awb9921:03:32

I get it.

awb9921:03:54

So basically shadow-cljs is not parsing project.clj but instead will get the dependencies for the profile from leiningen.

lilactown21:03:10

yeah, leiningen will be used to get dependencies and start the shadow-cljs application

knubie22:03:22

Trying to compile a release build targeting react native, but getting this error when compiling a release build (the regex seems to work fine in the emulator). Is there anyway of getting around this?

thheller23:03:47

never seen that error before. can't even tell where its from because there is no context/stacktrace

knubie23:03:24

@thheller Maybe comes from the google closure compiler?

knubie23:03:39

More context

thheller23:03:45

you can try :compiler-options {:output-feature-set :ecmascript-next}. that will basically not make it transpile anything.