Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ripple vs. reactive #3

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

ripple vs. reactive #3

matthewmueller opened this issue Mar 4, 2014 · 5 comments

Comments

@matthewmueller
Copy link
Contributor

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

@anthonyshort
Copy link
Contributor

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.

@anthonyshort
Copy link
Contributor

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

@matthewmueller
Copy link
Contributor Author

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.

@matthewmueller
Copy link
Contributor Author

oops i missed the last part hahaha

@anthonyshort
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants