om-next

jtmarmon 2017-01-05T00:00:16.000167Z

Is SSR part of untangled?

sova-soars-the-sora 2017-01-05T00:06:36.000168Z

it's actually part of om next now. (dom/render-to-string Component InitialData)

sova-soars-the-sora 2017-01-05T00:07:59.000169Z

And I think AlanKay just added support for it on the dev branch of Untangled. Although it's already supported by the underlying om architecture... still kinda fuzzy for me though, since ideally all you'd have to do is move your (defui ..) and (om/factory)ies to .cljc but i'm having trouble overcoming the "what the funk you talkn' bout willis" when I leave my #js{:className "whateverclass"} in my code.

sova-soars-the-sora 2017-01-05T00:08:39.000172Z

(just a little stub in the om wiki about render-to-str)

sova-soars-the-sora 2017-01-05T00:11:13.000173Z

@anmonteiro I notice that in your TodoMVC example with ServerSide Rendering you used something from boot.core to overcome the strangeness is parsing #js{} ... is there a vanilla way I can do this with project.clj without using boot? anyway, thanks a lot for your input, I know you're busy so i won't be offended if you never get around to replying fwiw 🙂

jtmarmon 2017-01-05T01:51:41.000174Z

man, looking into untangled i like the philosophy but i'm watching the tutorials and the whole :ui/react-key stuff looks really gross. is there a canonical way to deal with re rendering in dev in om-next?

jtmarmon 2017-01-05T01:55:14.000175Z

or is that part of om-next and not untangled

jtmarmon 2017-01-05T03:06:17.000176Z

does anyone have thoughts/references on a security model when using om-next with datomic pull syntax?

sova-soars-the-sora 2017-01-05T03:16:35.000177Z

@jtmarmon so what I have learned is that if you have a "single source of truth" i.e. your datomic storehouse, then on every incremental datomic database change (post-mutation) you can send the transaction and the delta change to the om.next reconciler, and it'll update your whole UI. I am not versed enough yet to chime in wholly on the topic, but I think there are elegant ways of keeping UI elements up-to-date without doing your own book-keeping.

sova-soars-the-sora 2017-01-05T03:34:32.000178Z

@jtmarmon check out https://medium.com/adstage-engineering/realtime-apps-with-om-next-and-datomic-470be2c8204b#.wpj1q6gqk if you have not seen it befoer

jtmarmon 2017-01-05T03:46:27.000181Z

ah well the example in his video was slightly simpler - he just rendered a simple string, but in order to get react to re-render he had to add :ui/react-key to his dom element. seems a bit over complicated for something as simple as live reloading a string element

sova-soars-the-sora 2017-01-05T03:50:34.000182Z

Ah, yes, i noticed something like this. in light-table when I was doing (om/render-to-str ...) while it was working for me (xD) i noticed the react-key id kept incrementing ... i think it's a really simple way of "versioning" the dom elements... might be necessary to get the live update but i thought it was pretty much stock stuff... not actually something to tinker with...

exit2 2017-01-05T14:25:20.000184Z

Anyone here familiar with this error/ Uncaught Error: Assert failed: (or (component? x) (reconciler? x))

2017-01-05T15:10:49.000185Z

yes, all too well. You are trying to use om function that requires component instance. Only "this" or reconciler can be used. A common mistake I guess is to give it the name of the component instead of its instance (since you can instanciate many instances of the same component).

2017-01-05T15:11:16.000186Z

Good to think of a component like a protocol (class).

exit2 2017-01-05T16:21:04.000187Z

@hlolli Strange, I am passing the reconciler

exit2 2017-01-05T16:21:07.000188Z

(defroute foo-routes "/foo/:bar" [bar]
  (transact! @reconciler [(app/choose-tab {:tab :search})
                          (search/new-query {:status bar})
                              :ui/root]))

exit2 2017-01-05T16:21:16.000189Z

perhaps my reconciler is nil at that point or something?

2017-01-05T16:24:43.000190Z

two things here I see, dont deref the reconciler and remember to quote the transaction query(the vector), are 'app/choose-tab and 'search/new-query methods in mutate?

exit2 2017-01-05T17:03:55.000191Z

@hlolli that seemed to be part of the issue - when quoting the transaction vector how do I get it to interpret the bar param passed in? It appears to be turning it into a string and literally passing ’”bar” as the :status versus the param thats passed

samcf 2017-01-05T17:30:49.000193Z

https://clojuredocs.org/clojure.core/unquote

samcf 2017-01-05T17:31:13.000194Z

http://clojure.org/reference/reader#syntax-quote

alex-glv 2017-01-05T23:45:11.000195Z

@njj You don’t have to deref reconciler, it will just return current state. Try without dereffing.