dual issues

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

dual issues

Harbs
I just switched to dual and I’m getting lots of errors. These errors seem to be exactly what I was afraid of, and I’m not sure how to resolve without being restricted by naming of properties and methods.

1. I’m using a mask setter and getter for images it’s now giving override errors.
2. contains() is an incompatible override.
3. scaleX and scaleY
4. blendMode
5. rotation
6. filters
7. mouseEnabled
etc….

I thought there was supposed to be something built into the compiler to hide the flash-specific APIs and allow reuse of them.

Am I missing something?

Thanks,
Harbs
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Justin Mclean
Administrator
HI,

> Am I missing something?

Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the name changed from pre to post dual branch.

Justin

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Alex Harui-2
In reply to this post by Harbs


On 5/31/17, 2:38 PM, "Harbs" <[hidden email]> wrote:

>I just switched to dual and I’m getting lots of errors. These errors seem
>to be exactly what I was afraid of, and I’m not sure how to resolve
>without being restricted by naming of properties and methods.
>
>1. I’m using a mask setter and getter for images it’s now giving override
>errors.
>2. contains() is an incompatible override.
>3. scaleX and scaleY
>4. blendMode
>5. rotation
>6. filters
>7. mouseEnabled
>etc….
>
>I thought there was supposed to be something built into the compiler to
>hide the flash-specific APIs and allow reuse of them.

Not just in the compiler, but in metadata.  Search the source for
[SWFOverride].  I guess I don't understand why you want/need to change the
type of scaleX/Y, blendMode, etc.  Wouldn't mouseEnabled always be a
boolean?

SWFOverride is designed for properties like mask and methods like
contains() that are defined as a flash.display.DisplayObject by Flash and
we probably want to use UIBase instead.  SWFOverride will work because
UIBase is a DisplayObject on Flash.  I did not anticipate a requirement
that mouseEnabled would be something other than a boolean.  What types are
you using for these other properties?  Or maybe you just need COMPILE::JS
on mouseEnabled?

HTH,
-Alex

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Justin Mclean
I’m using asconfig in VSCode to compile with these settings:
    "config": "flex",
    "compilerOptions": {
        "debug": false,
        "js-output-type": "flexjs",
        "source-map": false,
        "library-path": [
            "lib"
        ],

> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]> wrote:
>
> HI,
>
>> Am I missing something?
>
> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the name changed from pre to post dual branch.
>
> Justin
>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In case I wasn’t clear, I’m not outputting SWF — only JS output.

