Fork me on GitHub
#figwheel-main
<
2019-01-14
>
Macroz06:01:30

Hi, does anyone have an example of Figwheel Main on Nodejs with some external deps like e.g. Express? I got the very basic stuff working like repl in Cider but using Node deps eludes me so far and the webpack + npm tutorial seems a little complicated.

Macroz06:01:31

Btw. I'm using Linux and nvm for node and seems I have to specify node-command though ts in my path

Macroz06:01:50

Also Cider suggests a config like :dev but obviously they are named just dev, test et by the template. It also gives a very confusing error message

Macroz06:01:31

I can see if there is something I can contribute to these two.

grumplet11:01:11

Is it possible to configure compiler options for lein fig:min? I want to add an externs.js file.

jaide17:01:35

@grumplet My understanding is that <build-id>.cljs.edn files, such as dev.cljs.edn are where you put compiler options.

grumplet17:01:12

@jayzawrotny Thanks - will try.

Karol Wójcik19:01:03

I’m trying to use npm-deps feature but I fail. Is there some tutorial or blog which describes the process of integrating 3rd party library based on react?

^{:watch-dirs ["test" "src"]
  :css-dirs ["resources/public/css"]
  :auto-testing true}
{:main some-example.core
 :npm-deps {"react-text-loop" "2.0.1"}
 :verbose true
 :install-deps true}
As I can see cljs_deps.js does not contain the dependency react-text-loop but cljs$node_modules.js does.

kwladyka19:01:54

Let me know if you have any questions

Karol Wójcik19:01:38

Seems very self explanatory to me 😄

👍 5
Karol Wójcik19:01:13

Does it work perfectly fine with the advanced compilation?

kwladyka19:01:29

sure, look at output of this repo (in readme of this repo)

kwladyka19:01:03

of course it is not optimised in the same way as clourescript is

kwladyka19:01:14

but there is no way to do it better AFAIK

Karol Wójcik19:01:38

Seems legit to me! Thank you very much!

🍻 5
kwladyka19:01:40

BTW I will appreciate feedback about this module (look at master branch) 😉 I did it, but I have issue about make it popular, because I am not famous 😛

kwladyka19:01:17

It is more useful for people as example of fighweel-main, than for what was my intention trollface

Karol Wójcik19:01:49

Got a one question. about this one. What if rum requires react? Doesn’t the compilation will include react both times?

Karol Wójcik19:01:21

you excluded cljsjs/react and react-dom

Karol Wójcik19:01:25

You’re smart guy!

jaide22:01:48

@kwladyka I’m looking at your form-validator repo for your recommendation on handling npm deps. So you need to run npm add xyz and npm install before building it will work right?