Re: render() - a better way?
What you are describing is how gxt v2 worked. It was a nightmare to reconcile the two rendering methods.
Also tightly coupling the various widgets and views into a single render call makes the whole less responsive. When I are attach something to the Dom, I expect it to render.
On Jan 10, 2014 10:12 AM, "Joel" <joel@harpsoft.com> wrote:
>
>
> Yeah, I didn't know how "shadow dom" would work and how to get the diffs, and write the changes... basically how the guts of gwt works.
>
> Maybe the benefit is less than it sounds.
>
>
> On Friday, January 10, 2014 11:24:26 AM UTC-6, Thomas Broyer wrote:
>>
>> You're basically asking about a "ReactGWT" ;-)
>> http://facebook.github.io/react/
>>
>> Feasible, but a "bit" of work.
>>
>> On Friday, January 10, 2014 4:06:07 PM UTC+1, Joel wrote:
>>>
>>>
>>> I've been thinking about how I can apply a more "functional" approach to GWT development.
>>>
>>> Currently, the view classes change the DOM based on events, for example, change the style of this thing, clear and add children to this other thing, hide/show another thing. However, what if I could move all the rendering to one method (as done in desktop apps). That way I change the state and call render (usually this would be deferred thru a refresh() method). The reason being is that you can avoid reasoning about state... "How did this widget get looking like this?" and have to trace the events leading up that situation. Instead you are simply drawing what the current/complete state is.
>>>
>>> A naiive implementation (in GWT), would be to have a render() method that refreshes everything, however, it would also need to "reset" stuff as well, when state changes, you'd call render(). Of course, this wouldn't be efficient, possibly "flickery". Facebook React works this way, however, they calculate the differences in a shadow DOM, and then only write differences to the browser DOM, and its very efficient.
>>>
>>> Would this kind of approach be feasible in GWT? IMO, it would simplify things.
>>> Thomas weighing in on this would be great.
>>>
>>> Joel
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home