Fork me on GitHub
#untangled
<
2016-11-02
>
mitchelkuijpers15:11:25

Testing with the protocol support is insanely cool

mitchelkuijpers15:11:42

I love how readable it makes the tests

tony.kay15:11:08

@mitchelkuijpers Thanks. Our practical experience has been mixed, but I'm pretty happy with the idea 🙂

tony.kay15:11:32

you using Datomic?

mitchelkuijpers15:11:37

I only use it for the client-side mutations for now I am about to learn if the serverside stuff is nice

tony.kay15:11:52

the client-side stuff is the sweet spot for now

tony.kay15:11:10

the server-side setup is too hard at the moment, and I cannot really recommend it unless you want to help refine that 😉

tony.kay15:11:23

the idea is solid. The execution is too hard

mitchelkuijpers15:11:38

I’ll take a look at that we already have a lot of plumbing for testing with datomic and setting up the right db state

mitchelkuijpers15:11:00

So that might help us (just guessing)

tony.kay15:11:11

ours is underdocumented, but the tempid/seeding support in untangled is really solid

tony.kay15:11:14

for testing etc

tony.kay15:11:58

the hard part is that we really should have an easier way to "process" the server mutations without involving so much. it's too tangled, unfortunately 😕

mitchelkuijpers15:11:21

Do you guys have any experience btw with mocking (.preventDefault e) for now I have just moved it to a function that I can mock

tony.kay15:11:52

exactly. That is something we should do better in spec if possible, but I haven't looked too hard at the problem yet

mitchelkuijpers15:11:14

Seems like a very hard problem, and you can argue that you should put this kind of stuff in helper funcs

tony.kay15:11:32

well, that and protocols are a problem

mitchelkuijpers15:11:46

Yeah inline would be very hairy I think

tony.kay15:11:55

Anyone interested in a minor contribution: the generate stubs that @wilkerlucio was talking about earlier is a problem in our figwheel setup. https://github.com/cursive-ide/cursive/issues/1532#issuecomment-257904363 If anyone wants to figure out the specific fix I'd be glad to put take a PR for it. Affects template, om-css, and about every other project in Untangled

tony.kay17:11:58

@wilkerlucio figured it would be easy 🙂

jasonjckn18:11:13

Even with :marker false, load-field-action still replaces the destination in app-state with nil/dissoc the key, when the read starts, and then finally fills it in with the value with the read finishes.

jasonjckn18:11:54

this causes UI to flicker as it first renders nil, then renders the value during a load, even though, initially the global app state had real values (from a previous load-field-action)

tony.kay20:11:54

@jasonjckn on 0.6.0-SNAPSHOT? I thought I got all of those

tony.kay20:11:32

if so, open an issue. It should be an easy fix. Maybe load-field-action isn't passing marker false through

jasonjckn20:11:12

haven't tested 0.6.0-SNAPSHOT, will do

jasonjckn20:11:09

is it fully backwards compatible with 0.5?

jasonjckn20:11:24

ok read the changelog, it looks backwards compatible, but deprecated api.

jasonjckn21:11:22

my co-worker tried 0.5.7 which had the marker false fix in the changelog, and he says it's still swapping in nil into global state during a loading phase

jasonjckn21:11:50

i will double check this on 0.6.0 tomorrow and file a bug report

currentoor22:11:14

I raised this issue in bidi, but haven’t seen a response

currentoor22:11:20

has anyone here dealt wit this?

currentoor22:11:31

using tempids in bidi routes

adambrosio23:11:33

@currentoor why would you want that to be in bidi itself? looks like you have exactly what you need to make it work

adambrosio23:11:53

i might also just be reading your code wrong

adambrosio23:11:32

aand i was reading it wrong

adambrosio23:11:32

so i tried this locally and it worked:

adambrosio23:11:25

you may be doing a few things wrong, but i would guess that your [[tempid :id] “/edit”] is what’s wrong

adambrosio23:11:41

or you may not be doing the extend-protocol right

adambrosio23:11:32

can you fully namespace methods in an extend-protocol?

currentoor23:11:24

@adambros i believe that works because you’re not giving id a type, so it just defaults to a string, which is not what I’m trying to do

currentoor23:11:12

this way types are enforced and encoded into the route

currentoor23:11:42

so it works with the built in types like long and uuid

adambrosio23:11:56

so the [tempid :id] part is saying it should be transformed with tempid?

currentoor23:11:58

i want to be able to use tempid as a first class type

currentoor23:11:11

what i have works but it’s a hack IMO

adambrosio23:11:15

but i can (om.tempid/tempid “asdf”) ;=> <#C06DT2YSY|om>/id[”asdf"]

currentoor23:11:43

yes you can, and i would like bidi to do that for me, by me implementing a protocol or two

currentoor23:11:56

just like it does for uuids

adambrosio23:11:01

well i think i’ve exhausted my bidi knowledge then

currentoor23:11:14

no worries 😄

currentoor23:11:34

if i can get this working i might make an untangled-router 😅

currentoor23:11:56

we’ve got it in our app and it works pretty well

adambrosio23:11:03

if you can or can*t* get it working?

currentoor23:11:20

not sure what you mean

adambrosio23:11:34

did you mean, if i cant get this working i might make an untangled router?

adambrosio23:11:10

oh wait i think i just misunderstood again

currentoor23:11:27

if i am able to figure out how to extend the bidi types to support om tempids, then i will try make a router for untangled, from the one we have in our app