This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-09
Channels
- # beginners (91)
- # boot (5)
- # cider (30)
- # clara (16)
- # cljsjs (3)
- # cljsrn (6)
- # clojure (84)
- # clojure-dev (4)
- # clojure-dusseldorf (1)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-uk (120)
- # clojurescript (54)
- # core-async (25)
- # core-matrix (1)
- # css (2)
- # cursive (20)
- # datomic (28)
- # editors (11)
- # emacs (6)
- # figwheel (4)
- # figwheel-main (28)
- # fulcro (36)
- # graphql (7)
- # hyperfiddle (2)
- # jobs (6)
- # jobs-discuss (10)
- # lambdaisland (1)
- # lumo (3)
- # nrepl (20)
- # off-topic (24)
- # pedestal (2)
- # protorepl (3)
- # reagent (3)
- # reitit (2)
- # remote-jobs (1)
- # ring-swagger (26)
- # rum (1)
- # shadow-cljs (247)
- # spacemacs (29)
- # tools-deps (12)
- # vim (15)
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.@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
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?
Thanks @bhauman!
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?
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?
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
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
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 exampleand 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@onetom You'll have to start from https://clojure.org/guides/getting_started — good luck preaching Nix to core team.
guile scheme's guix package manager is also awesome, could be perfect match for clojure
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.
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 ?
@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"}}
do you know what can be? do I need to use SNAPSHOT?
oh I had another clj
terminal open...in the same folder..maybe it got confused
@richiardiandrea it should show up everytime that its able to be required, sounds like you had a classpath problem of some sort
yep it was weird, I had launched a clj
in one terminal and then a figwheel-main
REPL with rebel in another one
maybe clj cached the paths in a way that conflicted? but I don't see how that could happen
well...yeah...I do not know but for sure there is some caching going on there
@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.