Fork me on GitHub
#om
<
2016-03-15
>
anmonteiro00:03:22

@dnolen: perfect, thanks

anmonteiro00:03:59

still not sure how to approach the ident stuff on the server-side, though

anmonteiro00:03:16

but I'll have concrete questions when I dive into it

dnolen00:03:21

@bostonou: glad to hear it!

folcon00:03:16

@matthavener: right, I found that a little while ago, I’m going through them to see if I’ve introduced an error somehow...

grounded_sage01:03:51

What is the current status of server side rendering for Om Next? I'd like to build a system similar to using Gatsby (React static site generator) and Netlify.

matthavener02:03:14

common_creative: I think someone asked a few days ago in here, don't think they got much of an answer

matthavener02:03:50

does om.now have server side rendering?

grounded_sage03:03:25

@matthavener: I'm aware of this however not sure how much work has been done on it which is why I was wondering about its status https://github.com/omcljs/om/wiki/Server-Side-Rendering That one you shared looks good. I'm weighing up whether using Amazon Lambda Serverless architecture or some kind of Elixir/Pheonix solution would be best.

thosmos06:03:35

@grounded_sage: I use a boot task to run clj-webdriver with phantomjs and have it browse each route of the site and save it to a static HTML. Each page includes the app state for that page in a <script id="state" type="application/edn">...</script> tag which is loaded by the app.js before starting the reconciler. This enables us to pregenerate all of our pages ahead of time and they load fast with all of the React tags long before the app.js loads and Om runs.

hlolli09:03:03

Im getting weird bug, Im trying to do om/transact! with a backtick like this #(om/transact! reconciler [(router-get-page! {:html-contents `~(.getResponseText (.-target %))})]) and as you can see it needs to be a backtick so I can get the contents of the http response. But I get an error sayng that mynamespace/router-get-page! does not exist, but it I transact this in the repl on remove the namespace from the router-get-page! method, everything works fine. ps. slack will start doing markdownish styling when I insert the backtick, but I can assume that you know there it is standing.

rauh09:03:19

@hlolli: Use triple ticks for slack & backticks.

`(foo/bar) 

rauh09:03:37

@hlolli: I'd just thow away the backtick altogether and use (list 'router-get-page! ...) no unquote needed.

hlolli09:03:21

ok, interesting.. give me 2 mins to try it out...

hlolli09:03:17

NIIICE!!! I love it when I get help (and it saves my sanity)

grounded_sage10:03:40

@thosmos: that's a creative solution. Not quite the one I am looking for but from what you have said it's pretty much the result I am looking for. I'm still getting my programming chops so looking for more simple/easy solutions. May just stick with building my sites with Stasis and drop Om in as and when needed

seanirby11:03:24

so I 'm getting this error whenever I do a particular mutation.

Uncaught #error {:message "No queries exist for component path (komokio.core/Root komokio.core/ColorsEditor komokio.core/Color)", :data {:type :om.next/no-queries}}
This error started happening when I added some stateless UI components between the root and the component thats calling the mutate so it has to do with that, but I'm not sure why. I'm composing the queries from root and the app renders correctly. Any ideas?

matthavener11:03:09

seanirby: are you calling transact! on a component with no query? that could be it..

seanirby11:03:58

matthavener: let me see

seanirby11:03:32

matthavener: Yeah the component has a query

seanirby11:03:19

matthavener: I wouldn't expect that error since everything renders correctly. Could it be something in the mutate function?

anmonteiro12:03:42

@seanirby: everything rendering correctly doesn't mean that you got queries right

anmonteiro12:03:24

If you paste the queries of those 3 components here I'm happy to have a look

matthavener12:03:27

In my experience it has been when I called transact on a component with no query or when an ident was messed up. You might be able to look at the stack and see what's going on inside of om too

seanirby12:03:45

I think i've found the problem, i'm using an ident to reference the data im mutating, when I remove that reference the error stops. Not sure why but I'll put a paste together

anmonteiro12:03:57

The stack will show full-query, default-ui->props and reconcile! which won't be much of help

seanirby13:03:36

anmonteiro: OK I see whats the problem is with the queries for FacesEditor and ColorsEditor. Those should be stateless

anmonteiro13:03:20

with the approach you pasted, the root never knows about the query in ColorsEditor..

seanirby13:03:10

thanks for taking a look

tawus13:03:33

will set-query! always cause a re-render of the component that is passed to it ?

anmonteiro13:03:48

you can also provide a vector of keys to be re-read just like in transact!

anmonteiro13:03:51

(om/set-query! this {:query [:some/key]} [:read/other :yet/another])

tawus13:03:35

Cool! thanks. Seems like there is some problem with my read function. I have trying pathopt=true to see how it works.

urbanslug14:03:10

Where would I start if I wanted to implement an upload progress bar with Om?

anmonteiro15:03:44

@dnolen: I was looking at react-set-state! and I wonder if the nil on this line should be cb https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L579

tawus15:03:55

@urbanslug: Are you using om.next or om.now ?

urbanslug15:03:21

@tawus: I want to do this with Om Next

urbanslug15:03:38

@tawus: Any insight is welcome.

tawus15:03:54

Easy way would be to use any jquery upload plugin. Do the initialization in componentDidMount. This would work with om.now.

tawus16:03:54

I am not sure if transit library allows uploads but if it does then you would have to call mutation for uploading a file, otherwise you will have to fallback to conventional upload.

anmonteiro17:03:29

@dnolen: gotcha, I'll get to it later today if you haven't first

tony.kay21:03:42

Hi everyone, I'm happy to announce that all of the source for our open source Om Next-Based web framework is up on Github, and in reasonably stable condition simple_smile There is a full-stack implementation of TodoMVC (with list persistence in Datomic), the beginnings of a Om Next style tutorial, i18n, behavior specification support, and much more. I'll be working on a website, documentation, and video tutorials in the coming months. If anyone is attending Clojure West I've also suggested an Unsession for it, so be sure to express your interest there. See: https://github.com/untangled-web/untangled-todomvc https://github.com/untangled-web/untangled

tony.kay21:03:52

There is also an #C0PULSD25 slack channel here.

taylor.sando22:03:09

@tony.kay: For the untangled tutorial, I think you'll have to comment out the references to the checkout directories in the project.clj, and change the untangled-client from snapshot to the actual 0.4.5 release.

tony.kay22:03:44

ah yes, a bit in flux. thanks for the note

tony.kay22:03:06

@taylor.sando: pushed an update on master. If you're playing let me know if that works. I put 0.4.7-SNAPSHOT on clojars

tony.kay22:03:09

The tutorial is mostly documentation...I'd combine reading that with the TodoMVC app.

taylor.sando22:03:40

The update works

whythat22:03:11

Can someone point me to some guides on how to implement inter-component communication in Om Next? Do I have to use core.async as in "classic" Om , or am I missing something?

dnolen23:03:58

@tony.kay: amazing, looking forward to looking over all of this stuff

currentoor23:03:00

@whythat: what exactly do you want to do between components?