This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-13
Channels
- # aws-lambda (21)
- # beginners (8)
- # boot (67)
- # braveandtrue (2)
- # cider (12)
- # cljs-dev (38)
- # cljsjs (87)
- # cljsrn (11)
- # clojure (307)
- # clojure-austin (29)
- # clojure-finland (1)
- # clojure-italy (9)
- # clojure-russia (19)
- # clojure-spec (71)
- # clojure-uk (33)
- # clojurescript (109)
- # clojutre (1)
- # core-async (2)
- # cursive (24)
- # datomic (11)
- # devops (5)
- # ethereum (5)
- # figwheel (2)
- # hoplon (25)
- # ipfs (1)
- # jobs (1)
- # luminus (17)
- # off-topic (2)
- # om (38)
- # om-next (3)
- # onyx (166)
- # other-lisps (1)
- # proton (5)
- # re-frame (15)
- # reagent (45)
- # ring (2)
- # spacemacs (6)
- # specter (12)
- # untangled (58)
- # yada (23)
^ re above interop, i often find it convenient, if i don't have to refer to a local binding or var, to just dot-access the whole thing, e.g. (js/window.history.back)
@tom does this help? https://www.martinklepsch.org/posts/props-children-and-component-lifecycle-in-reagent.html
@eyelidlessness works like a charm, thanks!
Hello, I’m trying to create a simple google map with some locations markers - however, I’m not able to display the map on refresh
If I got it correctly, the problem is that the component-did-mount is not called when ratom is changed
I’ve just read https://github.com/Day8/re-frame/wiki/When-do-components-update%3F but still not sure how I should solve this issue.
For basic inspiration I used https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/google-maps
@gamecubate here is the repo for the MtG card search application we discussed yesterday: https://github.com/mtg-cards
Oh... :ref
can't be used with :input
etc...
IE11 fix on the latest snapshot always overrides :ref
@artur Thanks a lot for this. BTW well organized project. It makes understanding the inners that much easier. I see you use secretary for your front-end and a clojure back end server . I'd always assumed that CLJS work was easiest served up-front (hosted index.html, app.js and friends). Your setup provides a clear alternate path: dynamic backend page generation and delivery, coupled to front-end routing. Not wrapping my mind very well around this. Will dig deeper. Thanks for the great (starred) example.
@artur Also wondering if secretary is needed if one uses re-frame, as I was contemplating.
I have no idea about re-frame as this is the only setup I have done so far. I like how I can package everything in one JAR file that I can fire up and use without the need for Nginx or other instance to serve the index.html file.
Well, not having worked with it yet but tempted because of the complexities of my current work project (cljs + reagent for NHL games newspaper contest front-end, nodejs backend 2-tier servers, mongodb). Re-frame is a relatively small lib/namespace coupled to a well documented approach in its use. With it, a clear separation of concerns is enforced, simplifying complex app coding.
Long story short: re-frame helps keep chaos at bay.
I guess you still need some nginx config to proxy ports to subdomain URLs but yes, your approach simplifies deployments. Being lazy myself, I use Makefiles for that. 🙂
And as for chaos, I have seperated app state into one file, actions which modify state into one file and then there are pages and components.
@gamecubate: secretary and re-frame handle different concerns - secretary is primarily there to allow you to deal with URL routing, and can be used along with re-frame (as can Bidi, Silk, or another URL routing library). To see an example of secretary used with re-frame, check out https://github.com/yogthos/memory-hole or for bidi check out https://pupeno.com/2015/08/26/no-hashes-bidirectional-routing-in-re-frame-with-bidi-and-pushy/
@shaun-mahood Thanks for the links. The Bidi example is very nicely explained, as are Bidi and Pushy. Added to my stack. 🙂
Dopey question, possibly because I need caffeine and a nap: If I want to render markdown converted to HTML in a reagent component, how can I best do that?
@bill_tozier You could try something like this: [:div {:dangerouslySetInnerHTML {:__html "<b>I am bold</b>"}}]
.
@gamecubate So basically call markdown-clj
or showdown
(depending on the situation) to convert some MD text to HTML, then dangerouslySetInnerHTML
.
So no “pass-through HTML component” I’m missing? I know, the philosophy of react and all. Just checking.
@bill_tozier That’s I would try. Later would seek something smoother if time allows.
Thanks!
@bill_tozier this may be of interest since it is in the same realm, but doesn't do what you are looking for: https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/markdown-editor
@artur Also, check out this reddit thread on that same topic: https://www.reddit.com/r/Clojure/comments/4el0xi/how_to_use_an_existing_reactjs_component_with/
@gadfly361 Wow. I hadn’t seen that one. Great call. https://reagent-project.github.io/news/news050.html
@gamecubate Your reddit link also shows this: [:> nativeComp {:key "value"}]
, so :>
looks like shorthand for adapt-react-class
(as of reagent v0.6.0-alpha). Thanks for sharing!
@gadfly361 You’re welcome. Between work and life, I can barely keep up with the Reagent changes but they are nice, not too frequent and always well documented. Great lib.