On 6/23/15, 5:44 AM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote:

>On Tue, Jun 23, 2015 at 8:36 AM, Frédéric THOMAS <webdoubl...@hotmail.com>
>wrote:
>
>> It worked, it was just because I didn't know well how to use jQuery in
>> that context, so, I will create utility classes to deal with
>>downloading of
>> scripts and css if no one see any issue to this approach ?
>>
>> The one I see compare to a new language feature is that it will create a
>> delay for the generated page before it will be totally functioning, in
>>the
>> other hand, a new language feature is much more complicated to
>>implement.
>>
>
>Fred, can you elaborate on this? I don't quite understand what you are
>saying, .... "an new language feature", for the loading of scripts and
>dependencies?

Let’s sync up a bit here so we don’t duplicate effort.  By ‘bootstrap
infrastructure’, I mean everything else that is needed to truly run an
app.  Just look at a slightly more complex HelloWorld.as example.  It
needs an index.html, probably a CSS file or two, and then it has to load
more than just the cross-compiled .js file.  It may need to load Jquery,
or other .js files that represent components like a Label or Button.

Today, with the nightly build with FLEXJS as the js-output-type,
MXMLFlexJSPublisher.java will generate an index.html, and a CSS file if
required.  That index.html will load .js files using goog.require.  We
have discussed how to get Jquery loaded by inserting a magic token in some
AS comments.

Besides goog.require, other popular script loading systems are RequireJS
and I think AMD and maybe others.  It isn’t clear to me there is any
advantage to writing our own because these loading systems are well-tested
by now, and I think some companies and “standardized” on one of them so
writing our own may not be a solution that always gets adopted.  That is
one reason FlexJS supports JQuery: some companies have standardized on it.

So, I’m not quite clear what you are working on.  If you want to create a
new loading system that’s fine, but IMO we also need a way for folks to
choose the loading system of their choice.  I would imagine we’d allow
folks to select different js-output-type that not only selects a backend,
but also selects a publisher, but I haven’t thought this all the way
through.

-Alex

Reply via email to