apache / apache/royale-compiler

RemoteClass alias missing from compiled Modules

Open
#190 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
113
Forks
54
PR merge metrics
No merged PRs in 30d

Description

It seems compiling a module strips it's dependencies of
the property alias. Which in turn is causing my module to not be able to
speak with our backend.

How I'm compiling:
with the only difference I'm using the -module-output flag when compiling the module and of course it's filename
```
MXMLJSC
+royalelib=c:\apache_royale_nightlies\3064\apache-royale-0.9.8-bin-js\royale-asjs\frameworks
--debug=true
--source-path+=src/main/royale
--targets=JSRoyale
--load-config+=tbt-defines.xml
--default-frame-rate=60
--default-background-color=#FFFFFF
--default-size
800
600
--keep-as3-metadata+=Bindable
--show-unused-type-selector-warnings=true
--verbose-stacktraces=false
--accessible=false
--strict=true
--benchmark=false
--static-link-runtime-shared-libraries=false
--use-network=true
--use-resource-bundle-metadata=true
--warnings=true
--optimize=false
+configname=flex
--
```

a small test case

*****main.mxml***** mx.core.Application
```
public function loadModule():void {
ml.url = "common/testModule"
ml.visible = true;
ml.includeInLayout = true;
}
```

```
public function test():void {
var obj :Object = window["common"]["testModule"]; //current WA because module will not instantiate
addChild(obj as IUIComponent);
```
**********

*****testModule.mxml***** mx.modules.Module
```
creationComplete="onCC()"

import testVO
private var tVO :testVO = new testVO;

public function onCC():void {
trace(tVO) //will not have alias. If you have private var testvo :testVO in main.mxml it will have alias
}
```
**********

*****testVO.as*****
```
package {
[RemoteClass(alias="com.some.path.as.testVO")]
[Bindable]
public class testVO {
public function testVO {
trace("testVO created");
}
}
}
```
**********

I noticed royale-compiler/compiler/src/main/java/org/apache/royale/compiler/internl/targets/RoyaleAppSWFTarget.java
is the only file that calls ***getRemoteClassAlias()***

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in royale-compiler/compiler/src/main/java/org/apache/royale/compiler/internl/targets/RoyaleAppSWFTarget.java and trace how getRemoteClassAlias() is handled when compiling with -module-output. Reproduce the supplied main.mxml, testModule.mxml, and testVO.as case; done means the compiled module preserves the RemoteClass alias for its dependency and can instantiate the module as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.