Fork me on GitHub
#fulcro
<
2019-03-02
>
souenzzo03:03:51

docs says that mutation-merge is deprecated and say to use "mutation join" or "network middleware" In none of that cases I'm able to operate with (fn [state result] state) (where result is the result of the mutation in load, I can call post-mutation, why in transact I cant?

souenzzo14:03:56

How should I handle that: [{(app/login {...}) [:user/authed?]}] If this remove mutation returns {app/login {:user/authed? true}}, then I go to Home Else I stay in Login page.

tony.kay01:03:43

See pessimistic transactions. Also see the improved pessimistic transactions in incubator

souenzzo02:03:40

now I cant throw inside #pathom. It just generate a #error{} value 😞

nha14:03:26

on fulcro SSR - is there some transformation going on? I get some css errors, like this:

font-family: &quot;Helvetica Neue&quot;

tony.kay01:03:34

Is this an inline style tag? Could be a bug. =

nha10:03:57

Yes, you could say this is an inline tag. At least I dont “upsert it”, it is rendered as a children of the root node if this is what you ask.

tony.kay16:03:53

probably a bug in SSR…style tags should probably be exempted from escape rules

nha16:03:46

Makes sense - can I leave this with you then? Do you want a ticket?

tony.kay16:03:07

You can. No idea when I’ll get to it.

nha14:03:55

singles quotes work, but it is surprising that it works on the client but not the server

nha14:03:31

oh. but then single quotes get transformed on the client in &#x27… I can’t seem to win this one

nha16:03:47

Another question:

(i18n/with-locale (fn [_]) "en" "<div>a string</div>")
also how am I supposed to use this? I get a
java.lang.ClassCastException: java.lang.Character cannot be cast to java.util.Map$Entry

tony.kay01:03:27

your message formatter returns nil and you’re trying to format a string??? That isn’t how any of that works.

tony.kay01:03:07

locale isn’t supposed to be a string, it is supposed to be a translation map. The thing to “wrap” should be a call to actual rendering (not the output of rendering)…xlation is done on the fly DURING render.

tony.kay01:03:47

and affects calls to tr, not strings

nha16:03:47

Ah right, it seems to use a “binding” I definitely have that wrong, Why not pass optional arguments to render-to-str instead?

tony.kay16:03:07

because then i18n would be coupled to ssr…why would I want that?

nha17:03:55

I haven’t made it work yet, so I am probably missing something. I guess i18n is done mostly on the server? I mean, you don’t send all the translation data to the client?

nha17:03:31

(also I don’t see in the docs that the client uses a with-locale binding, but something is passed to the reconciler instead)

tony.kay17:03:17

You do load the xlation data to the client…perhaps the docs aren’t clear enough

nha17:03:14

oh - thanks for clarifying that then. To be fair you don’t say anything about NOT loading it, I just made that assumption.

eoliphant17:03:33

quick question transact! provides no ordering guarantees right?

currentoor20:03:59

i think it’s guaranteed to be sequential for client side mutations

currentoor20:03:38

the default behavior for remote also is sequential, happens in a core.async go-loop

currentoor20:03:39

all network IO is sequential by default, if they are on the same remote

currentoor20:03:21

but you can mark loads to be parallel

currentoor20:03:52

from the book > All network requests (queries and mutations) are processed sequentially unless you specify otherwise. This allows you to reason about optimistic updates (Starting more than one at a time via async calls could lead to out-of-order execution, and impossible-to-reason-about recovery from errors).

currentoor20:03:35

> If remote mutations are separated in time, then they go through a sequential networking queue, and are processed in order.

currentoor20:03:08

You can make a non-sequential remote if that’s desired http://book.fulcrologic.com/#_optional_non_sequential_operation

tony.kay01:03:37

Everything @ is saying is right. The ordering on the server is up to you in terms of how you process it…but if you use a standard EQL sequential parser, you’ll see them order as well. One caveat: Fulcro tries to combine network requests when possible, so you might submit 2+ transactions and see them combined into 1 (still in the order you sent).

mroerni17:03:29

@tony.kay http://book.fulcrologic.com is still on the state of December 27th 2018. Maybe a deploy has gone wrong?

samuel19:03:10

does fulcro inspect work in chromium-debian? I am on version 57

tony.kay01:03:12

It is written in js, so I don’t see any reason why it wouldn’t, but I have not personally tried it.

tony.kay01:03:16

might read this https://wiki.debian.org/Chromium with respect to extensions

samuel17:03:17

Yea, ideally it should work. But surprisingly it just shows a blank page in the inspect tab even with the extensions enable. React dev tools seems to work just fine.

samuel17:03:27

Thanks Tony for looking into

tony.kay18:03:26

If you figure it out, let me know…be happy to have a patch or instructions to add to the book