Fork me on GitHub
#figwheel-main
<
2018-08-09
>
athomasoriginal00:08:44

I am using figwheel + yada. Yada is serving my index.html and I am using figwheel for everything else other than serving the index.html. I have configured figwheel as follows:

^{:open-url ""}
{:main web-client.core
 :asset-path ""}
This works as expected. However, I am curious if this is an uncommon way of using figwheel.

bhauman13:08:55

@tkjone You will normally want to configure yada to serve your compiled clojurescript assets because this is what you will be doing in production anyway

athomasoriginal13:08:12

Nice, that is how I wanted to configure it. Is there any additional configuration required in figwheel to make this happen - or is it just telling yada to serve what figwheel builds?

bhauman13:08:30

thats all you have to do, just tell yada to serve the assets

athomasoriginal13:08:24

Clarifying point though: If the application is a SPA, the static assets could live on S3 or some kind of CDN. If this is how production flows, would you still configure the development process to have yada serve the assets...as in this case, yada would not be doing this in production, yes?

bhauman14:08:07

no not neccessarily in that case

onetom14:08:09

im just going thru http://figwheel.org now and i saw homebrew being the only way mentioned to get clojure on macOS. i would highly recommend mentioning the Nix package manager too, since it works more predictably the same way on macOS and any Linux and does not pollute or conflict with the user's global environment in any way. @bhauman have you ever tried Nix or NixOS? what's your main development OS, btw?

onetom14:08:15

i've written 2 very short intro blog posts about Nix recently and used clojure as one of the examples in them too: 1. https://blog.enuma.io/update/2018/07/12/nix-in-practice.html 2. https://blog.enuma.io/update/2018/07/31/nix-markdown-pdf-svg.html

onetom14:08:31

and here is an actual, real project with a pinned down version of clojure (and all its dependencies): https://github.com/enumatech/cljs-abi-viewer/blob/master/shell.nix

onetom15:08:28

the most beautiful part of nix is that you can just get an ephemeral shell with the declared dependencies available and after you quit the shell they are virtually gone; won't interfere with the rest of the system. just run:

nix-shell -p clojure
or maybe if you use a different shell, like we do, then
nix-shell -p clojure  --run fish
for example

onetom15:08:23

and if you don't want your external system bleed into your ephemeral environment, then you can say

nix-shell -p clojure fish --pure --run fish
this way you can make sure that anything you do in this shell won't depend on your local installation, hence will be reproducible on any other machine, with the same command line

4
dottedmag15:08:41

@onetom You'll have to start from https://clojure.org/guides/getting_started — good luck preaching Nix to core team.

onetom00:08:02

That's a harder problem to solve, that's why I wouldn't start there.

alvina18:08:09

guile scheme's guix package manager is also awesome, could be perfect match for clojure

onetom00:08:17

since it's based on nix, of course it's great, but nix is a lot more practical, since it allows to share installation instructions for developers between macOS and any Linux distribution. also according to wikipedia: > GNU Guix (/ɡiːks/[2]) is a package manager. It is based on the Nix package manager with Guile Scheme APIs and specializes in providing exclusively free software. Nix provides non-free software also, if you opt-in.

alvina08:08:26

As both share same API, so both can do same work. how come nix is more practical to clojurian, most of us already know scheme form SICP ?

richiardiandrea19:08:36

@bhauman sometimes rebel does not show up with:

{com.bhauman/figwheel-main {:mvn/version "0.1.6-SNAPSHOT"}
                  com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}}

richiardiandrea19:08:49

do you know what can be? do I need to use SNAPSHOT?

richiardiandrea19:08:17

oh I had another clj terminal open...in the same folder..maybe it got confused

bhauman22:08:36

@richiardiandrea it should show up everytime that its able to be required, sounds like you had a classpath problem of some sort

richiardiandrea22:08:20

yep it was weird, I had launched a clj in one terminal and then a figwheel-main REPL with rebel in another one

bhauman22:08:02

maybe clj cached the paths in a way that conflicted? but I don't see how that could happen

richiardiandrea22:08:45

well...yeah...I do not know but for sure there is some caching going on there

bhauman23:08:12

@onetom thanks for the info I just read your first blog post, Nix looks good, I'd have to use it a while before I could really suggest it in earnest.

onetom00:08:47

Of course you should try it first! 🙂 So I guess it means your main development OS is macOS than and that's why you are recommending brew install clojure or you just echoed what the clojure guide say about macOS installation?

bhauman12:08:26

Yes both are true, I link to the getting started instructions and then inlined instructions for MacOS as it doesn't work on Windows yet.