Fork me on GitHub
#fulcro
<
2019-01-21
>
bbss04:01:40

I've been using fulcro for a webGL app, and recently added WebSockets to push some real-time data. It's not a whole lot, but eventually the browser would often aw-snap with memory issues. When inspecting the memory allocations with DevTools I noticed fulcro history popped up on a big chunk of the objects. I moved away from using mutations and started directly updating the state atom and so far it seems that solved the issue.

bbss04:01:26

Maybe there is a way to mark a mutation to not be added to history? And if this is the expected thing to do with big amounts of data that shouldn't be in history it might be useful to have a comment on that in the fulcro book.

bbss04:01:28

Caveat that by saying I'm not entirely sure it's resolved, but so far it does look like it reduced memory consumption significantly.

currentoor07:01:49

@bbss I don’t think you want to swap the atom directly, for one mutations get batched together and use requestAnimationFrame to give you better UI performance while mutations are happening

currentoor07:01:10

do you have a large number of rapid mutations?

currentoor07:01:18

have tried compressible mutations?

currentoor07:01:45

also history has a max-size config

currentoor07:01:15

which i believe you can configure in :reconciler-options when you create the fulcro app

currentoor07:01:38

:history and it defaults to 200

currentoor07:01:52

you can override that to be whatever you want

bbss08:01:12

@currentoor thanks for the suggestions! I did see the history option, will give that a shot. It updates around once per second.

tony.kay16:01:59

@bbss let me know if the history stuff has any problems…I don’t know that anyone has ever tried playing with it much.

pvillegas1219:01:28

Given the reference to this within a component defined in defsc, how can I retrieve the class for it?

tony.kay20:01:56

prim/get-component-class I think it is called

pvillegas1220:01:22

Can’t find it 😞

tony.kay22:01:37

react-type perhaps

hmaurer22:01:48

Good evening 🙂 Quick q: is it possible to use Hiccup-style markup with Fulcro? (like with Reagent)

hmaurer22:01:37

Well, I should rephrase. Surely it’s possible by doing some wrapping, but is support for it built-in?

tony.kay22:01:34

not built in…the fulcro functions are nearly identical

hmaurer22:01:35

Alright, thanks! Yes they are, I was just wondering because the shortcuts for classes/ids with hiccups are quite nice (first time using hiccup with the new lein template).

tony.kay00:01:43

yep, are are the same in Fulcro….`(div :.class#id.other-class ...)`