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 (<[email protected]>) 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 > <Script> tags around the entry point code. But that's just me. > > My 2 cents, > -Alex > > On 9/6/19, 2:20 PM, "Greg Dove" <[email protected]> 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 <[email protected]> > 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 (<[email protected]>) > > 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 <[email protected]> > 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 <[email protected]> > 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): > > > >> > > > >> <script> > > > >> // the name of my app is:${application} > > > >> </script> > > > >> > > > >> > > > >> On Wed, Aug 28, 2019 at 8:02 PM Carlos Rovira < > > [email protected]> > > > >> 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 (< > > > >>> [email protected]>) escribió: > > > >>> > > > >>> > On Tue, 27 Aug 2019 at 16:34, Carlos Rovira < > > [email protected] > > > > > > > >>> > wrote: > > > >>> > > > > >>> > > maybe the actual way compiler deal with this is a bit > restricted, > > > >>> and we > > > >>> > > can update that part including the <script> tags in the > html > > > >>> template and > > > >>> > > making ${body} only outputs "new App.start();", so people > could > > > >>> switch to > > > >>> > > its own "htmlTemplate" > > > >>> > > > > >>> > > > > >>> > Sounds like a good long term solution. Josh's suggestion > also good > > as > > > >>> long > > > >>> > as you remember or know the main class name of the app in > order to > > > >>> start it > > > >>> > in the customised HTML template. > > > >>> > > > > >>> > As for compatibility testing, writing that test in Royale > didn't > > make > > > >>> sense > > > >>> > to me if the browser you are trying to run that code in is > > > >>> incompatible. My > > > >>> > idea was to use > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffaisalman%2Fua-parser-js&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=AJv1nqrrZ94qxI0vKEfEvAM%2FOiMBLOdgsspY9epv55U%3D&reserved=0 > as a > > basis > > > >>> for > > > >>> > testing compatibility. > > > >>> > > > > >>> > Chris > > > >>> > -- > > > >>> > Chris Velevitch > > > >>> > m: 0415 469 095 > > > >>> > > > > >>> > > > >>> > > > >>> -- > > > >>> Carlos Rovira > > > >>> > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=dT6vBrXxjghlggrqS8aJY3o4ppoD3uWRKDZ%2B3We%2F704%3D&reserved=0 > > > >>> > > > >> > > > > > > > > > -- > > Carlos Rovira > > > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C4eaa963c03ce49e1239808d733101497%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637034016499897671&sdata=dT6vBrXxjghlggrqS8aJY3o4ppoD3uWRKDZ%2B3We%2F704%3D&reserved=0 > > > > > -- Carlos Rovira http://about.me/carlosrovira
