localvoid / uix

[UNMAINTAINED] Dart Web UI library
BSD 2-Clause "Simplified" License
77 stars 4 forks source link

Comments #7

Open cgarciae opened 9 years ago

cgarciae commented 9 years ago

I've been needing a light weight solution (lighter than Angular) to interact with the DOM. I have certain doubts to what kind of things I can replicate from Angular with React-style frameworks.

  1. Can I have two parts of the app update at once? Say the typical "changing the text in an input changes the text somewhere else".
  2. Can I access and modify one component from another? (this currently though in Angular)

Now regarding UIX, can you maybe update the readme to explain what vRoot, vComponent, and such, are? I get the basic intuition from the few thing I know about React, but since your API is different you don't get the free documentation as the react-dart project.

Is it possible that you changed the names to their React counterparts when ever possible? Not because I think you should copy React, just to lower the learning curve.

Also, this is on another issue: can you NOT use the call method? It looks nice but ruins autocompletion, make learning harder.

localvoid commented 9 years ago
  1. Can I have two parts of the app update at once? Say the typical "changing the text in an input changes the text somewhere else".

If you are asking about two-way databinding, uix doesn't have form components with two-way databinding support. If you are asking about updating several parts of ui using the same data source, then just listen for input events, perform updates to the data and update views. uix is just a view library.

  1. Can I access and modify one component from another? (this currently though in Angular)

Yes, it is possible to get access to components using cref property, but most of the time there are better ways for intercomponent communication, like dart stream.

Now regarding UIX, can you maybe update the readme to explain what vRoot, vComponent, and such, are? I get the basic intuition from the few thing I know about React, but since your API is different you don't get the free documentation as the react-dart project.

I am not sure that I will be able to explain how virtual dom works better than React docs/videos. It is all about understanding the core ideas, and not some small api differences.

The main difference is that creating real html root element and performing updates to the subtree is completely separated in uix components, that is why there are special vRoot virtual node that can be used to update classes, styles and attributes for the root element.

canvas example even don't use any virtual dom api to perform updates in canvas component.

Is it possible that you changed the names to their React counterparts when ever possible? Not because I think you should copy React, just to lower the learning curve.

uix api supports more edge cases.

Also, this is on another issue: can you NOT use the call method? It looks nice but ruins autocompletion, make learning harder.

It is possible to create virtual nodes with children using named argument children:

vComponent(MyComponent,
  children: [
    vElement('div'),
    vElement('span')
  ]);

new VNode.component(MyComponent,
  children = [
    new VNode.element('div'),
    new VNode.element('span')
  ]);

// or just assign to the children property

new VNode.component(MyComponent)
  ..children = [
    new VNode.element('div'),
    new VNode.element('span')
  ];
localvoid commented 9 years ago

uix is just a view library like React, and I am not sure that I will be able to write guides, docs that will explain how to build ui applications(core ideas that doesn't depend on some specific library or framework). There are many good articles, tutorials about different ui app architectures like Flux, Relay and many others.

cgarciae commented 9 years ago

@localvoid Thanks for all your replays! You have the bad luck of having to respond to a Dart user that has never used ReactJs. So probably most of my question are out of place.

I am still adapting to this style.