This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-26
Channels
- # admin-announcements (33)
- # beginners (41)
- # boot (97)
- # clojure (220)
- # clojure-berlin (3)
- # clojure-russia (31)
- # clojure-sg (3)
- # clojurebridge (2)
- # clojurescript (137)
- # clojutre (13)
- # core-matrix (10)
- # core-typed (1)
- # cursive (18)
- # datascript (1)
- # datomic (93)
- # devops (6)
- # editors (18)
- # emacs (1)
- # funcool (43)
- # hoplon (4)
- # immutant (6)
- # instaparse (3)
- # jobs (25)
- # ldnclj (14)
- # ldnproclodo (4)
- # off-topic (20)
- # om (21)
- # rdf (79)
- # re-frame (14)
- # reagent (12)
- # ring-swagger (18)
- # yada (52)
@petrus if you really need a particualr component, my suggestion is .... take the CSS from an existing component (assuming licence allows) and then replace the existing js with reagent/cljs. The look and feel of these things is often the challenging bit. The component's actual logic is typically not that hard (ie. the cljs is not that hard). And the existing js implementation acts as a pretty good spec.
Then, when you are done .... donate your component to re-com (assuming MIT licence)
i wonder if it's possible to use bits of re-com. for example if i only need a dropdown with filtering. the code seems very modular and nice.
If you do advanced compilation you could just add it? it will remove all non used code anyway
@shem yeah we went to some trouble to structure re-com so that advanced compilation could do significant dead code elimination
ok, good to know. we want to serve mobile users as well. if we only use certain components from re-com, say dropdowns, would this mean trouble with mobile users?
As we make clear in the re-com readme, we don't do any work with mobile
It probably works just fine, but I wouldn't like to give assurances
You'll have to experiement ... and then report back
--------------
While I remember it ... for those that have joined recently ...
Here is a useful debugging tip I picked up from @escherize ...
When you are debugging a reagent view ... and particularly the value coming through in a cursor or subscription (re-frame) or props ...
... add something like this to the hiccup in your view ...
[:pre (with-out-str (pprint @some-ratom))]
;; assuming that @some-ratom
is the value you want to observe
You don't even have to use pprint, you could just do this:
[:pre (pr-str @some-ratom)]
If you do use pprint
then you'll need to require it in at the top of your view.cljs
:
[cljs.pprint :refer [pprint]]
Further note: the advanced version of this technique is to not use pr-str
or pprint
but instead to use @yogthos' excellent json-html library: https://github.com/yogthos/json-html for an even more carefully arranged display.