Is SSR part of untangled?
it's actually part of om next now. (dom/render-to-string Component InitialData)
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.
https://github.com/omcljs/om/wiki/Documentation-(om.next)#render-to-str
(just a little stub in the om wiki about render-to-str)
@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 🙂
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?
or is that part of om-next and not untangled
does anyone have thoughts/references on a security model when using om-next with datomic pull syntax?
@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.
@jtmarmon check out https://medium.com/adstage-engineering/realtime-apps-with-om-next-and-datomic-470be2c8204b#.wpj1q6gqk if you have not seen it befoer
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
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...
Anyone here familiar with this error/ Uncaught Error: Assert failed: (or (component? x) (reconciler? x))
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).
Good to think of a component like a protocol (class).
@hlolli Strange, I am passing the reconciler
(defroute foo-routes "/foo/:bar" [bar]
(transact! @reconciler [(app/choose-tab {:tab :search})
(search/new-query {:status bar})
:ui/root]))
perhaps my reconciler is nil at that point or something?
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?
@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
@njj You don’t have to deref reconciler, it will just return current state. Try without dereffing.