This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-18
Channels
- # admin-announcements (90)
- # alda (1)
- # aws (23)
- # beginners (60)
- # boot (217)
- # cljs-dev (20)
- # cljsjs (23)
- # cljsrn (85)
- # clojars (28)
- # clojure (101)
- # clojure-art (1)
- # clojure-berlin (10)
- # clojure-dev (16)
- # clojure-my (2)
- # clojure-russia (194)
- # clojure-sg (7)
- # clojure-ukraine (1)
- # clojured (1)
- # clojurescript (99)
- # clojurex (1)
- # community-development (6)
- # core-matrix (11)
- # cursive (26)
- # datomic (51)
- # euroclojure (30)
- # hoplon (560)
- # jobs (44)
- # ldnclj (34)
- # mount (23)
- # music (3)
- # off-topic (10)
- # om (145)
- # onyx (3)
- # perun (38)
- # portland-or (2)
- # proton (55)
- # re-frame (64)
- # reagent (26)
- # ring-swagger (3)
- # spacemacs (21)
- # sydney (3)
- # yada (1)
i think im setting up a handler correctly but it doesn't seem to be correct, and trying to simply see the current state of my db is leading me down a rabbit hole š
@samueldev: these links (to the Wiki) will help https://github.com/Day8/re-frame/wiki/FAQ#5-how-can-i-inspect-app-db https://github.com/Day8/re-frame/wiki/Debugging Remember there is also a #C073DKH9P channel
@samueldev: https://github.com/binaryage/cljs-devtools might also be helpful, especially when you print big datastructures in chrome consle
hi guys, what is the correct way to use this in nested react component
(column
#js {:header (cell #js {:children ["test"]})
:cell (custom-cell {:data table-test
:index js/this.props.index ;; << this is not correct
:col :first})
:width 100})
I'm trying to integrate the fixed data table to clojurescript. The current one on cljsjs is a bit outdated.
and I create plain javascript element like so
(def table (js/React.createFactory js/FixedDataTable.Table))
(def column (js/React.createFactory js/FixedDataTable.Column))
(def cell (js/React.createFactory js/FixedDataTable.Cell))
(def column-group (js/React.createFactory js/FixedDataTable.ColumnGroup))
I don't use om.next, but in general - something.props.index
translates to (.. something -props -index)
or (-> jomething (oget "props") (oget "index"))
The question is how would you access the component (`this` in your example) and that's wrapper-specific usually.
So (.. this -props -index)
or (-> this (oget "props") (oget "index"))
should probably work
Also, forgot to mention, by oget
I refer to goog.object.get
that for some inexplicable reason isn't imported by default : V
I even find the example from fixed data table a bit weird. Maybe you can have another look: https://github.com/facebook/fixed-data-table/blob/master/examples/FilterExample.js
the TextCell doesn't have any props called rowIndex passed through. Where does it get it ?
https://github.com/facebook/fixed-data-table/blob/master/src/FixedDataTableRowBuffer.js seems to generate it as far as I can tell.
ah yeah I seem to find a way. It was that the cell passed in should be a function and its parameter is generated like we discuss above. Then we can create custom cell from it
(column #js {:cell (fn [x] ;; << we have rowIndex here
(cel ...))
This seems to be consistent with this example here - https://github.com/facebook/fixed-data-table#basic-example
Specifically this:
<Column
header={<Cell>Col 3</Cell>}
cell={({rowIndex, ...props}) => (
<Cell {...props}>
Data for column 3: {rows[rowIndex][2]}
</Cell>
)}
width={2000}
/>
having some cider/figwheel issues
Iāve been following instructions here (https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#setting-up-cider), starting from the standard lein new reagent
template
but when I call figwheel-sidecar.repl-api/start-figwheel!
, I just get a 404 page when I go to localhost:3449
and the repl never connects
anyone else ever had that kind of problem? Googling doesnāt give me anything useful (although there was an old GH issue with a similar thing reported by a Cursive user)
@tragiclifestories: I probably had the same issue (or more likely set things up without (at least without me knowing) the Cursive REPL). You won't suffer any lack of productivity by not having everything in Cursive. Cursive is good for editing and managing the project files. (And probably many other things). With Figwheel development you might find you don't need the REPL that much anyway, whether it is in or outside of Cursive.
Iām actually having the issue with emacs & cider
it just happens to be completely identical to the issue raised by the cursive user above
Iāve probably messed the same thing up, but since the issue was closed without further comment (presumably because he/she worked it out), Iām a little in the dark
My experience has been that with Figwheel (and devcards too if you like) the REPL becomes less important - you don't really need it - I certainly don't use it anyway.
fair enough
Iām doing a clojure demo at work tomorrow, so was hoping to trigger a js/alert from the editor for a cheap āwowā moment
serious software engineering right here
but I can do it from figwheel command line well enough
Iām missing being able to set a breakpoint and debugging the stackframe, but at least when I have some state in an atom, I can plauy around with it from the figwheel repl
I got out of memory errors last time tried to use REPL in Cursive. I'm sure it is great - anything better than what I have now with a REPL from Windows console. One day I'll try it and it will work (and by then I'll be on a Linux machine so it most certainly will work I would hope).
My workflow is apparently very different: I use the REPL all the time with ClojureScript and Figwheel.
Hi, Iām writing code for Clojure and ClojureScript and as it looks because of http://dev.clojure.org/jira/browse/CLJS-324 I cannot write simple (format āHello %sā āworldā)
Is there any other functions that can do simple formatting which is available on both platforms?
(str āHello ā āworld)
is kinda ugly if big strings is involved
@artemyarulin: there is not a shared thing, you can use goog.string.format
@grav: breakpoint and stackframe debugging should be addressed by dirac, Iām also a Cursive user, later I want to integrate āshared nREPL sessionā mode there, where your interaction with nREPL session in cursive would be echoed into Diracās REPL. That way you could for example send forms from Cursive to evaluation into nREPL and they would appear in Dirac DevTools (in addition to your Cursive REPL)
@dnolen: Thanks, Iāll check this one
@artemyarulin there is also https://funcool.github.io/cuerdas/latest/#format which works with clj/cljs . Never used it myself.
@minimal: Thanks. For now I decided to go with simple (clojure.string/replace "Hello {0}" #"\{0\}" "worldā)
. If it wouldnāt be enough then Iāll use/require something else
hi all. any recommendations for image dropzone or fileupload components in clojurescript?
btking: i found only this: https://github.com/yogthos/yuggoth/blob/master/src-cljs/yuggoth/pages/upload.cljs
@ rm, @btking I was just playing with that recently with cljs-ajax and the following works pretty well:
@artemyarulin: I use cl-format
, a port of the immensely powerful Common Lisp format
function. For some strange reason, it's found in the clojure.pprint
/ cljs.pprint
namespace.
It's a remarkably complete mini-language for formatted output. Here's a good intro (for Common Lisp, but everything should work equally well in Clojure with a few obvious modifications):
@tord: Thanks! Iāll have a look
@artemyarulin: I would be careful with cljs.pprint
- I believe it may have advanced compilation issues
http://google.github.io/closure-library/api/class_goog_events_FileDropHandler.html
Also I've made this once which uploads straight to S3 https://github.com/martinklepsch/s3-beam
@rm: google closure?
@rm: I think it's too big to really "know it well" in every aspect. but generally when I have some non-trivial JS thing to do I look there for helpers etc
things usually have descriptive names so just searching their api docs turns up useful stuff most of the time
@rm There's also a book that might help (it's available on Safari Books as well) http://shop.oreilly.com/product/0636920001416.do
I started working on a library based on all the useful things in Google Closure but never finished it and some of my ideas are likely not good enough: https://github.com/decomplect/ion/blob/master/src/ion/poly/core.cljs
@dnolen: thanks for the warning
some of what I came up with are pretty handy, I think, such as:
(defn request-animation-frame!
"A delayed callback that pegs to the next animation frame."
[callback]
(.start (goog.async.AnimationDelay. callback)))
When accessing properties/functions/constructors, which is better, (js/foo.bar.baz) or (.. js/foo -bar baz)?
Just using React drag & drop handlers works quite well: https://github.com/metosin/lomakkeet/blob/master/src/cljs/lomakkeet/reagent/filepicker.cljs#L57-L95
@futuro: either is supported, but I would probably avoid the former idiom for anything that isnāt a JS global
@juhoteperi: lomakkeet.core looks very much like something I'm hamock'ing on currently ā whats the purpose of the initial-value
key?
@martinklepsch: To keep track of the previous state of form, so it's easy to cancel all changes
so it's more like last-comitted
@juhoteperi?
What's the usecase for cancelling all changes? (not sure I understand it's utility)
So that user can click cancel button to discard changes š®
Ok. Guess something I haven't needed very often