untangled

NEW CHANNEL: #fulcro
2016-10-12T13:02:41.002345Z

@tony.kay also take a look at https://github.com/compassus/omify, still in very early stages but it works

anmonteiro 2016-10-12T13:49:42.002347Z

@ethangracer if you find anything that’s not working in Omify, I’m more than happy to have a look

2016-10-12T13:51:43.002348Z

@anmonteiro thanks, it’s worked fine for me so far!

anmonteiro 2016-10-12T13:51:50.002349Z

awesome

anmonteiro 2016-10-12T13:52:16.002350Z

PRs adding docs and examples are more than welcome, I didn’t have time to get to it yet

currentoor 2016-10-12T15:57:39.002352Z

@anmonteiro this may be a dumb question but what is the use case for omify? We've been able to use vanilla React components just fine in the render methods of our components using js/React.createElement.

anmonteiro 2016-10-12T16:08:54.002353Z

@currentoor this was driven by a question from @ethangracer about adding queries and idents to plain React components without having to make wrappers

anmonteiro 2016-10-12T16:09:26.002354Z

but another use case is e.g. having the correct bindings and props in a plain React component that receives an Om Next component as children

currentoor 2016-10-12T16:20:42.002355Z

oh I see what you mean, thanks

tony.kay 2016-10-12T16:28:37.002356Z

0.5.8-SNAPSHOT of U.client updated on Clojars

tony.kay 2016-10-12T16:28:50.002357Z

fixes an initial app state bug I introduced while trying to expand devcards support

mitchelkuijpers 2016-10-12T18:30:09.002360Z

Damn you are fast @tony.kay thnx

2016-10-12T21:14:22.002361Z

@tony.kay someone on my team is reporting that transact! this '[(create-object) (on-success-do-something-with-object) (tx/fallback {:action 'on-failure}) when create-object throws exception server-side, on-success-do-something-with-object mutation is still transacted

2016-10-12T21:14:44.002362Z

possible bug?

2016-10-12T21:14:51.002363Z

should I try to reproduce this myself first?

2016-10-12T21:15:02.002364Z

should I file an issue

2016-10-12T21:19:56.002365Z

@jasonjckn I believe that what you’re describing is expected behavior. all transactions in a query except for tx/fallback are sent to the server and dispatched via the mutation method defined in the server-side parser.

2016-10-12T21:20:31.002366Z

If there is a way to specify that a certain mutation should occur on success, it’s not something we built into untangled

2016-10-12T21:20:36.002367Z

om transactions are not atomic, to my knowledge

2016-10-12T21:21:12.002370Z

okay, I thought toni said this worked a while back

2016-10-12T21:21:20.002371Z

but i'm not surprised if what you said is accurate

2016-10-12T21:21:50.002372Z

I do remember a conversation recently about having some kind of on success function client-side as a post mutation

2016-10-12T21:21:58.002373Z

it kind of complicates things

2016-10-12T21:22:10.002374Z

but I can write onsuccess in client logic

2016-10-12T21:22:23.002375Z

e.g. check if object was loaded or not

2016-10-12T21:23:31.002376Z

Hm. have you tried using the server-side parser to re-dispatch? I’m not sure that it’s advisable, but theoretically it’s possible to call (parser env [new-query]), which you could do conditionally in the server’s action thunk

2016-10-12T21:23:39.002377Z

considering that mutations don't have return results this definitely complicates user logic

2016-10-12T21:24:11.002378Z

what I would like to express is simply, create object, switch tab to new object, + error handling

2016-10-12T21:24:18.002379Z

but mutations don't have return results

2016-10-12T21:24:28.002380Z

except via tempids

2016-10-12T21:25:04.002381Z

right, and the follow on server loads don’t work in your case?

2016-10-12T21:25:08.002382Z

another would be: update object, show UI checkmark, + error handling

2016-10-12T21:25:31.002383Z

transact! [(do/something) (untangled/load {:query [:new-data]})]

2016-10-12T21:25:57.002384Z

that doesn't really lend itself to switching tabs to the new object, there's nothing to read server-side in that case

2016-10-12T21:26:05.002385Z

switching tabs is strictly client-side

2016-10-12T21:26:22.002386Z

e.g. untangled/load {:query [:current-tab]} makes no sense

2016-10-12T21:26:43.002387Z

When we do that, we rely on optimistically created objects and switch immediately, but I think you already mentioned you need to wait until creation is confirmed right?

2016-10-12T21:26:56.002388Z

right

2016-10-12T21:27:04.002389Z

gotcha

2016-10-12T21:27:08.002390Z

the use case is show error, or switch tab

2016-10-12T21:27:19.002391Z

not switch tab optimistically, then undo switch tab in error case

2016-10-12T21:28:04.002392Z

anyways it's workable for now by checking tempids in switch-tab , but awkward

2016-10-12T21:28:20.002394Z

what happens to om/tempids if the mutation fails?

2016-10-12T21:28:23.002395Z

do they just stick around?

mitchelkuijpers 2016-10-12T21:57:48.002398Z

I think tempid’s just stick around

mitchelkuijpers 2016-10-12T21:57:59.002399Z

Pretty sure actually

2016-10-12T22:02:15.002400Z

@jasonjckn @mitchelkuijpers yup, they don’t go anywhere unless you use a fallback to remove them