membrane

https://github.com/phronmophobic/membrane
phronmophobic 2021-01-30T19:49:53.001600Z

new design post about membrane, https://blog.phronemophobic.com/reusable-ui-components.html . I would love feedback before I try to share it more widely: • what doesn't make sense? • what seems superfluous? • does anything need more explanation?

Oliver George 2021-01-30T21:22:33.003200Z

Quick thought as I scan through. I'm preloaded with re-frame assumptions so might be making incorrect assumptions. 1. calling get-count an effect seems confusing. I think of effects as changing the world. (I'll go back and read the other two posts, perhaps that's covered)

Oliver George 2021-01-30T21:23:09.003900Z

(at some point down the line it'd be interesting to compare/contrast with the react model approach)

phronmophobic 2021-01-30T21:23:37.004100Z

that's a good point

phronmophobic 2021-01-30T21:25:28.005500Z

I'm not sure there's a better name than "effect", but get-count isn't pure or referentially transparent. it may (and probably will) return different values on separate calls

phronmophobic 2021-01-30T21:26:56.007400Z

I wonder if a post that just does compare and contrast between different frameworks would be interesting

Oliver George 2021-01-30T21:28:33.009300Z

Not sure I have a clear thought but I'll keep it in mind.

Oliver George 2021-01-30T21:29:04.009800Z

(was going to compare with FSM but not sure it's a perfect analog. re-frame has related concepts)

Oliver George 2021-01-30T21:29:59.009900Z

Personally I like that idea and wish more maintainers did it. Sort of risky if you're less familiar with the other project - possibly someone close to re-frame might like to pair blog something.

👍 1
Oliver George 2021-01-30T21:30:17.010100Z

You do tend to see comparisons in project READMEs which contrast related work.

Oliver George 2021-01-30T21:30:34.010300Z

e.g. https://github.com/tonsky/datascript#differences-from-datomic

Oliver George 2021-01-30T21:30:58.010800Z

Really interested in what you're doing.

Oliver George 2021-01-30T21:31:51.011300Z

get-count observes, it's sort of an output.

phronmophobic 2021-01-30T21:35:04.012Z

I guess I was thinking of the effect handler as a public API for an application

Oliver George 2021-01-30T21:35:51.012800Z

Yep, makes sense as an API.

Oliver George 2021-01-30T21:39:13.014500Z

I'm curious to look more closely about how the UI knows it needs to update. I'm familiar with r/atom and views which subscribe - a system which faciliates "recording" watchers of atoms and triggering view refreshing. Not immediately seeing something similar.

Oliver George 2021-01-30T21:39:32.015Z

(I have to dash soon, but keep up the good work!)

phronmophobic 2021-01-30T21:43:12.018Z

the idea is the refresh strategy would be an independent decision. the strategy that's currently implemented is based on memoization. since everything receives and returns values, it generally works well and components aren't recalculated unless the arguments to the component have changed.

👍 1