These are chat archives for MetaStack-pl/MetaRx

18th
May 2016
Matthew Pocock
@drdozer
May 18 2016 15:50
Hi :) @mkotsbak was it you that pointed me to this project on scala.js?
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:20
Japp
I have contributed some improvements, so I know the project a bit
Matthew Pocock
@drdozer
May 18 2016 19:23
cheers
I've been not really developing complex web applications for a while because I couldn't find a good abstraction for the dynamic state
one of my stickign points has always been how you compose the requests to modify the data, rather than just compose the decomposition of the data
hence the little API I wrote yesterday, but it looks like MetaRx has this implemented already, hopefully
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:27
Two way binding works fine, but many of the operations is not supporting it though
Matthew Pocock
@drdozer
May 18 2016 19:27
because they can't or because it hasn't been implemented yet?
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:27
Anyway in most cases you probably don't want two way binding because it makes things complicate, but rather update the model with an API that updates the state that is automatically propagated by the Rx-es
Not implemented
Like the operators I contributed just works one way. So val v = Var(5); w = v * 5 can't update v if w changes
I probably could have implemented that for simple cases like this, so that the operator does a bimap with / the other way. But other cases like x = v w is impossible to implement automatically what a change of x should mean
Matthew Pocock
@drdozer
May 18 2016 19:31
ah, well that would be difficult, as (_*5) isn't a bijection :)
is there an addon-library that makes shapeless lenses into MetaRx bijections?
Matthew Pocock
@drdozer
May 18 2016 19:44
Not quite - it is sort of what happens inside lenses over case classes
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:45
That code probably can be included now, as I think Shapeless is supported in SJS?
Matthew Pocock
@drdozer
May 18 2016 19:46
there is certainly a shapeless build for sjs
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:46
Maybe you could try to add that code block and probably also add a dependency on shapeless
Send a PR if if works
@tindzk what do you think about Shapeless Lens?
Matthew Pocock
@drdozer
May 18 2016 19:48
if tieing MetaRx to shapeless isn't on the cards, then a MetaRx-Shapeless module would also work
Marius B. Kotsbak
@mkotsbak
May 18 2016 19:56
I'm not sure if it would be a problem to add a dependency on Shapeless. Probably not as the code was already there.
If it is, it could be a separate module yes
Matthew Pocock
@drdozer
May 18 2016 20:42
have you used MetaRx with a virtual dom? so the input reactive data gets converted through the Rx pipeline into a reactive vdom data structure, which the vdom library then uses to patch the browser state?
@mkotsbak or did you work with scalatags?
Marius B. Kotsbak
@mkotsbak
May 18 2016 20:43
No, mostly with Widok: http://widok.github.io/
It uses direct updates without any vdoms
But it also works with SJS react
Matthew Pocock
@drdozer
May 18 2016 20:45
does widok use MetaRx as its reactive model, or does it have yet another one?
Tim Nieradzik
@tindzk
May 18 2016 20:57
@mkotsbak If we wanted to add support for Shapeless, it should be done in a sub-project. The core project should not have any external dependencies.
@drdozer Yes, it is based on MetaRx
You could use MetaRx with ScalaTags
Tim Nieradzik
@tindzk
May 18 2016 21:02
@mkotsbak In the last version we added Dep which allows you to model bijections: http://metastack.pl/metarx/latest.html#dependency-channels
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:05
Ok
Matthew Pocock
@drdozer
May 18 2016 21:09
are you using widok 0.2.4 or 0.3.0-SHAPSHOT? Before I convert a whole legacy project over ;)
Tim Nieradzik
@tindzk
May 18 2016 21:09
Use the SNAPSHOT version
We should probably release a new version soon
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:11
@tindzk I tried to upgrade to the latest MetaRx etc, but the tests fail, could you spot the error: mkotsbak/widok@e9c66fd
Tim Nieradzik
@tindzk
May 18 2016 21:13
Oh, great. I think MetaRx uses an older Scala.js version
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:13
Hmm ok, maybe that should be upgraded first
Even though they in theory should be compatible
Tim Nieradzik
@tindzk
May 18 2016 21:14
I have done that today in my new branch, but there are also some other breaking changes
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:14
Tried building it for Scala native? :)
Tim Nieradzik
@tindzk
May 18 2016 21:14
Haha, not yet ;)
But I was thinking about it
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:15
I'm quite sure something is missing there
Tim Nieradzik
@tindzk
May 18 2016 21:16
What would you suggest? Do you think it's worth it releasing a new version just with the dependencies updated, or should I finish my changes first and then release v0.2?
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:32
I would suggest to get it working with the latest released metarx first
Tim Nieradzik
@tindzk
May 18 2016 21:35
In that case, you'll have to use 0.6.6 if I'm not wrong
Marius B. Kotsbak
@mkotsbak
May 18 2016 21:37
Hmm, that's bad. Maybe we should wait then
Tim Nieradzik
@tindzk
May 18 2016 21:40
Ok, that's fine. I want to fix some design issues in v0.2.
It would be nice if we could do this for example: Var(5).map(_ + 1).get == 6
Right now, we need to call cache