Fork me on GitHub
#fulcro
<
2019-11-08
>
tony.kay03:11:42

Fulcro 3.0.8 is out, with a few bug fixes, and new support for easier binary return values from server mutations: http://book.fulcrologic.com/fulcro3/#_binary_return_values

šŸŽ‰ 32
šŸ‘ 12
cjmurphy16:11:43

@tony.kay I'm getting a stack trace in the browser for "3.0.8", but not for "3.0.6". I've got a little one button application that illustrates. I know that I did not see this failure for "3.0.3" - my current project works fine at "3.0.3". My guess is that it is a timing / project size related problem. I'm not running on a fast machine. Anyone else who tries might not get the same problem. It is setup for failure at the moment, at "3.0.8": https://github.com/chrismurrph/tempids-test.

tony.kay17:11:16

do you have the full st? That is an abbreviated one

tony.kay17:11:59

nvmā€¦I can reproduce

tony.kay17:11:29

ah, this was a change to a DOM helper to make it more efficient

tony.kay17:11:42

clearly it isnā€™t quite right

tony.kay17:11:47

@cjmurphy Upgrade to fulcro-garden-css 3.0.7

tony.kay17:11:52

it still has some internal issues I need to resolveā€¦.the param support just isnā€™t quite right

cjmurphy17:11:29

Got it. Yes 3.0.8 with fulcro-garden-css 3.0.7 works fine on my main project. Thanks.

cjmurphy18:11:22

Actually I got the same stack trace in my main project, this time when navigating to another page. So for now Fulcro 3.0.3 with fulcro-garden-css 3.0.7 is what works for me.

tony.kay18:11:45

So, I had done a recent optimization that didnā€™t cause problems for me, but it was only because I didnā€™t end up running it šŸ˜œ

šŸ˜… 4
tony.kay18:11:23

The optimization makes DOM elements, when used as functions (not macros) to take 3 microseconds each (the old ones take nearly 3ms each.

tony.kay18:11:55

and I wrote tests, but I didnā€™t A/B compare the old output with the new šŸ˜• So, I thought they were right, but in fact they were very different

tony.kay18:11:16

So, I put the old impl in the test and had the tests do A/B comparisonsā€¦that should fix it.

tony.kay18:11:46

Try Fulcro 3.0.9-SNAPSHOT @cjmurphy

cjmurphy18:11:54

Yep that one's good!

šŸ‘ 4
tony.kay18:11:46

that seems to work for me in about every combination I can think of

tony.kay18:11:00

Iā€™ll make a new release

tony.kay19:11:06

3.0.9 Released. CSS Localized DOM factories should now be roughly 1000x faster than they were before. The non-macro version of the DOM factories had a call to clojure spec in them that was very slow. This didnā€™t affect regular DOM that often (the macro is usually used), but it did affect garden-css dom elements. This will also speed up any functional application of regular dom factories (e.g. (map dom/li ā€¦)) by the same amount.

šŸŽ‰ 28
twicebaked21:11:01

This is more of a query for opinions, but I was wondering how to best handle a common case in my app where I need to call into a 3rd party JS API I don't control, but to do so I need to make some heavy use of the App DB state for mainly query purposes, not actual mutations. Is it better to handle all these cases via mutations given I often don't need to change the App DB itself during these operations? Technically, many of these operations change the UI but not through my own code. I'm slowly trying to hijack what I can and control it with a data-driven approach, but some of it is just not possible/will be a performance nightmare. There are some benefits I can see up-front like making it easier to transition where I can to data-driven approaches and to introduce things like instrumentation, however I could just kick off some additional mutations from elsewhere I suppose.

mruzekw21:11:44

Iā€™m not a fulcro expert in the slightest, but I think pushing any third-party APIs to the backend with Panthom resolvers might be the best move to keep the front-end patterns consistent

twicebaked21:11:13

well the actual work in the mutations, at least for the part I'm talking about has to be work on the front-end

twicebaked21:11:26

a good example - changing the cursor position in an editor component

twicebaked21:11:57

the thing is the actual actions are kicked off asynchronously by a dispatch mechanism that only the editor controls so there's no "click" event type thing in the UI to listen for

mruzekw21:11:57

A third-party API is driving the cursor position?

twicebaked21:11:42

yeah, the 3rd party component mutates itself and I do my best to track the pieces of state I need elsewhere, ex: by listening to keypresses and change events

mruzekw21:11:06

Does the 3rd party component provide a ā€œcontrolledā€ version?

twicebaked21:11:08

but the thing I'm unsure about is the case where they kick off a lot of async actions (some of which are provided by me)

mruzekw21:11:34

Where it doesnā€™t keep itā€™s own state

twicebaked21:11:36

well I should mention it's also not a react component

twicebaked21:11:50

state is everywhere inside it as it is a huge component

twicebaked21:11:22

forking it would also be a pain as that in itself would be a project to keep up with the mainline

twicebaked21:11:42

it has a sort of command system where it will kick off any commands I provide async, so I just did a first pass of a few as mutations and they work well, but at this point I'm realizing I can split out a ton of things outside a mutation when nothing is updated in the app db state

mruzekw21:11:42

Iā€™m not sure of the perf impact to be honest. But it may be worth minimizing interaction given you donā€™t need to mutate anything

twicebaked21:11:46

the thing is that would require me to constantly reach for the "app" manually which is fine, but the mutation system sort of provides more convenient access and a bunch of other things that are handy

twicebaked21:11:33

if I do the work inside a mutation, I also can at least see that something in the UI changed even if I can't really undo it without some manual steps sometimes

twicebaked21:11:21

ex: the editor has its own undo stack so without double recording state changes, I have to call their undo stack to be in sync

mruzekw21:11:17

I would use what it already provides.

mruzekw21:11:42

Or find a simpler alternative, depending on your needs

mruzekw21:11:49

(Is this DraftJS?)

twicebaked21:11:33

I'm just trying to proxy in a larger environment that uses this editor and adapts the environment's command system with the editors so there's no avoiding it really

twicebaked21:11:34

it would be like in IntelliJ needing the text editor to integrate and respond to the same action system as the file explorer for example. It's not an IDE or anything, but there's some overlap of concepts and some editing that needs to be done so it's at least similar.

mruzekw21:11:40

Hopefully someone can be of more help in this case.

twicebaked21:11:00

well I think talking about it definitely helps as it stirs up some other thoughts in my mind, so very helpful regardless, thanks