> On Jun 1, 2017, at 4:26 AM, Harbs <[hidden email]> wrote:
>
> I’m using asconfig in VSCode to compile with these settings:
>     "config": "flex",
>     "compilerOptions": {
>         "debug": false,
>         "js-output-type": "flexjs",
>         "source-map": false,
>         "library-path": [
>             "lib"
>         ],
>
>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> HI,
>>
>>> Am I missing something?
>>
>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the name changed from pre to post dual branch.
>>
>> Justin
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Josh Tynjala
In reply to this post by Harbs
Try replacing the js-output-type compiler option with:

"targets": ["JSFlex"]

- Josh

On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:

> I’m using asconfig in VSCode to compile with these settings:
>     "config": "flex",
>     "compilerOptions": {
>         "debug": false,
>         "js-output-type": "flexjs",
>         "source-map": false,
>         "library-path": [
>             "lib"
>         ],
>
> > On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
> wrote:
> >
> > HI,
> >
> >> Am I missing something?
> >
> > Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
> name changed from pre to post dual branch.
> >
> > Justin
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Justin Mclean
Administrator
In reply to this post by Harbs
Hi,

> I’m using asconfig in VSCode to compile with these settings:
>   "config": "flex",
>   "compilerOptions": {
>       "debug": false,
>       "js-output-type": "flexjs",
>       "source-map": false,
>       "library-path": [
>           "lib"
>       ],


I’ve not used VSCode but perhaps try “JSFlex" rather than “flexjs" in there or perhaps “targets": “JSFlex"?

Justin
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Alex Harui-2
The examples I see seem to use COMPILE blocks.

I’m not sure how this translates to the app level. Is there a way to define a single method which overrides a SWF one and implements a new JS one (without using COMPILE blocks)? That seems to me like a pretty common use case for migrated apps.

> On Jun 1, 2017, at 2:18 AM, Alex Harui <[hidden email]> wrote:
>
>
>
> On 5/31/17, 2:38 PM, "Harbs" <[hidden email] <mailto:[hidden email]>> wrote:
>
>> I just switched to dual and I’m getting lots of errors. These errors seem
>> to be exactly what I was afraid of, and I’m not sure how to resolve
>> without being restricted by naming of properties and methods.
>>
>> 1. I’m using a mask setter and getter for images it’s now giving override
>> errors.
>> 2. contains() is an incompatible override.
>> 3. scaleX and scaleY
>> 4. blendMode
>> 5. rotation
>> 6. filters
>> 7. mouseEnabled
>> etc….
>>
>> I thought there was supposed to be something built into the compiler to
>> hide the flash-specific APIs and allow reuse of them.
>
> Not just in the compiler, but in metadata.  Search the source for
> [SWFOverride].  I guess I don't understand why you want/need to change the
> type of scaleX/Y, blendMode, etc.  Wouldn't mouseEnabled always be a
> boolean?
>
> SWFOverride is designed for properties like mask and methods like
> contains() that are defined as a flash.display.DisplayObject by Flash and
> we probably want to use UIBase instead.  SWFOverride will work because
> UIBase is a DisplayObject on Flash.  I did not anticipate a requirement
> that mouseEnabled would be something other than a boolean.  What types are
> you using for these other properties?  Or maybe you just need COMPILE::JS
> on mouseEnabled?
>
> HTH,
> -Alex

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Josh Tynjala
Bingo. Thanks!

SWF output still gets all kinds of errors, but the JS output is pretty error free. I still have some fixing up to do before I can see how well it actually works, but at least the compiler is not complaining now.

> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>
> Try replacing the js-output-type compiler option with:
>
> "targets": ["JSFlex"]
>
> - Josh
>
> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>
>> I’m using asconfig in VSCode to compile with these settings:
>>    "config": "flex",
>>    "compilerOptions": {
>>        "debug": false,
>>        "js-output-type": "flexjs",
>>        "source-map": false,
>>        "library-path": [
>>            "lib"
>>        ],
>>
>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>> wrote:
>>>
>>> HI,
>>>
>>>> Am I missing something?
>>>
>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>> name changed from pre to post dual branch.
>>>
>>> Justin
>>>
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
Josh,

VS Code is now reporting lots of errors in the Problems window. I’m guessing it does not know how to differentiate between JS and SWF builds using dual?

Is that something on your to-do list?

Thanks,
Harbs

> On Jun 1, 2017, at 5:10 AM, Harbs <[hidden email]> wrote:
>
> Bingo. Thanks!
>
> SWF output still gets all kinds of errors, but the JS output is pretty error free. I still have some fixing up to do before I can see how well it actually works, but at least the compiler is not complaining now.
>
>> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>>
>> Try replacing the js-output-type compiler option with:
>>
>> "targets": ["JSFlex"]
>>
>> - Josh
>>
>> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>>
>>> I’m using asconfig in VSCode to compile with these settings:
>>>   "config": "flex",
>>>   "compilerOptions": {
>>>       "debug": false,
>>>       "js-output-type": "flexjs",
>>>       "source-map": false,
>>>       "library-path": [
>>>           "lib"
>>>       ],
>>>
>>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>>> wrote:
>>>>
>>>> HI,
>>>>
>>>>> Am I missing something?
>>>>
>>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>>> name changed from pre to post dual branch.
>>>>
>>>> Justin
>>>>
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Harbs
Another weird issue:

> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method imageElement in interface IImage not implemented by class Image
>
> public class Image extends BinaryImage
>             ^
>
> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class Image
>
> public class Image extends BinaryImage
>

org.apache.flex.html.BinaryImage which in tern subclasses org.apache.flex.html.Image. org.apache.flex.html.Image implements these two methods. I figured the compiler might be getting confused by the fact that Image is named the same as an ancestor class, so I changed the name and I'm getting the same error in additon to a null pointer error:

> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method imageElement in interface IImage not implemented by class PUIImage
>
> public class PUIImage extends BinaryImage
>             ^
>
> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class PUIImage
>
> public class PUIImage extends BinaryImage
>             ^
>
> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/view/components/DesignAreaComponents/drawnObjects/ImageObject.as(59): col: 3 java.lang.NullPointerException
> at org.apache.flex.compiler.internal.projects.FlexProject.isValidTypeConversion(FlexProject.java:2304)
> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:564)
> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:374)
> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkAssignment(MethodBodySemanticChecker.java:246)
> at org.apache.flex.compiler.internal.as.codegen.ABCGeneratingReducer.reduce_assignToNameExpr_to_void_expression(ABCGeneratingReducer.java:2947)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.action_237(CmcEmitter.java:4451)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:8067)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:9362)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39155)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39146)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39406)
> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:228)
> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:393)
> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:347)
> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:262)
> at org.apache.flex.compiler.internal.as.codegen.ClassDirectiveProcessor.finishClassDefinition(ClassDirectiveProcessor.java:639)
> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareClass(GlobalDirectiveProcessor.java:430)
> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:206)
> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declarePackage(GlobalDirectiveProcessor.java:455)
> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:223)
> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:122)
> at org.apache.flex.compiler.internal.units.ASCompilationUnit.handleABCBytesRequest(ASCompilationUnit.java:389)
> at org.apache.flex.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
> at org.apache.flex.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)
> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)
> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)
> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)


