Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ripple vs. reactive #3

Closed
matthewmueller opened this Issue Mar 4, 2014 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

matthewmueller commented Mar 4, 2014

would love to see a little section in the readme or this issue about the differences / design decisions between these two reactive engines.

Owner

anthonyshort commented Mar 4, 2014

I'm still finishing ripple :)

But the main differences are they way it handles models and composing views. Ripple doesn't really do anything other than giving you a nice way to compose views inside of each other, add bindings, and use interpolation.

I'm aiming for it to be more like React, where you can compose views and data flows in one direction. This means I could create a TodoList view, and render it inside other views using a custom element.

View.compose('TodoList', TodoList);
<TodoList items="{{ todos }}"></TodoList>

Data from parent can change and update this view. So whenever the parent views todos property changes, it updates the TodoList, sort of like child.set('todos', newTodos);

So it doesn't take your model and wrap it in an adapter like Reactive, instead it uses plain objects and watches them for changes.

I'm still figuring out how data should be passed around, how model interaction works, and if things like computed properties are needed. It's really difficult. So I'm toying with various examples and projects to find something that works.

Owner

anthonyshort commented Mar 4, 2014

That said, it's attribute bindings are exactly the same as Reactive, they get used as plugins and they aren't included by default.

Contributor

matthewmueller commented Mar 4, 2014

Ah interesting thanks for the detailed response.

Have you tried just using JSON structures with object.observe for your models? it seems like that might be the best approach to support both ORM and plain JSON.

Contributor

matthewmueller commented Mar 4, 2014

oops i missed the last part hahaha

Owner

anthonyshort commented Mar 4, 2014

Yeah they're just plain JSON-able objects for models that get wrapped in this https://github.com/ripplejs/model so I can watch it for changes.

Ideally we'll be able to remove set and use Object.observe at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment