Re: ${body} in index template

2019-09-09 Thread Carlos Rovira
Hi,

I'm ok with new changes, maybe the problem is breaking all current apps,
since it implies to change all our examples and people out there take
notice of this change, since all apps will be failing.

I think the best way should be support the current vars, while introducing
new ones. Additionally, we could signal a deprecation so people can update
their codes and remove older method sometime in the future.

just my 2...


El sáb., 7 sept. 2019 a las 1:25, Alex Harui ()
escribió:

> FWIW, the current implementation was just a quick hack to get something
> working.  No serious thought went into it so feel free to change it.
>
> I think there are "projectName" and "mainClassQName" variables in the
> compiler.  IIRC, projectName maps to the output file name and
> mainClassQName maps to the name of the file that subclasses some
> Application that becomes the source file passed into the compiler.  Most of
> our examples have them as the same, but Carlos likes to build examples
> where the main class is App.mxml.
>
> IIRC, Flex always named the SystemManager subclass after the
> mainClassQName.  In Royale, any framework can use [FactoryClass] to setup
> some sort of SystemManager-like thing that loads the Application, so in my
> mind, there is an "EntryPointClass" or "StartupClass" and the main
> Application subclass.  Sometimes they are the same (for Basic and probably
> Jewel).
>
> I'm not concerned about breaking existing templates by not injection the
>  tags around the entry point code.  But that's just me.
>
> My 2 cents,
> -Alex
>
> On 9/6/19, 2:20 PM, "Greg Dove"  wrote:
>
> Hi Carlos,
>
> Based on the variation that happens, I'm not sure ${application} is
> useful
> in its current form, although at first glance it appeared to be when I
> used
> it.
>
> Probably we just need
> ${applicationclass}
>
> The code that handles this is here:
>
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-compiler%2Fblob%2Fa9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5%2Fcompiler-jx%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Froyale%2Fcompiler%2Finternal%2Fcodegen%2Fmxml%2Froyale%2FMXMLRoyalePublisher.java%23L832&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=cG%2FSBE05253%2BIduhPc8gbkyX0kStLLeHjizbKoHsXy8%3D&reserved=0
>
> And based on what it seems to be doing I think the ${applicationclass}
> token would just need to be substituted with the same value that is
> passed
> as the argument to getTemplateBody call here:
>
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-compiler%2Fblob%2Fa9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5%2Fcompiler-jx%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Froyale%2Fcompiler%2Finternal%2Fcodegen%2Fmxml%2Froyale%2FMXMLRoyalePublisher.java%23L879&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=OemmdJGiY6f9Nj1iLLgPUIee0E1GTZyQSr7Jvp4xNwE%3D&reserved=0
>
> so I'm guessing all it needs is:
> if (type.equals("release")) {
> result = input.replaceAll("\\$\\{applicationclass\\}",
> projectName );
> } else {
> result = input.replaceAll("\\$\\{applicationclass\\}",
> mainClassName );
> }
>
> But I did not check the variation between projectName and mainClassName
> between release and debug for that, so I don't fully understand that
> part
> yet. Maybe @aharui can confirm.
>
>
>
>
> On Fri, Sep 6, 2019 at 7:36 PM Carlos Rovira 
> wrote:
>
> > Hi Greg,
> >
> > so the proposal is to end with:
> >
> > -body
> > -application (used for standard Royale apps)
> > -AppClassName (for 

Re: ${body} in index template

2019-09-06 Thread Alex Harui
FWIW, the current implementation was just a quick hack to get something 
working.  No serious thought went into it so feel free to change it.

I think there are "projectName" and "mainClassQName" variables in the compiler. 
 IIRC, projectName maps to the output file name and mainClassQName maps to the 
name of the file that subclasses some Application that becomes the source file 
passed into the compiler.  Most of our examples have them as the same, but 
Carlos likes to build examples where the main class is App.mxml.

IIRC, Flex always named the SystemManager subclass after the mainClassQName.  
In Royale, any framework can use [FactoryClass] to setup some sort of 
SystemManager-like thing that loads the Application, so in my mind, there is an 
"EntryPointClass" or "StartupClass" and the main Application subclass.  
Sometimes they are the same (for Basic and probably Jewel).

I'm not concerned about breaking existing templates by not injection the 
 tags around the entry point code.  But that's just me.

My 2 cents,
-Alex

On 9/6/19, 2:20 PM, "Greg Dove"  wrote:

Hi Carlos,

Based on the variation that happens, I'm not sure ${application} is useful
in its current form, although at first glance it appeared to be when I used
it.

Probably we just need
${applicationclass}

The code that handles this is here:

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-compiler%2Fblob%2Fa9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5%2Fcompiler-jx%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Froyale%2Fcompiler%2Finternal%2Fcodegen%2Fmxml%2Froyale%2FMXMLRoyalePublisher.java%23L832&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=cG%2FSBE05253%2BIduhPc8gbkyX0kStLLeHjizbKoHsXy8%3D&reserved=0

And based on what it seems to be doing I think the ${applicationclass}
token would just need to be substituted with the same value that is passed
as the argument to getTemplateBody call here:

https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-compiler%2Fblob%2Fa9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5%2Fcompiler-jx%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Froyale%2Fcompiler%2Finternal%2Fcodegen%2Fmxml%2Froyale%2FMXMLRoyalePublisher.java%23L879&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=OemmdJGiY6f9Nj1iLLgPUIee0E1GTZyQSr7Jvp4xNwE%3D&reserved=0

so I'm guessing all it needs is:
if (type.equals("release")) {
result = input.replaceAll("\\$\\{applicationclass\\}",
projectName );
} else {
result = input.replaceAll("\\$\\{applicationclass\\}",
mainClassName );
}

But I did not check the variation between projectName and mainClassName
between release and debug for that, so I don't fully understand that part
yet. Maybe @aharui can confirm.




On Fri, Sep 6, 2019 at 7:36 PM Carlos Rovira 
wrote:

> Hi Greg,
>
> so the proposal is to end with:
>
> -body
> -application (used for standard Royale apps)
> -AppClassName (for Flex emulated apps that will have
> "_mx_managers_SystemManager" as part of the string. so this is really
> "{application}" + "_mx_managers_SystemManager")
>
> right?
>
> what do you think about
>
> -body
> -application
> -flexapplication
>
> ?
>
> (just trying to have the same style for names and simplifying to something
> more human readable)
>
> thanks!
>
>
> El vie., 6 sept. 2019 a las 5:16, Greg Dove ()
> escribió:
>
> > This seems 

Re: ${body} in index template

2019-09-06 Thread Greg Dove
Hi Carlos,

Based on the variation that happens, I'm not sure ${application} is useful
in its current form, although at first glance it appeared to be when I used
it.

Probably we just need
${applicationclass}

The code that handles this is here:
https://github.com/apache/royale-compiler/blob/a9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java#L832

And based on what it seems to be doing I think the ${applicationclass}
token would just need to be substituted with the same value that is passed
as the argument to getTemplateBody call here:
https://github.com/apache/royale-compiler/blob/a9fcf4f1f1b71508c7f9bf984975a27fbb13b8d5/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyalePublisher.java#L879

so I'm guessing all it needs is:
if (type.equals("release")) {
result = input.replaceAll("\\$\\{applicationclass\\}",
projectName );
} else {
result = input.replaceAll("\\$\\{applicationclass\\}",
mainClassName );
}

But I did not check the variation between projectName and mainClassName
between release and debug for that, so I don't fully understand that part
yet. Maybe @aharui can confirm.




On Fri, Sep 6, 2019 at 7:36 PM Carlos Rovira 
wrote:

> Hi Greg,
>
> so the proposal is to end with:
>
> -body
> -application (used for standard Royale apps)
> -AppClassName (for Flex emulated apps that will have
> "_mx_managers_SystemManager" as part of the string. so this is really
> "{application}" + "_mx_managers_SystemManager")
>
> right?
>
> what do you think about
>
> -body
> -application
> -flexapplication
>
> ?
>
> (just trying to have the same style for names and simplifying to something
> more human readable)
>
> thanks!
>
>
> El vie., 6 sept. 2019 a las 5:16, Greg Dove ()
> escribió:
>
> > This seems like an easy thing to fix (unless I missed something).
> > So I think we just need to decide what the token should be.
> >
> > What does everyone think of:
> > ${AppClassName}
> >
> > Input welcome...
> >
> >
> >
> > On Fri, Sep 6, 2019 at 3:05 PM Greg Dove  wrote:
> >
> > > It looks like that only works for debug builds because it gets '.min'
> > > appended in the release build template.
> > > And it seems that MXRoyale Application builds append the system manager
> > > part as a variation.
> > > So we need a new token probably just for the main class name.
> > >
> > > For now it is possible to do:
> > > ${application}_mx_managers_SystemManager
> > > for debug builds of mx apps.
> > >
> > >
> > >
> > > On Fri, Sep 6, 2019 at 1:17 PM Greg Dove  wrote:
> > >
> > >>
> > >> Just to add to this thread:
> > >>
> > >> this type of thing also works if you need the name of the application
> > >> injected (which seems quite helpful for injecting into customised
> > >> javascript):
> > >>
> > >> 
> > >> // the name of my app is:${application}
> > >> 
> > >>
> > >>
> > >> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira <
> carlosrov...@apache.org>
> > >> wrote:
> > >>
> > >>> Hi Chris,
> > >>>
> > >>> ua-parser-js seems very complete. I'll have into account for my own
> > >>> projects :).
> > >>> Thanks for sharing.
> > >>>
> > >>> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
> > >>> chris.velevi...@gmail.com>) escribió:
> > >>>
> > >>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira <
> carlosrov...@apache.org
> > >
> > >>> > wrote:
> > >>> >
> > >>> > > maybe the actual way compiler deal with this is a bit restricted,
> > >>> and we
> > >>> > > can update that part including the 

Re: ${body} in index template

2019-09-06 Thread Carlos Rovira
Hi Greg,

so the proposal is to end with:

-body
-application (used for standard Royale apps)
-AppClassName (for Flex emulated apps that will have
"_mx_managers_SystemManager" as part of the string. so this is really
"{application}" + "_mx_managers_SystemManager")

right?

what do you think about

-body
-application
-flexapplication

?

(just trying to have the same style for names and simplifying to something
more human readable)

thanks!


El vie., 6 sept. 2019 a las 5:16, Greg Dove ()
escribió:

> This seems like an easy thing to fix (unless I missed something).
> So I think we just need to decide what the token should be.
>
> What does everyone think of:
> ${AppClassName}
>
> Input welcome...
>
>
>
> On Fri, Sep 6, 2019 at 3:05 PM Greg Dove  wrote:
>
> > It looks like that only works for debug builds because it gets '.min'
> > appended in the release build template.
> > And it seems that MXRoyale Application builds append the system manager
> > part as a variation.
> > So we need a new token probably just for the main class name.
> >
> > For now it is possible to do:
> > ${application}_mx_managers_SystemManager
> > for debug builds of mx apps.
> >
> >
> >
> > On Fri, Sep 6, 2019 at 1:17 PM Greg Dove  wrote:
> >
> >>
> >> Just to add to this thread:
> >>
> >> this type of thing also works if you need the name of the application
> >> injected (which seems quite helpful for injecting into customised
> >> javascript):
> >>
> >> 
> >> // the name of my app is:${application}
> >> 
> >>
> >>
> >> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira 
> >> wrote:
> >>
> >>> Hi Chris,
> >>>
> >>> ua-parser-js seems very complete. I'll have into account for my own
> >>> projects :).
> >>> Thanks for sharing.
> >>>
> >>> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
> >>> chris.velevi...@gmail.com>) escribió:
> >>>
> >>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira  >
> >>> > wrote:
> >>> >
> >>> > > maybe the actual way compiler deal with this is a bit restricted,
> >>> and we
> >>> > > can update that part including the 