Any suggestions?

> On Jun 1, 2017, at 12:38 AM, Harbs <[hidden email]> wrote:
>
> I just switched to dual and I’m getting lots of errors. These errors seem to be exactly what I was afraid of, and I’m not sure how to resolve without being restricted by naming of properties and methods.
>
> 1. I’m using a mask setter and getter for images it’s now giving override errors.
> 2. contains() is an incompatible override.
> 3. scaleX and scaleY
> 4. blendMode
> 5. rotation
> 6. filters
> 7. mouseEnabled
> etc….
>
> I thought there was supposed to be something built into the compiler to hide the flash-specific APIs and allow reuse of them.
>
> Am I missing something?
>
> Thanks,
> Harbs

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Josh Tynjala
In reply to this post by Harbs
As I understand it, the compiler should just take care of differences
between JS and SWF, as long as your targets option is correct. VSCode
shouldn't need to do anything​ special except to pass in the correct
options.

There's nothing related to dual changes on my to-do list at this time, but
maybe I missed something important...

- Josh

On May 31, 2017 7:52 PM, "Harbs" <[hidden email]> wrote:

Josh,

VS Code is now reporting lots of errors in the Problems window. I’m
guessing it does not know how to differentiate between JS and SWF builds
using dual?

Is that something on your to-do list?

Thanks,
Harbs

> On Jun 1, 2017, at 5:10 AM, Harbs <[hidden email]> wrote:
>
> Bingo. Thanks!
>
> SWF output still gets all kinds of errors, but the JS output is pretty
error free. I still have some fixing up to do before I can see how well it
actually works, but at least the compiler is not complaining now.

