Fork me on GitHub
#om
<
2015-11-27
>
danielstockton10:11:10

@johanatan Can you set the value after first setting the element to focussed

danielstockton10:11:25

that should put the cursor at the end

danielgrosse12:11:14

At trying the om.next tutorials of @dnolen everything works fine in dev mode. But when compiling the files for production with advance optimizations while changing the atom state the following error is thrown:

Uncaught #error {:message "No queries exist for component path (#object[fw \"function fw(){React.Component.apply(this,arguments);this.state=null!=this.vb?this.vb():{};return this}\"] #object[bw \"function bw(){React.Component.apply(this,arguments);this.state=null!=this.vb?this.vb():{};return this}\"])", :data {:type :om.next/no-queries}}

dnolen14:11:31

@danielgrosse: need a minimal case please, then file an issue. Thanks.

jamescroft14:11:23

Hi all, I’m looking for a bit of help with how to write the read functions for a simple app.

jamescroft14:11:10

The app consists of a select list of partially loaded records, only the ids and names of the items have been loaded. Then, when an item is selected, I want to load the rest of the attributes for the selected item.

jamescroft14:11:17

This is what I have so far. I don’t know how to handle the loading of the additional attributes for the selected item. Any pointers?

anmonteiro14:11:23

@dnolen what is ::skip used for in the rendering queue?

anmonteiro14:11:47

it seems related to the initial render somehow, but I can't really figure it out

dnolen14:11:35

@anmonteiro: implementation detail, not related to initial render

anmonteiro14:11:03

I was digging into the issue 498 and found a few things if you're interested

dnolen14:11:11

related to supporting banging on the atom without triggering a re-render

anmonteiro14:11:10

(the thing where "transacting seems off by one"

anmonteiro14:11:45

it only happens when you transact! on the reconciler, not if you transact! on a component

anmonteiro14:11:59

because transacting on a component will add it to the queue

anmonteiro14:11:19

doing it on the reconciler will not, and only ::skip will be there, so it does nothing

anmonteiro14:11:47

(the second time it will transact! because you're clearing the queue then)

dnolen14:11:10

@anmonteiro: try with master, the ::skip stuff wasn’t fully baked and I’m no sure why I had logic in there using it when setting up the reconciler in add-root!

anmonteiro14:11:43

don't need to try

anmonteiro14:11:49

this is what I did as well

anmonteiro14:11:50

and it worked

anmonteiro14:11:02

after commenting out that line

anmonteiro14:11:16

hence my ::skip question 😛

anmonteiro14:11:35

the thing is that after removing that from add-root!, it never gets on the queue anymore, so you also don't need to check for it in line 1353

anmonteiro14:11:31

trying it anyways just for the sake of it

anmonteiro14:11:35

OK, double-checked and it's working now

dnolen14:11:24

@thomasdeutsch: does DataScript not support multiple DBs?

dnolen14:11:50

I’m not really interested in adding more features around how the parser work so that would be the last option only (if at all)

dnolen14:11:04

this in reference to OM-501

thomasdeutsch15:11:57

@dnolen: not like datomic does. It is all in-memory.

dnolen15:11:23

yeah so this seems to me trivially solveable if DataScript supported that

dnolen15:11:28

and I did not realize that it did not

dnolen15:11:46

i.e. put client only datums into second db and query across both

dnolen15:11:27

or couldn’t you solve with with-db?

dnolen15:11:27

in anycase I think some more time should be spent considering how this could be done without changing anything at all

dnolen15:11:55

as always if we can fix in the data we want to do that before offering any programmatic solution

thomasdeutsch15:11:50

At the moment, it is not " trivial to introduce custom stores like DataScript" just because the fact that we have to be able to do database lookups by using the om.next query syntax. My only solution this far is to add shared values - but this violates the premise to have declarative components.

dnolen15:11:17

@thomasdeutsch: it seems to me there are many ways to solve this problem for custom store like datascript

dnolen15:11:26

and you’ve only offered one possibility

dnolen15:11:34

multiple remotes, query-preprocessing, custom parser

dnolen15:11:42

there’s tons of functionality to sort through

dnolen15:11:49

that said not suggesting you be the one to figure it out simple_smile

dnolen15:11:12

but I’m not interested in pursuing any direction without someone making a convincing argument based on many alternatives

dnolen15:11:51

that said the multiple db thing would seem to solve this

dnolen15:11:02

I can’t imagine it would take DataScript much work to support it

dnolen15:11:13

then you could put client only information into the second one

dnolen15:11:19

and feed both into app state

thomasdeutsch15:11:26

i will work with om.next and will get used to its internals, before i can think of other solutions besides a custom parser or query-preprocessing.

anmonteiro16:11:06

updating local state won't cause a re-render in devcards. is this one of the limitations of devcards not supporting om next?

anmonteiro17:11:33

@dnolen say I wanna get the computed next-props in willReceiveProps, do I have to destructure manually?

johanatan18:11:47

@danielstockton: perhaps but what if the user is entering chars in the middle of the string? I really want the cursor position to be preserved. Also the cursor being moved isn't the only issue-- there seems to be some flickering/ extra/ out of sync rendering going on.

taylor.sando18:11:18

Is there anything special you have to do to depend on the snapshot version of om? Just using [org.omcljs/om "1.0.0-alpha25-SNAPSHOT"] results in an artifact not found. Does it have to be something like a checkout dependency to get the absolute latest snapshot version?

taylor.sando18:11:01

Nevermind, cloning the repo, and running lein install works

anmonteiro19:11:16

can anyone repro #502?

anmonteiro19:11:35

getting a really strange behavior

anmonteiro19:11:28

when I use the destructuring syntax: {:keys [foo] :as next-props} in componentWillReceiveProps or componentWillUpdate I get stale props

wilkerlucio21:11:26

@anmonteiro: I have this experienced this here as well

anmonteiro21:11:56

the destructuring thing?

jetmind22:11:48

Just shoutout to @tony.kay for an amazing om tutorial. I've discovered it like an hour ago and it's been very useful so far!

tony.kay22:11:27

@jetmind: Thanks. Beware, there are some things that are out of date. I'm working like mad to get through my normal work and get to writing more. Also, if anyone is working on remoting and wants to talk through details, let me know. I'm working through forced remote reads in a transaction at the moment.

tony.kay22:11:59

@dnolen: I think this is a bug: The parser always short-circuits read/mutate when AST target is set to remote. I see the reason for this when running the parser in "local mode", but it seems to me that is should only short-circuit when the parser target =/= ast target...if you're running the parser in remote mode, then you want the remote mode read (which is supposed to return the bit of query to send to the server) to actually get called.

tony.kay22:11:01

Argh, no that's not right either. Well, maybe it is...I hit a problem with process roots that hid what I expected.

dnolen23:11:08

@tony.kay: not sure what you mean, need to see an example of what you think is unexpected

dnolen23:11:40

@anmonteiro: is OM-502 resolved by the typo fix?

tony.kay23:11:27

@dnolen: I found some issues with process-roots. Just wrote some failing tests. Will post an issue and PR, then I'll get you an example of the parser thing that I think might be wrong

tony.kay23:11:39

Issue #503 and PR #504

tony.kay23:11:46

@dnolen: So, on the parser, here is the scenario and what I expect.

tony.kay23:11:25

If I change line 150 to: res (when (or (nil? (:target ast)) (= target (:target ast)))

tony.kay23:11:29

then it does what I expect

dnolen23:11:46

@tony.kay: yeah I’m not really sure about OM-503 - will need to spend a lot of time thinking about it