You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Tim Darlington <ti...@gmail.com> on 2018/09/06 00:31:36 UTC

Missing dependencies etc. in compiled index.html

Hi, I'm working on a framework that replicates the Flash API for Royale.
I'm aware that SpriteFlexJS exists and is probably better, but I'm using a
different approach so thought I'd finish it, document it and put it out
there for people to pick over and take learnings from, I have a few
interesting features that might be useful in my approach..

To test for robustness I've been trying to use the popular actionscript
TweenLite framework "out of the box". At the moment I'm just compiling and
testing the debug output, not worrying about minified JS working.

I'm having a few issues and wanted to check if they are known and/or if I'm
not setting up my build config correctly. Apologies that I don't have full
source to show at the moment, it'll be on Github in the next couple of
weeks, just wanting to sanity check what I'm seeing here.

1. The transpiler doesn't seem to be adding all the required dependencies.
For example, in the Flash API a Sprite is DisplayObjectContainer which is
an InteractiveObject etc. When I run my compiled code, attempts to use
superclass properties for, say, EventDispatcher error out in Chrome, and
inspecting the generated code shows that the goog.addDependency line for
Sprite isn't adding all the superclasses up the class hierarchy. At the
moment I'm running a post-compile step where I string match and patch the
incorrect dependencies versus what it needs to run, but obviously this
can't be a robust solution for deployment long term. Are there any known
issues with missing dependencies of this nature, are there any meta data
tags I can add in my actionscript to force the transpiler to add
dependencies?

2. I need to inject a bit of HTML into the transpiled pages header and
body. Is there a meta tag to do this? I believe it was mentioned back in
the Flex JS days but the meta tag I was using has stopped working,
seemingly.

Apologies for being wordy and vague, I mainly wanted to check if anyone
else has had the dependency adding problem and if there's a straightforward
fix, then I can speed up my workflow testing all the features and get it
published.

Thanks all,

Tim

Re: Missing dependencies etc. in compiled index.html

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Tim,

Your project sounds interesting.

Regarding your questions:
1) Classes that are from SWCs in the -external-library-path will not be in the addDependencies list.  So if you are compiling Flash classes, you probably want to make sure that playerglobal.swc is not in the list of SWCs.

2)  There is a <inject_html> 'directive' we use.  It is picky about where it goes in the ASDoc for a file.  Look at examples in our source.  There is also a -html-template option that controls the template for generating the index.html.

HTH,
-Alex

On 9/5/18, 7:53 PM, "Tim Darlington" <ti...@gmail.com> wrote:

    Hi, I'm working on a framework that replicates the Flash API for Royale.
    I'm aware that SpriteFlexJS exists and is probably better, but I'm using a
    different approach so thought I'd finish it, document it and put it out
    there for people to pick over and take learnings from, I have a few
    interesting features that might be useful in my approach..
    
    To test for robustness I've been trying to use the popular actionscript
    TweenLite framework "out of the box". At the moment I'm just compiling and
    testing the debug output, not worrying about minified JS working.
    
    I'm having a few issues and wanted to check if they are known and/or if I'm
    not setting up my build config correctly. Apologies that I don't have full
    source to show at the moment, it'll be on Github in the next couple of
    weeks, just wanting to sanity check what I'm seeing here.
    
    1. The transpiler doesn't seem to be adding all the required dependencies.
    For example, in the Flash API a Sprite is DisplayObjectContainer which is
    an InteractiveObject etc. When I run my compiled code, attempts to use
    superclass properties for, say, EventDispatcher error out in Chrome, and
    inspecting the generated code shows that the goog.addDependency line for
    Sprite isn't adding all the superclasses up the class hierarchy. At the
    moment I'm running a post-compile step where I string match and patch the
    incorrect dependencies versus what it needs to run, but obviously this
    can't be a robust solution for deployment long term. Are there any known
    issues with missing dependencies of this nature, are there any meta data
    tags I can add in my actionscript to force the transpiler to add
    dependencies?
    
    2. I need to inject a bit of HTML into the transpiled pages header and
    body. Is there a meta tag to do this? I believe it was mentioned back in
    the Flex JS days but the meta tag I was using has stopped working,
    seemingly.
    
    Apologies for being wordy and vague, I mainly wanted to check if anyone
    else has had the dependency adding problem and if there's a straightforward
    fix, then I can speed up my workflow testing all the features and get it
    published.
    
    Thanks all,
    
    Tim