>
>> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>>
>> Try replacing the js-output-type compiler option with:
>>
>> "targets": ["JSFlex"]
>>
>> - Josh
>>
>> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>>
>>> I’m using asconfig in VSCode to compile with these settings:
>>>   "config": "flex",
>>>   "compilerOptions": {
>>>       "debug": false,
>>>       "js-output-type": "flexjs",
>>>       "source-map": false,
>>>       "library-path": [
>>>           "lib"
>>>       ],
>>>
>>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>>> wrote:
>>>>
>>>> HI,
>>>>
>>>>> Am I missing something?
>>>>
>>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>>> name changed from pre to post dual branch.
>>>>
>>>> Justin
>>>>
>>>
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Alex Harui-2
If targets only has JSFlex, there shouldn't be any SWF compile at all.
The console should spit out what it thinks it needs to do.

Keep in mind that there are now SWCs for SWFs and SWCs for JS.  Prior to
dual, there was a main SWC with SWF APIs that the compiler saw, and JS
that it substituted in the output.  The JS SWC was only used to build
downstream JS SWCs.

If you have a custom SWC before dual and it has platform dependent APIs,
and you are only interested in JS output, you need to make sure your SWC's
upstream SWCs are the JS SWCs and not the SWF SWCs.

That in turn requires being more careful about which SWCs are on the
-library-path vs -swf-library-path vs -js-library-path.  In theory, if you
only want JS output, it should be as simple as making sure everything on
the -library-path is a SWC for JS.

HTH,
-Alex

On 5/31/17, 8:42 PM, "Josh Tynjala" <[hidden email]> wrote:

>As I understand it, the compiler should just take care of differences
>between JS and SWF, as long as your targets option is correct. VSCode
>shouldn't need to do anything​ special except to pass in the correct
>options.
>
>There's nothing related to dual changes on my to-do list at this time, but
>maybe I missed something important...
>
>- Josh
>
>On May 31, 2017 7:52 PM, "Harbs" <[hidden email]> wrote:
>
>Josh,
>
>VS Code is now reporting lots of errors in the Problems window. I’m
>guessing it does not know how to differentiate between JS and SWF builds
>using dual?
>
>Is that something on your to-do list?
>
>Thanks,
>Harbs
>
>> On Jun 1, 2017, at 5:10 AM, Harbs <[hidden email]> wrote:
>>
>> Bingo. Thanks!
>>
>> SWF output still gets all kinds of errors, but the JS output is pretty
>error free. I still have some fixing up to do before I can see how well it
>actually works, but at least the compiler is not complaining now.
>>
>>> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>>>
>>> Try replacing the js-output-type compiler option with:
>>>
>>> "targets": ["JSFlex"]
>>>
>>> - Josh
>>>
>>> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>>>
>>>> I’m using asconfig in VSCode to compile with these settings:
>>>>   "config": "flex",
>>>>   "compilerOptions": {
>>>>       "debug": false,
>>>>       "js-output-type": "flexjs",
>>>>       "source-map": false,
>>>>       "library-path": [
>>>>           "lib"
>>>>       ],
>>>>
>>>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>>>> wrote:
>>>>>
>>>>> HI,
>>>>>
>>>>>> Am I missing something?
>>>>>
>>>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>>>> name changed from pre to post dual branch.
>>>>>
>>>>> Justin
>>>>>
>>>>
>>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Alex Harui-2
In reply to this post by Josh Tynjala
Josh, there are new compiler options like js-external-library-path,
js-library-path, swf-library-path, swf-external-library-path.  Does your
VSCode integration handle these?

-Alex

On 5/31/17, 8:42 PM, "Josh Tynjala" <[hidden email]> wrote:

>As I understand it, the compiler should just take care of differences
>between JS and SWF, as long as your targets option is correct. VSCode
>shouldn't need to do anything​ special except to pass in the correct
>options.
>
>There's nothing related to dual changes on my to-do list at this time, but
>maybe I missed something important...
>
>- Josh
>
>On May 31, 2017 7:52 PM, "Harbs" <[hidden email]> wrote:
>
>Josh,
>
>VS Code is now reporting lots of errors in the Problems window. I’m
>guessing it does not know how to differentiate between JS and SWF builds
>using dual?
>
>Is that something on your to-do list?
>
>Thanks,
>Harbs
>
>> On Jun 1, 2017, at 5:10 AM, Harbs <[hidden email]> wrote:
>>
>> Bingo. Thanks!
>>
>> SWF output still gets all kinds of errors, but the JS output is pretty
>error free. I still have some fixing up to do before I can see how well it
>actually works, but at least the compiler is not complaining now.
>>
>>> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>>>
>>> Try replacing the js-output-type compiler option with:
>>>
>>> "targets": ["JSFlex"]
>>>
>>> - Josh
>>>
>>> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>>>
>>>> I’m using asconfig in VSCode to compile with these settings:
>>>>   "config": "flex",
>>>>   "compilerOptions": {
>>>>       "debug": false,
>>>>       "js-output-type": "flexjs",
>>>>       "source-map": false,
>>>>       "library-path": [
>>>>           "lib"
>>>>       ],
>>>>
>>>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>>>> wrote:
>>>>>
>>>>> HI,
>>>>>
>>>>>> Am I missing something?
>>>>>
>>>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>>>> name changed from pre to post dual branch.
>>>>>
>>>>> Justin
>>>>>
>>>>
>>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Harbs
My bad. I accidentally overwrote my copy of BasicJS.swc.

After fixing some issues, I got my app to run using the latest dual changes.

All in all, switching to dual went a lot better than I expected.

Great work, Alex!

I think the switch to the dual approach was the right one. There’s still probably some rough edges to improve, but it’s definitely usable.

Thanks,
Harbs

> On Jun 1, 2017, at 5:57 AM, Harbs <[hidden email]> wrote:
>
> Another weird issue:
>
>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method imageElement in interface IImage not implemented by class Image
>>
>> public class Image extends BinaryImage
>>             ^
>>
>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class Image
>>
>> public class Image extends BinaryImage
>>
>
> org.apache.flex.html.BinaryImage which in tern subclasses org.apache.flex.html.Image. org.apache.flex.html.Image implements these two methods. I figured the compiler might be getting confused by the fact that Image is named the same as an ancestor class, so I changed the name and I'm getting the same error in additon to a null pointer error:
>
>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method imageElement in interface IImage not implemented by class PUIImage
>>
>> public class PUIImage extends BinaryImage
>>             ^
>>
>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class PUIImage
>>
>> public class PUIImage extends BinaryImage
>>             ^
>>
>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/view/components/DesignAreaComponents/drawnObjects/ImageObject.as(59): col: 3 java.lang.NullPointerException
>> at org.apache.flex.compiler.internal.projects.FlexProject.isValidTypeConversion(FlexProject.java:2304)
>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:564)
>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:374)
>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkAssignment(MethodBodySemanticChecker.java:246)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGeneratingReducer.reduce_assignToNameExpr_to_void_expression(ABCGeneratingReducer.java:2947)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.action_237(CmcEmitter.java:4451)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:8067)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:9362)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39155)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39146)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39406)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:228)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:393)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:347)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:262)
>> at org.apache.flex.compiler.internal.as.codegen.ClassDirectiveProcessor.finishClassDefinition(ClassDirectiveProcessor.java:639)
>> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareClass(GlobalDirectiveProcessor.java:430)
>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:206)
>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
>> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declarePackage(GlobalDirectiveProcessor.java:455)
>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:223)
>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:122)
>> at org.apache.flex.compiler.internal.units.ASCompilationUnit.handleABCBytesRequest(ASCompilationUnit.java:389)
>> at org.apache.flex.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
>> at org.apache.flex.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)
>> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)
>> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)
>> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
>> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>
>
> Any suggestions?
>
>> On Jun 1, 2017, at 12:38 AM, Harbs <[hidden email]> wrote:
>>
>> I just switched to dual and I’m getting lots of errors. These errors seem to be exactly what I was afraid of, and I’m not sure how to resolve without being restricted by naming of properties and methods.
>>
>> 1. I’m using a mask setter and getter for images it’s now giving override errors.
>> 2. contains() is an incompatible override.
>> 3. scaleX and scaleY
>> 4. blendMode
>> 5. rotation
>> 6. filters
>> 7. mouseEnabled
>> etc….
>>
>> I thought there was supposed to be something built into the compiler to hide the flash-specific APIs and allow reuse of them.
>>
>> Am I missing something?
>>
>> Thanks,
>> Harbs
>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

