This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-01
Channels
- # admin-announcements (3)
- # beginners (25)
- # boot (21)
- # cider (39)
- # cljs-dev (86)
- # cljsrn (20)
- # clojars (4)
- # clojure (70)
- # clojure-canada (1)
- # clojure-greece (101)
- # clojure-poland (16)
- # clojure-russia (35)
- # clojure-spec (202)
- # clojure-uk (24)
- # clojurescript (69)
- # cursive (23)
- # datomic (34)
- # devcards (7)
- # dirac (5)
- # editors (3)
- # emacs (6)
- # events (1)
- # hoplon (52)
- # instaparse (1)
- # jobs (4)
- # jvm (2)
- # lein-figwheel (2)
- # leiningen (10)
- # luminus (2)
- # mount (1)
- # off-topic (12)
- # om (55)
- # om-next (8)
- # onyx (19)
- # pedestal (4)
- # planck (1)
- # re-frame (27)
- # reagent (5)
- # remote-jobs (1)
- # spirituality-ethics (14)
- # tmp-json-parsing (6)
- # untangled (121)
- # yada (32)
got it working - I was missing accountant
that my other project had - see latest commit on above repo
@richiardiandrea and @tomek: I've now read http://lambdax.io/blog/posts/2015-12-21-cljs-replumb-require.html but alas I am more confused than ever. From @richiardiandrea 's comment that "you need to provide a file in your :src-paths
" I looked and found what appear to be specifications for :src-paths
in /env/dev/cljs/cljs_repl_web/config.cljs
and in /env/prod/cljs/cljs_repl_web/config.cljs
. Should I change one or both of these? And to what? And where should I put my code? My situation again: I have a copy of the
project and can run it on my own server. And I have a function like (defn foo [n] (+ n n))
. When the REPL comes up in the browser I want the user to be able to do (foo 2)
and get 4
. Where can I put my definition for foo
and what else to I have to add to which files to make this definition available in the REPL?
Does anyone know why default-db
in db.cljs
is not a reagent/atom
in the default re-frame template
?
@ashconnor: default-db
is the default *value* put into app-db
on startup
But it is not app-db
itself (so there is no need for it to be a ratom)
Look for the :initialize-db
event handler in handlers.cljs
This is also related: https://github.com/Day8/re-frame/wiki/FAQ#5-how-can-i-inspect-app-db
BTW, there's a #C073DKH9P slack channel herein, which is probably a better place for this disucssion.
Anyone find that plumatic.schema sporadically results in your clojurescript code failing to compile correctly? I keep getting errors with respect to it's defn, defmethod calls which are confusing and go away when I recompile by entering return characters and deleting them. It's very random.
I can't tell for sure if it is plumatic.schema that is causing it, but the code compiles in cljsbuild, but fails on the page
@biscuitpants there are D3 specific links at the bottom of this (more general, overview) page https://github.com/Day8/re-frame/wiki/Using-Stateful-JS-Components
Given the wording of your question, I'd also point out (non clojurescript) https://github.com/esbullington/react-d3
oh thank you @mikethompson! that helps a lot 🙂
Recently started playing with Cljs. Created a cljs reagent proj with lein new reagent-frontend id
. Locally everything is fine. Now I want to get the optimised minified js to deploy.
project.clj contains two profiles dev and prod.
When I run lein with-profile prod cljsbuild once
or even lein with-profile dev cljsbuild once
nothing much happens. It just prints a line, Compiling ClojureScript...
.
Anything I am missing?
it expects ':cljsbuild {:builds {:dev { ... } :prod { ... }}}' in your project.clj, i don't know what the template created for you
I did a lein clean
and tried build. It worked. 😀
The template put :profiles {:dev ... :prod ...}
.
I just released Chestnut 0.13.0-SNAPSHOT. It changes the way cljsbuild
is configured in project.clj
, to discourage people from using profile merging with cljsbuild, which causes issues for Figwheel.
to give it a spin try lein new chestnut foo --snapshot
, and report any problems on Github https://github.com/plexus/chestnut
Morning all, I'm building a webapp with Reagent. For the life of me I can't work out how to get tooltips working with Bootstrap.
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
If I run this in the Chrome JS console and hover over my tooltips they work fine. I'm guessing I need to init the tooltips (which are dynamically generated). My question is where would I do this in Reagent?@crankyadmin: i think you'll need to create a Form-3 reagent component and call the necessary function in :component-did-mount
. See doc: https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-3-a-class-with-life-cycle-methods
Thanks, I'll take a look!
"In my experience, you'll probably use Form-3 components less than 1% of the time" No word of a lie.
@crankyadmin here’s a copy paste from my project:
thanks @mikethompson
@mihaelkonjevic: cool, did not know about .getDOMNode
Has anyone here used cljc files to develop, interact with, and/or test the code that dictates the behavior of your frontend cljs app??
I have done some exploration of this pattern with re-frame, and am starting to get some decent results. I'd like to chat about it, please dm me if it's something you've done or find interesting.
Sigh. Unable to get my own functions to be available in a locally hosted copy of the project at
, I've been trying the workaround of having users cut/paste the definitions into the REPL manually... which works if they do it one at a time, but when I try to group them into blocks surrounded by do
, I get all sorts of failures that I've been running in circles trying to track down. I could avoid rather than solving this if I could figure out where in the project to stick my functions and how to follow @richiardiandrea's advice that "you need to provide a file in your :src-paths
".
how do i use the tagged 1.9 version in the clojurescript github repo? Do i need to use a lein plugin to get it to pull it?
@ericfode: cloning the clojure/clojurescript github repo and running script/build
basically
In dev profile of project.clj, :source-map true
this is the only sourcemap setting I have.
@shot: I think that warning is related “workspaces” feature of Chrome DevTools, it does not necessary mean that your ClojureScript source maps are generated improperly
I would recommend you to make your project work without “workspaces” enabled as a first step
;; Doesn't work as I expect
(go (println (<! (go "foo")))) ; Prints nothing...
;; Works as I expect
(def state (atom nil))
(go (reset! state (<! (go "foo"))))
@state
=> "foo"
I saw David and Corfield putting them in project.main.ns.spec
namespaces (at least for public API specs)
Those on OS X hankering to mess with cljs.spec
but can’t mess with your current dev setup, Planck 1.14 supports it:
brew install planck
…
$ planck -q
cljs.user=> (require '[cljs.spec :as s])
nil
cljs.user=> (s/def ::rocks? #{:cljs})
:cljs.user/rocks?
cljs.user=> (s/valid? ::rocks? :cljs)
true
#WorksOnMyMac 🙂
@mfikes: Thanks! Then my output must be swallowed somewhere between Chrome, the figwheel repl, emacs, etc.
@tjg I tried it with the shipping Node REPL, in Planck, and in Replete. All three printed.
cljsjs has externs for a number of data visualization libraries. Anyone care to recommend one for me. I'm looking for ring/pie charts. I'm currently considering chartjs, maybe dimple. If someone has recently took that route, I'd love to know more.
I just uploaded Figwheel 0.5.4-SNAPSHOT!! With improved error display. Lots of work went into this release https://github.com/bhauman/lein-figwheel/blob/master/CHANGES.md
I would really appreciate folks giving it a try and pinging me if stuff breaks. But I doubt that's gonna happen ...
Is it possible for a node cljs repl to get files from multiple directories?
I'm using lein cljsbuild
My source paths looks as follows: :source-paths ["src/cljs-server" "src/cljs-shared"]
Here is my repl.clj file:
(cljs.repl/repl
(cljs.repl.node/repl-env)
;; :watch ["src/cljs-server" "src/cljs-shared"] ;; <-- this doesn't work
:watch "src/cljs-server"
...)
As you can see, it appears that the :watch
key can only take a single string as an option
i.e. a single directory
Even though a lein cljsbuild
project profile can watch multiple directories
Does anyone know a way around this?