This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-12
Channels
- # bangalore-clj (4)
- # beginners (40)
- # boot (53)
- # cider (34)
- # cljs-dev (9)
- # cljsrn (11)
- # clojure (113)
- # clojure-boston (5)
- # clojure-dev (9)
- # clojure-dusseldorf (4)
- # clojure-russia (8)
- # clojure-spec (11)
- # clojure-uk (12)
- # clojurescript (88)
- # cloverage (17)
- # conf-proposals (4)
- # core-async (30)
- # cursive (9)
- # datomic (107)
- # euroclojure (5)
- # hoplon (196)
- # luminus (10)
- # off-topic (20)
- # om (24)
- # om-next (1)
- # onyx (80)
- # parinfer (3)
- # pedestal (16)
- # planck (44)
- # proton (8)
- # protorepl (1)
- # re-frame (19)
- # reagent (7)
- # spacemacs (2)
- # untangled (29)
- # yada (25)
with the new clojurescript spec, I can't use float?
as a predicate. What should I use in it's place?
@dnolen: when sending stuff to the backend, via edn/read-string, etc... might be a chance that the JS double becomes an integer. So if require a float on backend...might have to ensure on JS side that any numbers that look like an integer, dont continue to look like an integer over EDN etc...???
so i have a spec that is checked on JS side to ensure numbers dont look like integers and thus get converted to integers.
if you want to communicate floats from a JS environment better to be explicit about it by wrapping it in a tagged value or using Google’s floating point types
still we do need more feedback about cljs.spec and numerics, I’ve punted on making hard choices for now - open to hearing more ideas
@dnolen: cool, just starting to use it for that... I'll look into what you suggested about : "wrapping it in a tagged value or using Google’s floating point types" haven't used them before. Thanks as usual!! 🙂
i use chestnut, and i’m looking through the compiler options and im not sure what i should be looking for
@krchia: If you're using the current chestnut template, lein cljsbuild once min
should output an :advanced
optimizations js file to your resources/public/js/compiled
folder.
@krchia: the Quick Start covers the basic compiler options btw, might be worth reading through
@krchia: chestnut also has its own forum/mailing list. You're welcome to ask questions there, we'll be happy to help you
i think this was a most embarassing omission on my part to fail to read the quick start - but i am glad for the generous offer of help 🙂
@krchia: you’ll grow past at it pretty quick but it really it’s a 30 minute investment to avoid head scratchers down the road
most of the tools are much friendlier than the raw compiler, but when you’re in a bind understanding how the compiler works can help
@plexus: not sure if this is a chestnut thing, but i couldn’t get my app to output the min file
so i tried with a fresh chestnut build - i get the same errors as well, which is "ClojureScript could not load :main, did you forget to specify :asset-path?"
That sounds like it might actually be using : optimizations :none
, which means it will output one file for each namespace instead of one big concatenated one
It should work, although I rarely test it that way. The main usecase we focus on is building an uberjar, which will include a fully concatenated optimizated js file
lein new chestnut minitest
cd minitest
lein cljsbuild once min
firefox resources/public/index.html
that with-profile
command is outdated, I'll update the FAQ, lein cljsbuild once min
should do the trick
yeah this should be documented a bit better in the readme, before we had (IIRC) just a single ClojureScript build configured and relied on profile merging, hence the advice to use with-profile
now we have three builds with their own ids, "app", "test", and "min", when doing lein cljsbuild once
it tries to build all three, but it's missing some test dependencies so the second one fails... this isn't great, we should probably move that test build into the test profile
if you use :optimizations :none
then it spits out dozens of individual files, one for each namesapce. when your app boots it tries to load all the necessary namespaces, but it doesn't necessarily know where those files are, what URLs they have
I guess doo
(the ClojureScript test runner we use) doesn't have that problem though, cause it seems to work fine without :asset-path
don't know if the above makes sense... working your way through the Quick Start would probably make this more clear
(I also did a Lambda Island episode about the ClojureScript Compiler that explains these things in detail, let me know if your trial expired I'm happy to renew it https://lambdaisland.com/episodes/clojurescript-compiler)
@krchia: looking at it again I think we have some usability issues when using cljsbuild directly. This hasn't come up before because people mainly use Figwheel+Uberjar. I documented the issue here: https://github.com/plexus/chestnut/issues/177 will need some thinking how to address it. I think you ran into the last issue where a previous "app" build was standing in the way of doing a proper "min" build
ClojureScript 1.9.198 released https://groups.google.com/d/msg/clojurescript/a7KnSSwJsbk/MWMs9yZlCwAJ
@plexus: i’m not too familiar with uberjar - might you suggest a good resource like quick start for cljsbuild?
Cljsbuild is just a thin wrapper around the clojurescript compiler, the clojurescript quick start + cljsbuild readme is probably enough for that
Uberjar is a leiningen feature, don't know if there's much documentation for it. It compiles all your code, and bundles it with all dependencies into a single "jar" file (java archive)
So you can just copy that one file to a server to deploy your app. In chestnut we hook into that process to also compile clojurescript and put it into the jar
latest version looks great, especially the implicit macro loading and autoaliasing clojure namespaces. thanks all
great summary by @mfikes of the latest enhancements https://twitter.com/mfikes/status/764213116892774400
awesome job on this!