Re: ${body} in index template

2019-09-05 Thread Greg Dove
This seems like an easy thing to fix (unless I missed something).
So I think we just need to decide what the token should be.

What does everyone think of:
${AppClassName}

Input welcome...



On Fri, Sep 6, 2019 at 3:05 PM Greg Dove  wrote:

> It looks like that only works for debug builds because it gets '.min'
> appended in the release build template.
> And it seems that MXRoyale Application builds append the system manager
> part as a variation.
> So we need a new token probably just for the main class name.
>
> For now it is possible to do:
> ${application}_mx_managers_SystemManager
> for debug builds of mx apps.
>
>
>
> On Fri, Sep 6, 2019 at 1:17 PM Greg Dove  wrote:
>
>>
>> Just to add to this thread:
>>
>> this type of thing also works if you need the name of the application
>> injected (which seems quite helpful for injecting into customised
>> javascript):
>>
>> 
>> // the name of my app is:${application}
>> 
>>
>>
>> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira 
>> wrote:
>>
>>> Hi Chris,
>>>
>>> ua-parser-js seems very complete. I'll have into account for my own
>>> projects :).
>>> Thanks for sharing.
>>>
>>> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
>>> chris.velevi...@gmail.com>) escribió:
>>>
>>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira 
>>> > wrote:
>>> >
>>> > > maybe the actual way compiler deal with this is a bit restricted,
>>> and we
>>> > > can update that part including the 

