flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS] MDL - Dynamic Child Problem
Date Wed, 22 Feb 2017 07:03:27 GMT

On 2/21/17, 11:51 AM, "piotrz" <piotrzarzycki21@gmail.com> wrote:

>One thing which I wanted to add to make you more understand.
>1) If component is instantiated in mxml and this component has added
>UpgradeElement as default - upgradeElement method from MDL will not be
>- Cause "componentHandler" do not exists yet.
>2) Once web is loaded and some component is created - logic will fire.
>I will wait for others voice also...

I don't think I fully understand the issue.  A summary of what code needs
to be run when might help.

FlexJS should always be PAYG in it implementations, but a library like MDL
can and should also look to improve developer productivity in general.
So, if there is some method that needs to be called in order to
dynamically add a child after page load we should see if that code can get
run on-demand, instead of just-in-case.  If StackOverflow shows that folks
are frequently forgetting to run this code, if we can run it for them, it
will be an advantage for FlexJS.

We should be able to control when/if such code runs by controlling the
lifecycle.  IMO, it is fine to say that folks must use mdl:Application
instead of basic:Application and mdl:Container instead of basic:Container
if that gives you control over the lifecycle that you need in order to
help your customer.  Mixing and matching from different component sets
doesn't need to be a guarantee.  Bonus if it works, but, IMO, no big deal
if it doesn't.

IMO, if you can wrap calls to addChild, you can figure out whether page
load has happened and run code for the user.  You also have the option to
postpone the initial DOM setup until after page loads.  IIRC, Cordova
Applications wait until Cordova gets setup before creates the DOM.  The
CSSFontFaceBead delays the DOM setup until after a font loads.  However,
if there is performance improvements to setting up the initial DOM without
calling this dynamic code, that's fine too.  Set a flag once the page load
is complete.


View raw message