You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Erin Noe-Payne <er...@gmail.com> on 2013/02/14 05:29:07 UTC

Refactor of Rave javascript

With the my recent patches and the previous thread on underscore.js, I am
beginning work on refactor rave's javascript base to better modularize
functionality and isolate dependencies. I have laid out a roadmap for the
refactor listed the primary goals in a new epic (
https://issues.apache.org/jira/browse/RAVE-891). They are copied below.
Please give any feedback.


Goals:
- refactor rave js with extensibility in mind. Build modules to be
configurable, and write the default rave ui / client as a configuration
rather than hard-coded.
- Look for opportunities and keep focus on backend as services delivering
json data, reduce the workload of thick views (jsps). Allow the client to
manage views and state with more flexibility

Roadmap:
- Establish rave.ui namespace that manages all ui interactions
- Find all instances of inline html and dom building in rave.js, move to
client side templates available on rave.ui.templates
- Isolate all dependencies on jquery, handlebars and other libraries inside
rave.ui files (except ajax), such that an implementer could remove these
dependencies and easily replace with an implementation using other dom
manipulation or templating libraries. The only dependency of rave core code
should be underscore.js utility library.
- Establish rave.ajax namespace. Isolate all jquery ajax dependencies here,
such that an implementer could overlay their implementation with a
preferred ajax library. See backbone.js sync for a reference (
http://backbonejs.org/#Sync).
- Update providers (rave_opensocial, rave_wookie) to establish a consistent
interface for gadget objects and properly set up and tear down gadgets.
Currently there are some issues with not correctly firing lifecycle events
or creating potential memory leaks with gadget closing.
- Investigate, refactor or remove rave_person_profile.js. Appears to be a
lot of duplicated code, not clear why it is a separate file.


Thanks,
Erin

Re: Refactor of Rave javascript

Posted by Matt Franklin <m....@gmail.com>.
On Wed, Feb 20, 2013 at 1:14 PM, Erin Noe-Payne
<er...@gmail.com> wrote:
> I've submitted the first major pull request for this epic at
> https://github.com/apache/rave/pull/3. Please review when you have the
> chance.
>
> Note that I did go back on an earlier comment I made to Chris and ended up
> introducing Backbone.js as a way to manage persistent state in models and
> move to event-driven views.

I will take a look today

>
>
> On Thu, Feb 14, 2013 at 8:22 AM, Matt Franklin <m....@gmail.com>wrote:
>
>> On Wed, Feb 13, 2013 at 11:29 PM, Erin Noe-Payne
>> <er...@gmail.com> wrote:
>> > With the my recent patches and the previous thread on underscore.js, I am
>> > beginning work on refactor rave's javascript base to better modularize
>> > functionality and isolate dependencies. I have laid out a roadmap for the
>> > refactor listed the primary goals in a new epic (
>> > https://issues.apache.org/jira/browse/RAVE-891). They are copied below.
>> > Please give any feedback.
>>
>> IMO this is great and I look forward to helping in any way I can.
>>
>> >
>> >
>> > Goals:
>> > - refactor rave js with extensibility in mind. Build modules to be
>> > configurable, and write the default rave ui / client as a configuration
>> > rather than hard-coded.
>> > - Look for opportunities and keep focus on backend as services delivering
>> > json data, reduce the workload of thick views (jsps). Allow the client to
>> > manage views and state with more flexibility
>> >
>> > Roadmap:
>> > - Establish rave.ui namespace that manages all ui interactions
>> > - Find all instances of inline html and dom building in rave.js, move to
>> > client side templates available on rave.ui.templates
>> > - Isolate all dependencies on jquery, handlebars and other libraries
>> inside
>> > rave.ui files (except ajax), such that an implementer could remove these
>> > dependencies and easily replace with an implementation using other dom
>> > manipulation or templating libraries. The only dependency of rave core
>> code
>> > should be underscore.js utility library.
>> > - Establish rave.ajax namespace. Isolate all jquery ajax dependencies
>> here,
>> > such that an implementer could overlay their implementation with a
>> > preferred ajax library. See backbone.js sync for a reference (
>> > http://backbonejs.org/#Sync).
>> > - Update providers (rave_opensocial, rave_wookie) to establish a
>> consistent
>> > interface for gadget objects and properly set up and tear down gadgets.
>> > Currently there are some issues with not correctly firing lifecycle
>> events
>> > or creating potential memory leaks with gadget closing.
>> > - Investigate, refactor or remove rave_person_profile.js. Appears to be a
>> > lot of duplicated code, not clear why it is a separate file.
>> >
>> >
>> > Thanks,
>> > Erin
>>

Re: Refactor of Rave javascript

Posted by Erin Noe-Payne <er...@gmail.com>.
I've submitted the first major pull request for this epic at
https://github.com/apache/rave/pull/3. Please review when you have the
chance.

Note that I did go back on an earlier comment I made to Chris and ended up
introducing Backbone.js as a way to manage persistent state in models and
move to event-driven views.


On Thu, Feb 14, 2013 at 8:22 AM, Matt Franklin <m....@gmail.com>wrote:

> On Wed, Feb 13, 2013 at 11:29 PM, Erin Noe-Payne
> <er...@gmail.com> wrote:
> > With the my recent patches and the previous thread on underscore.js, I am
> > beginning work on refactor rave's javascript base to better modularize
> > functionality and isolate dependencies. I have laid out a roadmap for the
> > refactor listed the primary goals in a new epic (
> > https://issues.apache.org/jira/browse/RAVE-891). They are copied below.
> > Please give any feedback.
>
> IMO this is great and I look forward to helping in any way I can.
>
> >
> >
> > Goals:
> > - refactor rave js with extensibility in mind. Build modules to be
> > configurable, and write the default rave ui / client as a configuration
> > rather than hard-coded.
> > - Look for opportunities and keep focus on backend as services delivering
> > json data, reduce the workload of thick views (jsps). Allow the client to
> > manage views and state with more flexibility
> >
> > Roadmap:
> > - Establish rave.ui namespace that manages all ui interactions
> > - Find all instances of inline html and dom building in rave.js, move to
> > client side templates available on rave.ui.templates
> > - Isolate all dependencies on jquery, handlebars and other libraries
> inside
> > rave.ui files (except ajax), such that an implementer could remove these
> > dependencies and easily replace with an implementation using other dom
> > manipulation or templating libraries. The only dependency of rave core
> code
> > should be underscore.js utility library.
> > - Establish rave.ajax namespace. Isolate all jquery ajax dependencies
> here,
> > such that an implementer could overlay their implementation with a
> > preferred ajax library. See backbone.js sync for a reference (
> > http://backbonejs.org/#Sync).
> > - Update providers (rave_opensocial, rave_wookie) to establish a
> consistent
> > interface for gadget objects and properly set up and tear down gadgets.
> > Currently there are some issues with not correctly firing lifecycle
> events
> > or creating potential memory leaks with gadget closing.
> > - Investigate, refactor or remove rave_person_profile.js. Appears to be a
> > lot of duplicated code, not clear why it is a separate file.
> >
> >
> > Thanks,
> > Erin
>

Re: Refactor of Rave javascript

Posted by Matt Franklin <m....@gmail.com>.
On Wed, Feb 13, 2013 at 11:29 PM, Erin Noe-Payne
<er...@gmail.com> wrote:
> With the my recent patches and the previous thread on underscore.js, I am
> beginning work on refactor rave's javascript base to better modularize
> functionality and isolate dependencies. I have laid out a roadmap for the
> refactor listed the primary goals in a new epic (
> https://issues.apache.org/jira/browse/RAVE-891). They are copied below.
> Please give any feedback.

IMO this is great and I look forward to helping in any way I can.

>
>
> Goals:
> - refactor rave js with extensibility in mind. Build modules to be
> configurable, and write the default rave ui / client as a configuration
> rather than hard-coded.
> - Look for opportunities and keep focus on backend as services delivering
> json data, reduce the workload of thick views (jsps). Allow the client to
> manage views and state with more flexibility
>
> Roadmap:
> - Establish rave.ui namespace that manages all ui interactions
> - Find all instances of inline html and dom building in rave.js, move to
> client side templates available on rave.ui.templates
> - Isolate all dependencies on jquery, handlebars and other libraries inside
> rave.ui files (except ajax), such that an implementer could remove these
> dependencies and easily replace with an implementation using other dom
> manipulation or templating libraries. The only dependency of rave core code
> should be underscore.js utility library.
> - Establish rave.ajax namespace. Isolate all jquery ajax dependencies here,
> such that an implementer could overlay their implementation with a
> preferred ajax library. See backbone.js sync for a reference (
> http://backbonejs.org/#Sync).
> - Update providers (rave_opensocial, rave_wookie) to establish a consistent
> interface for gadget objects and properly set up and tear down gadgets.
> Currently there are some issues with not correctly firing lifecycle events
> or creating potential memory leaks with gadget closing.
> - Investigate, refactor or remove rave_person_profile.js. Appears to be a
> lot of duplicated code, not clear why it is a separate file.
>
>
> Thanks,
> Erin