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

omniscient on top of vtree + vdom #49

Open
Gozala opened this issue Feb 10, 2015 · 7 comments
Open

omniscient on top of vtree + vdom #49

Gozala opened this issue Feb 10, 2015 · 7 comments

Comments

@Gozala
Copy link
Contributor

Gozala commented Feb 10, 2015

I'd be like to get omniscient to a point where it can be used with vtree+ vdom instead of react for few reasons:

  1. Pure functional philosophy seem to match better.
  2. I'm interested in running some components in the web worker which is relatively easy with vtree + vdom
  3. Unlike with react vtree can be used with any namespace and has no attribute blacklist, which enable me to use it with xul and not yet standard / not yet supported html attributes.
@Gozala
Copy link
Contributor Author

Gozala commented Feb 10, 2015

I'd be willing to give it a shot, as it maybe enable me to omniscient for the a next project.

@Gozala Gozala changed the title omniscient on top of [vtree](https://github.com/Matt-Esch/vtree) + [vdom](https://github.com/Matt-Esch/vdom) omniscient on top of vtree + vdom Feb 10, 2015
@Gozala
Copy link
Contributor Author

Gozala commented Feb 10, 2015

I just need to know if project owners will be interested in taking patches to enable this.

@phated
Copy link
Contributor

phated commented Feb 10, 2015

This seems like it should be an adapter that can be passed to withDefaults instead of completely changing the guts of this lib.

@Gozala
Copy link
Contributor Author

Gozala commented Feb 10, 2015

@phated sure passing something to withDefaults seems like a good path to introduce alternative to react. That being said it's hard for me to speculate whether it will still require changes to guts of library, I suspect it will as there are no lifecycle methods in vtree, it's approach is define a function that returns a vtree and use whatever caching mechanism you want internally to return same tree if passed arguments are equivalent ones passed previously.

@mikaelbr
Copy link
Member

As I mentioned on Gitter, as there are a few things that's "missing" from usage with virtual-dom and React, I don't think Omniscient is/should be quite capable to have this as a drop-in replacement, but I think a good approach would be to have a separate module patching the differences between React and virtual-dom, and this can be passed as an "modifier" in withDefaults.

This module would need something like: Mixin support, patching shouldComponentUpdate, methods for creating components (instead of React.createElement and React.createClass).

I think it makes sense having this outside core, to avoid many ifs, it nots and thens and all other switch cases. As maybe 95% of the cases with Omniscient would use React.

@torgeir
Copy link
Member

torgeir commented Feb 11, 2015

I'd say have at it! I'm also for a something separate, but pluggable, and a couple of more hooks in omniscient in contrast to a complete rewrite. But I reckon some changes are needed. Why don't you have a go and see what path it takes

@dashed
Copy link
Contributor

dashed commented Feb 12, 2015

Someone had concerns on depending on a specific virtual dom library, and was able to create something that would compile to various targets:
https://github.com/gcanti/uvdom
https://gcanti.github.io/resources/uvdom/demo/views.html
https://gcanti.github.io/2014/10/29/understanding-react-and-reimplementing-it-from-scratch-part-1.html

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

5 participants