This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-05
Channels
- # admin-announcements (2)
- # beginners (20)
- # boot (13)
- # cider (36)
- # cljs-dev (11)
- # clojure (31)
- # clojure-berlin (3)
- # clojure-czech (2)
- # clojure-dev (2)
- # clojure-japan (9)
- # clojure-russia (16)
- # clojurebridge (3)
- # clojurescript (182)
- # cursive (8)
- # datascript (2)
- # datomic (35)
- # editors (33)
- # hoplon (18)
- # ldnclj (11)
- # off-topic (6)
- # re-frame (3)
- # reagent (39)
Ok, so I moved the project templates right under tutorials and included a link to it in the sidebar under additional information. And deleted the page I previously created, since it would be redundant. Hope that’s ok.
I went ahead and a added a new section right after the templates called “Getting Help” which includes links to IRC/Slack and the mailing lists.
somebody needs to do this for ClojureScript https://github.com/servant-app/JAWS
Can anyone with experience migrating cljx to cljc (1.7) advise on what’s wrong with the this?
(ns garden.util
"Utility functions used by Garden."
#+clj
(:refer-clojure :exclude [format])
(:require
[clojure.string :as string]
[garden.types :as t]
#+cljs [goog.string]
#+cljs [goog.string.format])
#+clj
(:import garden.types.CSSAtRule))
(ns garden.util
"Utility functions used by Garden."
#?(:clj
(:refer-clojure :exclude [format])
(:require
[clojure.string :as str]
[garden.types :as t])
(:import garden.types.CSSAtRule))
#?(:cljs
(:require
[goog.string]
[goog.string.format])))
clojure.lang.ExceptionInfo: Feature should be a keyword: (:require [clojure.string :as str] [garden.types :as t]) {:type :reader-exception, :line 7, :column 28,
I solved it: looks like you have to pass a single form and not multiple forms to each literal
(ns garden.util
"Utility functions used by Garden."
#?(:clj
(:refer-clojure :exclude [format]))
#?(:clj
(:require
[clojure.string :as str]
[garden.types :as t]))
#?(:clj
(:import garden.types.CSSAtRule))
#?(:cljs
(:require
[goog.string]
[goog.string.format])))
Now that ClojureScript can compile itself, will browser-repl behaviour change in figwheel or boot? I.e. no more (start-repl)
?
Can anyone tell me why someone would want to break up a task that would fit into one component -- into many components? And use core.async instead of just using 'this' in render_state and not having to do any communication? https://github.com/jackschaedler/goya/blob/master/src/cljs/goya/components/palette.cljs
@andrewmcveigh: another cljs-time question for you
@exitcode0: Maintainability, mainly? If changes had to be made to some smaller part of the application you can change the components that are children of the main component without having to change the overall app representation. If each component is separated by a channel, there's a clear separation between what they represent and how they can change the app.
@andrewmcveigh: i’m getting different values between :none and :advanced optimisation (with pseudonames) output. :none: #object[Object 20150705]
:advanced #object[$goog$date$Date$$ 1436047200000]
You could write one large component and operate directly on the state but then every component owns its lifecycle, how it represents data, and how it changes data. This would likely get more difficult to maintain over time.
@robert-stuttaford: Do you think you could raise a github issue? Don’t have time to look at it right now.
sure thing. i think i know why we’re struggling. we’re base64 encoding so that we can put it on the querystring along with some other stuff
Thanks, busy day today 😕
@exitcode0: Also goya was written before reference cursors existed in om, so they used a bunch of channels to process messages from each component.
@angusiguess: I am looking at a 75 line long component with a 64 line long render function (http://pastebin.com/Sy4hL8Fg)
would the added lines and complexity with channels and division among components, in your opinion, be worthwhile in my situation?
@shaunlebron: if you need me to make adjustments to Figwheel for your book, then those adjustments are probably good for everyone, feel free to make an issue or send pull requests.
@shaunlebron: I'm sailing for the week so I'm a bit out of touch. So much is happening!! It's awesome!
@bhauman: thanks, I don’t quite know the appropriate questions to be asking, but they have to do with integrating figwheel with the quick start build scripts somehow. haven’t looked at figwheel source in a while
I’ll make a note to check that out
@bhauman: enjoy sailing!
@dnolen: I wanted to make a note about the earmuffs naming convention. I noticed that cljs.js/*loaded*
cljs.core/*unchecked-if*
cljs.core/*main-cli-fn*
cljs.core/*clojurescript-version*
are not dynamic vars. Should I say it’s a special global var naming convention sometimes?
@shaunlebron: there will always be exceptions to the rule but I would not explain this subtlety to a new user
it’s telling that all the real examples you listed above are all more less private except for *clojurescript-version*
yeah, I won’t be explaining that for new users, will just make a note of the exception for completeness in the reference docs
thanks
@shaunlebron: also for consistency it probably makes sense to mark the ones we can as ^:dynamic
there’s really no good reason that they aren’t.
@sisawat: haven’t read through this yet, but @escherize told me good things about re-frame: https://github.com/Day8/re-frame
@sisawat: keep your eye on Om Next too
Hi everyone ! I am porting a ClojureScript project from 0.0-3308 to 1.7.28 but my project do not compile because I use cljs.repl/source
is there an obvious reason or do I have to dig ? Thank you for your help
We have a ruby app with a fairly rich API, and a rebranding task ahead of us and we just lost three devs, so I see some opportunity here.
@sisawat: can be hard to sell, but we’re working on making that easier with a central site
@hmadelaine: yeah, (cljs.repl/source +)
runs fine on 0.0-3308, but dumps an exception on 1.7.28
@shaunlebron: Ok so I am not alone in the dark 😉 Thanks
that’s one worth filing an issue
filed, will probably cut a release for any other regressions like that may have cropped up
thanks @dnolen I am going to watch this one
@sisawat: I've had success with adoption by showing people reagent + reagent-cookbook.
@sisawat: would advise taking a look at re-frame too, its readme was what convinced the other dev I’m working with to get into the clojurescript bandwagon
yeah, @jhchabran - that readme changed my life
ohh me too! @jhchabran
@jhchabran: yeah was reading that
@sisawat: anyone that had coded UIs has at some point experienced some major pain dealing with state and cluttered code resulting from its poor management, while om/reagent already address these, re-frame’s README really takes time to take you by the hand and walk through it carefully
especially since it helps structuring your app, which is what I personally felt a bit daunting when I got started
The awesome thing about re-frame’s README, is that it not only explains the why
in a very approachable manner, but it also shows the how
.
I would love to hear about your experience when you do @jhchabran
I haven’t worked with datascript, but I would imagine it would be similar to fetching data via xhr. It is basically something external that a dispatch
could invoke….
but then again, I have 0 experience with datascript, but that is how I would try approaching it if I had to..
That was my thought as well, my problem was that re-frame likes to deref the reference to my datascript db when it passes it to the handler
I tried having the datascript atom just be an atom in the db namespace with a global reference… but that kinda feels like i’m missing the point...
I guess you have seen this https://gist.github.com/allgress/11348685
@dnolen: RE: ^:dynamic
labelling, I think there are just cases where earmuffed vars are just things that can be set!
, like *main-cli-fn*
in https://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs
I just think that labeling them as dynamic would miscommunicate the intention
I don’t have much experience with them though
@shaunlebron: that’s valid too, it’s a minor thing really
@dialelo: Not right now.. but I have done some experiments in the past with http://cljsfiddle.net. It desperately needs updating with the latest cljs features (including self-hosting)
@niwinz and i want to start a blog to write articles about CLJS that complement the book
The issue is that the .startDrag function never gets called so the object always shunts itself off to the top left...
unzip a JAR inside the browser https://gildas-lormeau.github.io/zip.js/, this plus bootstrapped ClojureScript - minds will be blown
@tomayerst: If I recall correctly the .startDrag
event works for nodes that have a goog.fx
attached to them. try simple goog.events.EventType.MOUSEMOVE
and MOUSEUP
maybe this will help, even if it's for om: https://github.com/bensu/zortable/blob/master/src/zortable/core.cljs#L227
I’m really exited about self-hosted cljs, mostly for what I assume will be a huge compile-time speedup. What I don’t have a good grasp on is what the state-of-the-art tooling is. I mean, I use lein-cljsbuild now (I have to compilation targets with a bunch of shared code, which doesn’t seem to be a great fit for lein-cljsbuild anyway), and I’m not sure what to replace it with in Node-hosted land. I understand that 1.7 is hot off the press, so maybe the answer is, “Dude, it’s coming! Be patient!”, but if that’s not true, I’d love to hear about the alternatives. I’m also happy to contribute, but I’m not even sure what to contribute to. So what’s the lay of the land?
@isaac_cambron: it’s significant compile time slow down not speed up
JS engines are consistently 1.5-3X slower than the JVM even after lots of hand tuning by yours truly
@dnolen … and then 20 years later we’re back to deploying apps on the web via jars (and not quite the way Sun had in mind…)
replacing the existing tooling for the traditional use case makes no sense at all to me
Hmm, OK. I guess there are two things that are slow: 1. process start-up time, 2. actual compilation time. I sort of combat 1 with :auto
but I restart the process enough that it’s sort of a painful workflow. Sounds like the self-hosted option doesn’t help with 2, but perhaps it helps with 1?
@isaac_cambron: you are right. node has faster startup times and consumes less memory than the JVM. If you are restarting the process a lot due to "bad-state" and not some other build step, you should consider changing your compiler options or using cljs.build.api
without cljsbuild
regardless, today cljs tooling is centered around the JVM, and using node would require lots of rewrite/adaption.
@isaac_cambron: lein adds considerable amounts of overhead to any workflow, you can gain a lot just by dropping it and using a custom build script.
also ClojureScript is available in AOT, which cuts out like 4 seconds of compile time.
@isaac_cambron: one my work machine doing this means recompilation starts in around 1.5s instead 7-10 or whatever
writing a custom build script sounds to using the jvm-based compiler sounds like the thing to do
for larger projects restarted build still need to read analysis caches, been pondering that - likely will involve something around transit encoding
i guess my hesitancy is that, greedily, I also want the :auto
-style watch stuff, and that seemed complicated to implement. maybe if restarting is fast enough, it doesn’t matter
by doing that you’ll see if you’re doing something weird like including tests on your classpath all the time or using an optimization setting when you shouldn't
good tip, i’ll definitely do that
@isaac_cambron: ClojureScript has had built in watch support for months now
oh neat. see, that’s the stuff i don’t know
the only thing lein-cljsbuild really does anymore is add the convenience of configuration inside your project.clj
ok, yeah, i should go read up on just using the straight-up tools
with @maria’s work on including arbitrary JS transforms getting this into a declarative form inside project.clj will probably be more trouble than it’s worth
@isaac_cambron: yes! read the QuickStart! (that is always the response )
@dnolen: Is theres something i can do to make core.match more cljc friendly? In particular, i want to define a macro which expands to use core match, but i want to use that macro from both clj and cljs
my cold-start compile is 45 seconds. my watch compile is 11 seconds. i definitely feel like I could improve that
(without having to write separate macros and infect every consuming ns w/ two conditional requries)
ok, thanks for the help!
@isaac_cambron: that seems really, really long to me. how fast is your machine? I would definitely recommend turning on :verbose true
to figure out what’s going on
it’s a modern macbook pro, but i’m running the compiler inside a docker container inside a VM, so…i’m not sure
but the project isn’t like huge or anything
@dnolen: cljc match, is it a matter of smashing the namespaces into one cljc file, or of producing an cljc api file that conditionally consumes the relevant namespaces?
so yeah, i’ll try :verbose
@isaac_cambron: huh, not sure why you need docker for JVM stuff, but perhaps you have your reasons
@isaac_cambron: ok, just sounds like a really complicated setup to me, will definitely introduce it’s own overheads
well, i still try to optimize the things i can
@isaac_cambron: other thing is to make sure you giving the JVM plenty of ram, anything less than 1gb is a bad idea - for advanced compilation 2gb
@dnolen: Yeah, it has that and more
I’ll check out :verbose
, run it bare-metal so I can apple-to-apples, try ripping out lein, etc.
If I still have bad perf, I’ll come back and ask more
thanks again!
@dnolen: also worth noting, core.match in cljs mucks up source maps - presumably due to metadata handling in the macro
Clojure/conj 2015 (http://clojure-conj.org) will be held in Philadelphia, PA from Nov 16-18! The Clojure/conj 2015 CFP is now accepting talks until August 14th - topics may include experience reports, language usage, tools, libraries, or other creative uses. https://cognitect.wufoo.com/forms/clojureconj-2015-call-for-presentations/ Talks will be 40 minutes in length. All speakers receive a conference ticket, up to 4 nights lodging at the conference hotel () and airfare stipend (U.S. airfare or up to $550 international). If you have questions or want feedback prior to submitting, please contact <mailto:[email protected]|[email protected]>.
I need to plan my year better so I can make it to the conj or clojure west next year. Will miss it by a month this year.
@noisesmith: Did it say anything about doing brew update
to update formulas?
oh that reminds me I was going to install planck on the osx work machine
(Sorry for the summoning @noisesmith 😞 )
@hmadelaine: the above includes the fix to cljs.repl/source