Re: ${body} in index template

2019-09-05 Thread Greg Dove
It looks like that only works for debug builds because it gets '.min'
appended in the release build template.
And it seems that MXRoyale Application builds append the system manager
part as a variation.
So we need a new token probably just for the main class name.

For now it is possible to do:
${application}_mx_managers_SystemManager
for debug builds of mx apps.



On Fri, Sep 6, 2019 at 1:17 PM Greg Dove  wrote:

>
> Just to add to this thread:
>
> this type of thing also works if you need the name of the application
> injected (which seems quite helpful for injecting into customised
> javascript):
>
> 
> // the name of my app is:${application}
> 
>
>
> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira 
> wrote:
>
>> Hi Chris,
>>
>> ua-parser-js seems very complete. I'll have into account for my own
>> projects :).
>> Thanks for sharing.
>>
>> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
>> chris.velevi...@gmail.com>) escribió:
>>
>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira 
>> > wrote:
>> >
>> > > maybe the actual way compiler deal with this is a bit restricted, and
>> we
>> > > can update that part including the 

Re: ${body} in index template

2019-09-05 Thread Greg Dove
Just to add to this thread:

this type of thing also works if you need the name of the application
injected (which seems quite helpful for injecting into customised
javascript):


// the name of my app is:${application}



On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira 
wrote:

> Hi Chris,
>
> ua-parser-js seems very complete. I'll have into account for my own
> projects :).
> Thanks for sharing.
>
> El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
> chris.velevi...@gmail.com>) escribió:
>
> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira 
> > wrote:
> >
> > > maybe the actual way compiler deal with this is a bit restricted, and
> we
> > > can update that part including the 

Re: ${body} in index template

2019-08-28 Thread Carlos Rovira
Hi Chris,

ua-parser-js seems very complete. I'll have into account for my own
projects :).
Thanks for sharing.

El mié., 28 ago. 2019 a las 5:59, Chris Velevitch (<
chris.velevi...@gmail.com>) escribió:

> On Tue, 27 Aug 2019 at 16:34, Carlos Rovira 
> wrote:
>
> > maybe the actual way compiler deal with this is a bit restricted, and we
> > can update that part including the 

Re: ${body} in index template

2019-08-27 Thread Chris Velevitch
On Tue, 27 Aug 2019 at 16:34, Carlos Rovira  wrote:

> maybe the actual way compiler deal with this is a bit restricted, and we
> can update that part including the 

Re: ${body} in index template

2019-08-27 Thread Josh Tynjala
It is worth mentioning that you are not required to include ${body} in a
custom html template. If you need to customize the app startup, you can
skip ${body} completely and write your  tag from scratch.

- Josh

On Tuesday, August 27, 2019, Chris Velevitch 
wrote:
> Where is the value of "${body}" defined? When I build a javascript app,
the
> following code is inserted there:-
>
>