flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sharma, Pratyoosh" <pratyoosh.sha...@jpmorgan.com>
Subject RE: [FlexJS] how much of Google closure goodies do we plan to use?
Date Tue, 15 Oct 2013 16:03:10 GMT
Makes sense, however there are practical considerations.

There are 2 ways in which people enable dragging on components:

Style 1:
PopUp.createPopUp(PopUpComponent: PopupContent,parentComponent: this,Title: "Component Popup
Test", dragEnabled: true, Modal:true);//default for dragEnabled can be true, this is the traditional
UI framework design & does offers convenience.

However this would mean that PopUp component needs to have a goog.require line for goog.fx.dragger
& since the dependency tree has to be calculated at the time of compilation, this class
will be included in this case if not instantiated.

Style 2:

var popup:PopUpComponent  = PopUp.createPopUp(PopUpComponent: PopupContent,parentComponent:
this,Title: "Component Popup Test", Modal:true) as PopUpComponent;
popup.addBead(new PopUpDragBead());

In Scenario 2, the inclusion of PopUpDragBead can be tracked by the compiler for inclusions
& compile time optimizations can be performed for only including the drag & drop support
only if "PopUpDragBead" is referred.
This will grow tedious over time IMHO, runtime loading is not a good idea for features like
drag & drop.
Conditional compilation is another idea, but that would mean too many switches on the compilation
arguments, I particularly dislike it.

With all of this being said I am not authority on either Closure optimizations or code usability
but are there other ways to optimize?

Thanks,
Pratyoosh 

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: Monday, October 14, 2013 5:58 PM
To: dev@flex.apache.org
Subject: Re: [FlexJS] how much of Google closure goodies do we plan to use?

Good question.  In general, unless we suspect that there is a way to do it with better performance
or smaller footprint, we'd probably use a Google Closure library implementation.

The most important thing though, is to make sure that the inclusion in FlexJS is pay-as-you-go
so you only pick up the extra download if you are actually using drag-drop.  We may also investigate
ways to bring in the drag-drop code after startup.  No need to initialize interaction handling
until there is something to handle.  This is why I hope to see code packaged in small plug-ins
called "beads", so we can optimize when/if that code gets loaded and run.

-Alex

On 10/14/13 1:09 PM, "Sharma, Pratyoosh" <pratyoosh.sharma@jpmorgan.com>
wrote:

>I was thinking on dragging implementation for popups & seems that 
>libraries like closure abstracts a lot of it.
>Understanding that using these functions will start bringing in a lot 
>of closure classes into the download of FlexJS framework, it seems like 
>a lot of reinventing the wheel work to implement natively on FlexJS 
>Thoughts....
>
>Thanks,
>Pratyoosh
>
>This email is confidential and subject to important disclaimers and 
>conditions including on offers for the purchase or sale of securities, 
>accuracy and completeness of information, viruses, confidentiality, 
>legal privilege, and legal entity disclaimers, available at 
>http://www.jpmorgan.com/pages/disclosures/email.


This email is confidential and subject to important disclaimers and conditions including on
offers for the purchase or sale of securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
 

Mime
View raw message