Based on some further investigation, it looks like the Royale compiler
knows how to implement the JS IEventDispatcher API in generated .js files
only. When those .js files are included in a SWC file, the binary part of
the SWC file that is used for type checking and IDE support will always be
generated with the SWF IEventDispatcher API. That's where the conflict
comes from.

This does not appear to me to be a regression, but how it has always
worked. We may want to provide a way to generate both APIs in SWC binary
code, but I would say that's for a future release.

In Royale framework code, it looks like there are two ways to manually
handle bindable beads.

1) Extend DispatcherBead. It looks like a lot of bead classes do this.

2) Manually implement IEventDispatcher, with the different signatures
conditionally compiled with COMPILE::SWF and COMPILE::JS. This is much less
common, but it is used in a couple of places.

In both cases, the compiler won't generate any IEventDispatcher code for
bindable properties because the beads will already be event dispatchers.

The first option is most common, but not always possible when another is
superclass already being used. The second option where the interface is
manually implemented happens in these two bead:

a) In Jewel, a manual IEventDispatcher implementation is used in
ArrayListSelectionModel.
b) In Spark, a manual implementation is used in LayoutBase.

In the case of Jewel's TileHorizontalLayout, if you wanted to avoid
manually implementing IEventDispatcher, the Core version of LayoutBase
would need to extend DispatcherBead. However, I don't think this would be
considered PAYG, which Core is expected to follow more strictly than Jewel,
so there's no way to use DispatcherBead with Jewel's TileHorizontalLayout.
TileHorizontalLayout probably needs a manual implementation of
IEventDispatcher. Or possibly SimpleHorizontalLayout or StyledLayoutBase
instead, depending on how strict you want to be with PAYG in Jewel. For the
least impact and most PAYG, you should manually implement IEventDispatcher
directly on TileHorizontalLayout.

(In my opinion, this is not a release blocker. I'm just letting you know
what I found in my investigation, and my advice for fixing it.)

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Mon, May 15, 2023 at 1:13 PM Josh Tynjala <joshtynj...@bowlerhat.dev>
wrote:

