This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-14
Channels
- # 100-days-of-code (4)
- # announcements (1)
- # beginners (63)
- # boot (22)
- # braveandtrue (104)
- # calva (3)
- # cider (12)
- # cljs-dev (53)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (180)
- # clojure-dev (14)
- # clojure-italy (4)
- # clojure-nl (11)
- # clojure-spec (15)
- # clojure-uk (60)
- # clojure-ukraine (1)
- # clojurescript (118)
- # clojutre (3)
- # core-async (12)
- # core-logic (17)
- # cursive (19)
- # datomic (45)
- # devcards (4)
- # emacs (7)
- # figwheel-main (218)
- # fulcro (27)
- # funcool (3)
- # graphql (1)
- # jobs (4)
- # leiningen (57)
- # off-topic (71)
- # pedestal (2)
- # portkey (17)
- # re-frame (5)
- # reitit (4)
- # remote-jobs (2)
- # ring (11)
- # rum (2)
- # shadow-cljs (14)
- # specter (11)
- # sql (34)
- # tools-deps (23)
@tony.kay Yep nodejs in production đ A few reasons for that... Shadow-cljs dev experience for node seems really nice, I get ssr for npm libs, but mostly due to the fact that appengine standard is now available for nodejs (need standard to keep the server bills low). Java is not really the best fit: 128mb instances, need to package it as unpacked uberwar, 10k app file limit, slow startup time, java apis kinda old etc.... Nodejs seems like a reasonable fit, given the constraints and the fact that my backends mostly work with the db not much processing going on. It's also easier for me since the only java I ever wrote is some interop code in clojure đ so writing interop for nodejs libraries is a bit easier.
Wrote the ssr part for a few pages on a fulcro java backend app. Experience is pretty good, but still a bit of pluming. Will give it a shot to see if I can get it working as a headless app đ Fulcro source code is really nice, but still a bit going on there that I have to get my head around đ
@pvillegas12 Have you looked at AWS amplify, that could be a really good fit together with datomic ions, it can handle the front-end part for you pretty easily
someone here using "google-maps-react" ?, because when i add that to my require, it says "No such namespace: google-maps-react etc"
is there a reason why fulcro not using hiccup or something similar? I think having markup as data makes it easier to work with
also it is a slightly more compact
Think initially because Fulcro, used to be an om-next fork, now it's standalone and the dom has improved a lot as of 2.5 http://book.fulcrologic.com/#_the_code_render_code_method
an interesting read on the topic http://tonsky.me/blog/hiccup/
thanks
reading
@kirill.salykin https://clojurians-log.clojureverse.org/fulcro/2018-01-26 seems like it should work with sablono.
@claudiu thanks!
@kirill.salykin Many reasons, but you can easily use sablono, as pointed out. At the end of the day, I see it as a simple preference decision. My preference is how it is written, and your preference is an easy dependency addâŚyou can even write a wrapper macro to make it âthe defaultâ
@claudiu Most of those sound like valid reasonsâŚparticularly if you have deployment target needs. In terms of headless: You can âswitch outâ the root render function on the reconciler options. That, and fixing up the âremoteâ so that it does loopback might be all that is needed. Let me know how it goes. Something like this might work:
(let [result (async/chan 1)
render (fn [element dom-target] (async/go (async/>! result (js/ReactDOMServer.renderToString element)))
client (new-fulcro-client {:reconciler-options {:root-render render})]
(mount client Root :fake-node)
;; then read from result chan which should have rendered result...I think???
(async/go (async/<! result)))
The :fake-node
bit will cause Fulcro to avoid trying to look up a real dom node during mount
If you have async loads in started callback, thereâll be more logicâŚlet me know if you can get a simple render without started callback stuff with that @claudiu
sorry if i ask something stupid, i really don't know how to translate that js into cljs in fulcro
@veddha.riady take a look at https://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/
@veddha.riady That will get you syntaxâŚfrom there the other bits require you understand React itself.
because the code youâre showing is imperative DOM manipulation, and that is totally different from a React model, and thus very different from Fulcro
So, there is a lot to learn to explain the real differences đ Read the basic docs on React, then watch some of the Fulcro tutorial videos.
Here is an implementation of the Collapse control from Bootstrap (which has animations implemented in code): https://github.com/fulcrologic/fulcro/blob/develop/src/main/fulcro/ui/bootstrap3.cljc#L1005
That is probably more what youâre looking for @veddha.riady