piotrz
Hi Harbs,

Great news! This approach us to release!

Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Josh Tynjala
In reply to this post by Alex Harui-2
When they're defined in the *-config.xml files, they'll be picked up
automatically without any special code in VSCode. However, now that you
mention it, I need to allow app developers to customize these in
asconfig.json too.

- Josh

On Jun 1, 2017 12:04 AM, "Alex Harui" <[hidden email]> wrote:

Josh, there are new compiler options like js-external-library-path,
js-library-path, swf-library-path, swf-external-library-path.  Does your
VSCode integration handle these?

-Alex

On 5/31/17, 8:42 PM, "Josh Tynjala" <[hidden email]> wrote:

>As I understand it, the compiler should just take care of differences
>between JS and SWF, as long as your targets option is correct. VSCode
>shouldn't need to do anything​ special except to pass in the correct
>options.
>
>There's nothing related to dual changes on my to-do list at this time, but
>maybe I missed something important...
>
>- Josh
>
>On May 31, 2017 7:52 PM, "Harbs" <[hidden email]> wrote:
>
>Josh,
>
>VS Code is now reporting lots of errors in the Problems window. I’m
>guessing it does not know how to differentiate between JS and SWF builds
>using dual?
>
>Is that something on your to-do list?
>
>Thanks,
>Harbs
>
>> On Jun 1, 2017, at 5:10 AM, Harbs <[hidden email]> wrote:
>>
>> Bingo. Thanks!
>>
>> SWF output still gets all kinds of errors, but the JS output is pretty
>error free. I still have some fixing up to do before I can see how well it
>actually works, but at least the compiler is not complaining now.
>>
>>> On Jun 1, 2017, at 4:45 AM, Josh Tynjala <[hidden email]> wrote:
>>>
>>> Try replacing the js-output-type compiler option with:
>>>
>>> "targets": ["JSFlex"]
>>>
>>> - Josh
>>>
>>> On May 31, 2017 6:26 PM, "Harbs" <[hidden email]> wrote:
>>>
>>>> I’m using asconfig in VSCode to compile with these settings:
>>>>   "config": "flex",
>>>>   "compilerOptions": {
>>>>       "debug": false,
>>>>       "js-output-type": "flexjs",
>>>>       "source-map": false,
>>>>       "library-path": [
>>>>           "lib"
>>>>       ],
>>>>
>>>>> On Jun 1, 2017, at 1:04 AM, Justin Mclean <[hidden email]>
>>>> wrote:
>>>>>
>>>>> HI,
>>>>>
>>>>>> Am I missing something?
>>>>>
>>>>> Perhaps try <targets>JSFlex</targets> in your pom.xml? I believe the
>>>> name changed from pre to post dual branch.
>>>>>
>>>>> Justin
>>>>>
>>>>
>>>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
In reply to this post by Harbs
I just ran into another issue.

I’m not sure why dual would have changed this, but I’m now getting an (erroneous) error when trying to use Promises:

Incorrect number of arguments.  Expected no more than 0

                        return new Promise(function(resolve:*,reject:*):void{
                               ^

> On Jun 1, 2017, at 10:39 AM, Harbs <[hidden email]> wrote:
>
> My bad. I accidentally overwrote my copy of BasicJS.swc.
>
> After fixing some issues, I got my app to run using the latest dual changes.
>
> All in all, switching to dual went a lot better than I expected.
>
> Great work, Alex!
>
> I think the switch to the dual approach was the right one. There’s still probably some rough edges to improve, but it’s definitely usable.
>
> Thanks,
> Harbs
>
>> On Jun 1, 2017, at 5:57 AM, Harbs <[hidden email]> wrote:
>>
>> Another weird issue:
>>
>>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method imageElement in interface IImage not implemented by class Image
>>>
>>> public class Image extends BinaryImage
>>>             ^
>>>
>>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/Image.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class Image
>>>
>>> public class Image extends BinaryImage
>>>
>>
>> org.apache.flex.html.BinaryImage which in tern subclasses org.apache.flex.html.Image. org.apache.flex.html.Image implements these two methods. I figured the compiler might be getting confused by the fact that Image is named the same as an ancestor class, so I changed the name and I'm getting the same error in additon to a null pointer error:
>>
>>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method imageElement in interface IImage not implemented by class PUIImage
>>>
>>> public class PUIImage extends BinaryImage
>>>             ^
>>>
>>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/dummy/view/PUIImage.as(12): col: 15 interface method applyImageData in interface IImage not implemented by class PUIImage
>>>
>>> public class PUIImage extends BinaryImage
>>>             ^
>>>
>>> /Users/harbs/Documents/git/PrintUI/printui-flexjs/PortedPrintUI/src/com/printui/view/components/DesignAreaComponents/drawnObjects/ImageObject.as(59): col: 3 java.lang.NullPointerException
>>> at org.apache.flex.compiler.internal.projects.FlexProject.isValidTypeConversion(FlexProject.java:2304)
>>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:564)
>>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:374)
>>> at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkAssignment(MethodBodySemanticChecker.java:246)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGeneratingReducer.reduce_assignToNameExpr_to_void_expression(ABCGeneratingReducer.java:2947)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.action_237(CmcEmitter.java:4451)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:8067)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:9362)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39155)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39146)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
>>> at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39406)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:228)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:393)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:347)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:262)
>>> at org.apache.flex.compiler.internal.as.codegen.ClassDirectiveProcessor.finishClassDefinition(ClassDirectiveProcessor.java:639)
>>> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareClass(GlobalDirectiveProcessor.java:430)
>>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:206)
>>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
>>> at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declarePackage(GlobalDirectiveProcessor.java:455)
>>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:223)
>>> at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
>>> at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:122)
>>> at org.apache.flex.compiler.internal.units.ASCompilationUnit.handleABCBytesRequest(ASCompilationUnit.java:389)
>>> at org.apache.flex.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
>>> at org.apache.flex.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)
>>> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)
>>> at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)
>>> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
>>> at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> at java.lang.Thread.run(Thread.java:745)
>>
>>
>> Any suggestions?
>>
>>> On Jun 1, 2017, at 12:38 AM, Harbs <[hidden email]> wrote:
>>>
>>> I just switched to dual and I’m getting lots of errors. These errors seem to be exactly what I was afraid of, and I’m not sure how to resolve without being restricted by naming of properties and methods.
>>>
>>> 1. I’m using a mask setter and getter for images it’s now giving override errors.
>>> 2. contains() is an incompatible override.
>>> 3. scaleX and scaleY
>>> 4. blendMode
>>> 5. rotation
>>> 6. filters
>>> 7. mouseEnabled
>>> etc….
>>>
>>> I thought there was supposed to be something built into the compiler to hide the flash-specific APIs and allow reuse of them.
>>>
>>> Am I missing something?
>>>
>>> Thanks,
>>> Harbs
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Alex Harui-2


On 6/3/17, 2:02 PM, "Harbs" <[hidden email]> wrote:

>I just ran into another issue.
>
>I’m not sure why dual would have changed this, but I’m now getting an
>(erroneous) error when trying to use Promises:
>
>Incorrect number of arguments.  Expected no more than 0
>
> return new Promise(function(resolve:*,reject:*):void{
>       ^

Looking at the typedefs, Promise is in missing.js and defined to have no
args.  It is also in es6.js.  Maybe there is some randomness about which
definition wins.  Seems like you could remove the one from missing.js.
Does FlexJS emit the right code to enable es6 APIs?

-Alex


Reply | Threaded
Open this post in threaded view
|

Re: dual issues

Harbs
Not sure what you mean here.

> On Jun 4, 2017, at 8:52 AM, Alex Harui <[hidden email]> wrote:
>
> Does FlexJS emit the right code to enable es6 APIs?

12