You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2016/06/08 16:34:15 UTC

[FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Hi,

I just pushed changes to create more named configs for FlexJS.  I don't
know how many folks were aware, but named configs can be used to more
easily switch defaults at compile time.  If you've ever built both Web and
AIR/Mobile apps, you were using named configs whether you knew it or not.

The compiler supports a +configname option.  The default configname is
"flex" which is why, when building Web apps, the compiler uses
flex-config.xml.  But when you compile an AIR app, especially if you use
command-line launchers like amxmlc instead of mxmlc, your compile settings
either specifically said to use air-config.xml, or used +configname=air to
tell the compiler to use air-config.xml instead of flex-config.xml.

The changes I just pushed add more named configs, so you can use
+configname=js to get the default compiler options for JS-only projects,
or +configname=node to get default compiler options for NodeJS projects,
and similar for JQuery and CreateJS projects.

By packaging defaults into named config files, it will hopefully make it
easier for IDE vendors to keep up with changes to FlexJS.  Instead of each
IDE vendor needing to know the full set of SWCs and other options for the
various project types, they should now be able to tell the compiler to
load one of these -config.xml files instead.  I'm hopeful, for example,
that FDT will do such a thing.  We've been discussing it in this JIRA
issue: http://bugs.powerflasher.com/jira/browse/FDT-3661

Thanks,
-Alex


Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Alex Harui <ah...@adobe.com>.

On 6/9/16, 12:53 PM, "Josh Tynjala" <jo...@gmail.com> wrote:

>I didn't know about {project-name}-config.xml. That could be really
>useful.
>{project-name} would be the name of the main class you pass to the
>compiler
>right, so if I had HelloWorld.as, it would be HelloWorld-config.xml?

Yes.  In flex-sdk, in the frameworks/tests/basicTests folder is an example.

-Alex


Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Josh Tynjala <jo...@gmail.com>.
I didn't know about {project-name}-config.xml. That could be really useful.
{project-name} would be the name of the main class you pass to the compiler
right, so if I had HelloWorld.as, it would be HelloWorld-config.xml?

- Josh

On Thu, Jun 9, 2016 at 12:47 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/9/16, 9:47 AM, "jude" <fl...@gmail.com> wrote:
>
> >Is it possible to use local config files? So using your example, we could
> >create a ../src/jquery-cordova-googlemaps-config.xml config in your
> >project?
>
> For sure. You can create bunches of -config.xml files and specify them
> with -load-config, but you can only use +configname once.  And also, the
> compiler automatically loads {project-name}-config.xml if there is one.
>
> -Alex
>
>

Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Alex Harui <ah...@adobe.com>.

On 6/9/16, 9:47 AM, "jude" <fl...@gmail.com> wrote:

>Is it possible to use local config files? So using your example, we could
>create a ../src/jquery-cordova-googlemaps-config.xml config in your
>project?

For sure. You can create bunches of -config.xml files and specify them
with -load-config, but you can only use +configname once.  And also, the
compiler automatically loads {project-name}-config.xml if there is one.

-Alex


Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by jude <fl...@gmail.com>.
Is it possible to use local config files? So using your example, we could
create a ../src/jquery-cordova-googlemaps-config.xml config in your project?

On Thu, Jun 9, 2016 at 10:22 AM, Josh Tynjala <jo...@gmail.com> wrote:

> It occurred to me too that a separate SWC for browser APIs would make
> sense, since Node should only need a subset of JS types from js.swc. I
> think it's a good idea.
>
> - Josh
>
> On Thu, Jun 9, 2016 at 8:17 AM, Alex Harui <ah...@adobe.com> wrote:
>
> >
> >
> > On 6/9/16, 4:25 AM, "Harbs" <ha...@gmail.com> wrote:
> >
> > >Nice.
> > >
> > >This should make things much easier. Good direction!
> >
> > Thanks.  There are some limitations because the naming scheme is
> > one-dimensional.  For example, I did not create a cordova-config.xml
> > because you might actually use Jquery as the UI framework in a Cordova
> app
> > and/or Google Maps in the same app and then we'd need every combination
> of
> > configname (jquery-cordova-googlemaps-config.xml)
> >
> > Also, it occurred to me that now that we have named configs, we can
> > re-think some of how the externs SWCs are configured.  For example, the
> > node-config.xml references js.swc, but I'm now wondering if we should
> > break out the browser APIs from js.swc into a browser.swc so anyone doing
> > node work won't be offered Window/Document/MouseEvent in the
> > code-assistance.  Then we can make such changes behind the named-configs
> > and affect fewer people.
> >
> > Thoughts?
> > -Alex
> >
> >
>

Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Josh Tynjala <jo...@gmail.com>.
It occurred to me too that a separate SWC for browser APIs would make
sense, since Node should only need a subset of JS types from js.swc. I
think it's a good idea.

- Josh

On Thu, Jun 9, 2016 at 8:17 AM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 6/9/16, 4:25 AM, "Harbs" <ha...@gmail.com> wrote:
>
> >Nice.
> >
> >This should make things much easier. Good direction!
>
> Thanks.  There are some limitations because the naming scheme is
> one-dimensional.  For example, I did not create a cordova-config.xml
> because you might actually use Jquery as the UI framework in a Cordova app
> and/or Google Maps in the same app and then we'd need every combination of
> configname (jquery-cordova-googlemaps-config.xml)
>
> Also, it occurred to me that now that we have named configs, we can
> re-think some of how the externs SWCs are configured.  For example, the
> node-config.xml references js.swc, but I'm now wondering if we should
> break out the browser APIs from js.swc into a browser.swc so anyone doing
> node work won't be offered Window/Document/MouseEvent in the
> code-assistance.  Then we can make such changes behind the named-configs
> and affect fewer people.
>
> Thoughts?
> -Alex
>
>

Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Alex Harui <ah...@adobe.com>.

On 6/9/16, 4:25 AM, "Harbs" <ha...@gmail.com> wrote:

>Nice.
>
>This should make things much easier. Good direction!

Thanks.  There are some limitations because the naming scheme is
one-dimensional.  For example, I did not create a cordova-config.xml
because you might actually use Jquery as the UI framework in a Cordova app
and/or Google Maps in the same app and then we'd need every combination of
configname (jquery-cordova-googlemaps-config.xml)

Also, it occurred to me that now that we have named configs, we can
re-think some of how the externs SWCs are configured.  For example, the
node-config.xml references js.swc, but I'm now wondering if we should
break out the browser APIs from js.swc into a browser.swc so anyone doing
node work won't be offered Window/Document/MouseEvent in the
code-assistance.  Then we can make such changes behind the named-configs
and affect fewer people.

Thoughts?
-Alex


Re: [FLEXJS] Named Configs for JS, JQuery, Node, and CreateJS

Posted by Harbs <ha...@gmail.com>.
Nice.

This should make things much easier. Good direction!

On Jun 8, 2016, at 12:34 PM, Alex Harui <ah...@adobe.com> wrote:

> Hi,
> 
> I just pushed changes to create more named configs for FlexJS.  I don't
> know how many folks were aware, but named configs can be used to more
> easily switch defaults at compile time.  If you've ever built both Web and
> AIR/Mobile apps, you were using named configs whether you knew it or not.
> 
> The compiler supports a +configname option.  The default configname is
> "flex" which is why, when building Web apps, the compiler uses
> flex-config.xml.  But when you compile an AIR app, especially if you use
> command-line launchers like amxmlc instead of mxmlc, your compile settings
> either specifically said to use air-config.xml, or used +configname=air to
> tell the compiler to use air-config.xml instead of flex-config.xml.
> 
> The changes I just pushed add more named configs, so you can use
> +configname=js to get the default compiler options for JS-only projects,
> or +configname=node to get default compiler options for NodeJS projects,
> and similar for JQuery and CreateJS projects.
> 
> By packaging defaults into named config files, it will hopefully make it
> easier for IDE vendors to keep up with changes to FlexJS.  Instead of each
> IDE vendor needing to know the full set of SWCs and other options for the
> various project types, they should now be able to tell the compiler to
> load one of these -config.xml files instead.  I'm hopeful, for example,
> that FDT will do such a thing.  We've been discussing it in this JIRA
> issue: http://bugs.powerflasher.com/jira/browse/FDT-3661
> 
> Thanks,
> -Alex
>