Fork me on GitHub
#hoplon
<
2015-08-05
>
ul04:08:48

@micha: thanks for clarification about hoplon alpha4! @micha, @alandipert: what the great discussion! My use case for dynamic cells is that: say, I have very complex SPA, with many “screens” having lot of derived data. And I really don't want to keep all derived data in memory and recalculate it on source data change for every screen when user is only on one screen at the moment. I want to do it only for current screen, which has its own limited scope about what cells are used by it. Some cells are screen-specific, some are common for entire app, some for group of screens.

alandipert04:08:24

@ul: thanks for clarifying, sounds like what we want also

alandipert16:08:58

i think we just figured out how to make cells auto-GC!

ul17:08:57

@alandipert: do not tease! tell!

alandipert17:08:46

there will be a global weakmap of cell -> [sinks, sources]

alandipert17:08:50

that’s basically it

alandipert17:08:00

so now instead of cells storing sinks and sources independently, they all appear in the weakmap

alandipert17:08:09

from which cells disappear automatically when GC'd

alandipert17:08:05

there appear to be workable shims available, so it should still work with ie9+

alandipert17:08:14

an implication is it’s not possible to see the whole graph necessarily anymore

alandipert17:08:36

i suppose it might never have been, if you created disparate subgraphs

alandipert17:08:01

anyway because the weakmap isn’t enumerable a cell must be had in order to look into the map

ul17:08:52

interesting. not the first time using global is elegant enough for cljs

ul17:08:02

it is usually smell in other languages

alandipert17:08:17

well, the javelin graph was already global in the sense that cells are ordered globally for propagation

alandipert17:08:04

so in that way it was already smelly simple_smile

ul17:08:52

ha, globals are smelly only when they are not safe

ul17:08:12

cljs has a bunch of tools to make them safe