> > Does anyone have any idea what has happened here ? Why
> TileHorizontalLayout
> > after compilation to TileHorizontalLayout.js have all of these methods ?
>
> TileHorizontallayout has [Bindable] metadata on some properties. If
> anything in a class is marked as [Bindable], and that class (or a
> superclass) does not already extend EventDispatcher (or implement
> IEventDispatcher), the compiler will automatically generate an
> implementation of IEventDispatcher. This is true in Royale, and it was also
> true in Flex.
>
> Here are the classes that TileHorizontalLayout is a subclass of:
> TileHorizontalLayout extends SimpleHorizontalLayout extends
> StyledLayoutBase extends LayoutBase extends Bead
>
> There are also the following interfaces in the type hierarchy:
> ILayoutStyleProperties, IBeadLayout, IBead
>
> Nowhere in this chain of classes is there an EventDispatcher or
> IEventDispatcher. So the compiler is generating its own implementation of
> IEventDispatcher.
>
> Unfortunately, it seems to be generating an implementation of the methods
> from the SWF version of IEventDispatcher instead of the methods from the JS
> version of IEventDispatcher. I don't believe that I have worked with the
> part of the Royale compiler that generates code for bindable
> classes/properties before, so I don't know why it would be doing that.
> However, that seems like a bug. Maybe not necessarily in the compiler. It
> could be that the compiler options used by the JewelJS build are wrong.
>
> Note: I don't think that the compiler is incorrectly using the Spark
> version of LayoutBase instead of the Core version of LayoutBase. This can
> be explained without the Spark version of LayoutBase being involved in any
> way.
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>
>
> On Mon, May 15, 2023 at 5:14 AM Piotr Zarzycki <piotrzarzyck...@gmail.com>
> wrote:
>
>> Hi Guys,
>>
>> I have voted +1, but I have found one issue which concerns me a little
>> bit.
>> I have need of usage in my application
>> -> org.apache.royale.jewel.beads.layouts.TileHorizontalLayout. I have made
>> my own custom class which extends that one. To my big surprise I got
>> following compilation error:
>>
>>  Error: interface method addEventListener in interface IEventDispatcher is
>> implemented with an incompatible signature in class
>> ExtendedTileHorizontalLayout
>> : Error: interface method removeEventListener in interface
>> IEventDispatcher
>> is implemented with an incompatible signature in class
>> ExtendedTileHorizontalLayout
>> : Error: interface method dispatchEvent in interface IEventDispatcher is
>> implemented with an incompatible signature in class
>> ExtendedTileHorizontalLayout
>>
>> I have looked into TileHorizontalLayout in Moonshine and I see there
>> signature methods -> https://prnt.sc/crcNcuFHgu-8
>>
>> Look int signatures dispatchEvent, hasEventListener, removeEventListener
>> and addEventListener - they are all missing fields name. This is
>> definitely
>> wrong, but I think all of these methods shouldn't even exists in
>> frameworks/js/libs/JewelJS.swc -> TileHorizontalLayout.
>>
>> TileHorizontalLayout extends several classes, one of them
>> is org.apache.royale.core.LayoutBase - non of these classes have anywhere
>> inside methods dispatchEvent, hasEventListener etc. However there is
>> another class in completely different
>> package spark.layouts.supportClasses.LayoutBase - that one have these
>> methods implemented exactly in the same way as my TileHorizontalLayout.js
>> have.
>>
>> Does anyone have any idea what has happened here ? Why
>> TileHorizontalLayout
>> after compilation to TileHorizontalLayout.js have all of these methods ?
>>
>> Thanks,
>> Piotr
>>
>>
>> niedz., 14 maj 2023 o 03:29 Maria Jose Esteve <mjest...@iest.com>
>> napisał(a):
>>
>> > Hi,
>> > I keep testing the automated compilation option [1] the compilation gave
>> > me error ☹.
>> > I have left the log of the compilation here [2] but I attach the error:
>> >
>> > <<<<<<<
>> > ...
>> >         main:
>> >         Copying 1 file to
>> >
>> D:\Develop_Royale\Projects\Royale-SDK\0.9.10\apache-royale-0.9.10-src\royale-asjs\examples\native\USStatesMap\bin\js-debug
>> >         Copying 1 file to
>> >
>> D:\Develop_Royale\Projects\Royale-SDK\0.9.10\apache-royale-0.9.10-src\royale-asjs\examples\native\USStatesMap\bin\js-release
>> >
>> >         main:
>> >
>> >         build_maven:
>> >         Path is C:\Program Files (x86)\Common
>> > Files\Oracle\Java\javapath;D:\Apache;C:\Program
>> >
>> Files\Java\jdk1.8.0_281\bin;D:\Apache\apache-ant-1.10.13\bin;D:\Apache\apache-maven-3.9.1\bin;D:\app\client\hiedra\product\19.0.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program
>> > Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program
>> >
>> Files\dotnet\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program
>> > Files\Git\cmd;C:\Users\hiedra\AppData\Local\Programs\Microsoft VS
>> > Code;C:\Program Files\Microsoft SQL Server\Client
>> > SDK\ODBC\170\Tools\Binn\;C:\Program
>> > Files\PowerShell\7-preview\preview;C:\Program Files
>> >
>> (x86)\Yarn\bin\;D:\Apache\HaxeToolkit\haxe;D:\Apache\HaxeToolkit\neko;C:\Program
>> > Files\nodejs\;C:\Program Files (x86)\Intel\Intel(R) Management Engine
>> > Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine
>> > Components\DAL;C:\Program Files (x86)\Pulse
>> > Secure\VC142.CRT\X64\;C:\Program Files (x86)\Pulse
>> > Secure\VC142.CRT\X86\;C:\Program Files\Microsoft SQL
>> > Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL
>> > Server\130\Tools\Binn\;C:\Program Files
>> >
>> (x86)\GnuPG\bin;C:\Users\hiedra\AppData\Local\Microsoft\WindowsApps;C:\Users\hiedra\AppData\Local\GitHubDesktop\bin;C:\Users\hiedra\.dotnet\tools;C:\Users\hiedra\AppData\Local\Microsoft\WindowsApps;C:\Users\hiedra\AppData\Local\Programs\Microsoft
>> > VS
>> >
>> Code\bin;C:\Users\hiedra\AppData\Local\Yarn\bin;C:\Users\hiedra\AppData\Roaming\npm
>> >
>> >         BUILD FAILED
>> >
>> > D:\Develop_Royale\Projects\Royale-SDK\0.9.10\ApproveRoyale.xml:796: The
>> > following error occurred while executing this line:
>> >
>> > D:\Develop_Royale\Projects\Royale-SDK\0.9.10\ApproveRoyale.xml:809: exec
>> > returned: 1
>> >
>> >         Total time: 39 minutes 52 seconds
>> > >>>>>>>
>> >
>> > The error occurs in the Maven compilation task (it's in the path, could
>> it
>> > be because of the maven version?):
>> >
>> > >>>>>>>
>> > ...
>> >     <target name="build_maven">
>> >         <condition property="compiler_mvn_profiles"
>> > value="-Poption-with-swf"
>> >             else="-Ddummy=true">
>> >             <isset property="env.AIR_HOME" />
>> >         </condition>
>> >         <condition property="asjs_mvn_profiles"
>> > value="-Pwith-examples,with-distribution,option-with-swf"
>> >             else="-Pwith-examples,with-distribution">
>> >             <isset property="env.AIR_HOME" />
>> >         </condition>
>> >         <echo>Path is ${env.Path}</echo>
>> >
>> > -- >>>        <exec executable="${mvn}" dir="${basedir}/${
>> > maven.package.url.name}/royale-compiler" failonerror="true"
>> > inputstring="Yes">
>> >             <arg value="clean" />
>> >             <arg value="${compiler_mvn_profiles}" />
>> >             <arg value="install" />
>> >         </exec>
>> >         <exec executable="${mvn}" dir="${basedir}/${
>> maven.package.url.name}/royale-typedefs"
>> > failonerror="true" >
>> >             <arg value="clean" />
>> >             <arg value="install" />
>> >         </exec>
>> >         <exec executable="${mvn}" dir="${basedir}/${
>> maven.package.url.name}/royale-asjs"
>> > failonerror="true" inputstring="Yes">
>> >             <arg value="clean" />
>> >             <arg value="${asjs_mvn_profiles}" />
>> >             <arg value="install" />
>> >         </exec>
>> >     </target>
>> > ...
>> > <<<<<<<
>> >
>> > I have a question about licenses... Yishay has no anomalies in this
>> regard
>> > but I have an unapproved license:
>> >         Unapproved licenses:
>> >
>> >
>> D:/Develop_Royale/Projects/Royale-SDK/0.9.10/apache-royale-0.9.10-bin-js-swf/royale-asjs/js/lib/royaleunit/dom4j-LICENSE.txt
>> > How can I fix it?
>> >
>> > [1]
>> >
>> https://dist.apache.org/repos/dist/dev/royale/0.9.10/rc4/ApproveRoyale.xml
>> > y ejecutando el script:
>> >    ant -e -f ApproveRoyale.xml -Drelease.version=0.9.10 -Drc=4
>> > [2]
>> >
>> https://drive.google.com/file/d/1jCgS51cgtRSSuh11UJUxzdEaburpDdpF/view?usp=share_link
>> >
>> > Hiedra
>> >
>> > -----Mensaje original-----
>> > De: Yishay Weiss <yishayj...@hotmail.com>
>> > Enviado el: sábado, 13 de mayo de 2023 19:36
>> > Para: dev@royale.apache.org
>> > Asunto: [DISCUSS] Release Apache Royale 0.9.10 RC4
>> >
>> > This is the discussion thread.
>> >
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>

Reply via email to