You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Tim Diggle <ti...@gmail.com> on 2016/12/16 04:42:14 UTC

[FlexJS] Using @flexjsignorecoercion to inline JavaScript

Hi, I've been building some of the Flex JS samples and am particularly interested in the createjs samples. Looking at the component source, I notice that the @flexjsignorecoercion flag is used to allow createjs javascript calls to be made and the results attached to a WrappedHTMLElement. I was hoping we could use this directly in a Flex JS project to quickly prototype stuff before rolling it into a component - however even with the directive and the -keep-as-doc compiler setting, the compiler still complains about not recognizing the create js classes and imports. How is this overcome when the components are built, and where is the compiler looking to get the create is imports at that stage? Is it possible to inline the JavaScript directly in a project as described, or should we always follow the multiple compile steps to make a component swc to use these JavaScript libraries?

Many thanks

Tim

Re: [FlexJS] Using @flexjsignorecoercion to inline JavaScript

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

@flexjsignorecoercion only controls output after the parsing.  It skips
output of the JS for "as WrappedHTMLElement" so no coercion is done.  All
of the types need to be available for the parser.

The CreateJS.swc in frameworks/libs contains components that present
Flex-like APIs on top of CreateJS.  These components can be used in MXML.
The createjs.swc in js/libs contains the AS APIs for parts of CreateJS
(most of EaselJS and TweenJS).  These classes cannot be used in MXML, only
in AS.  This sounds like the swc you are missing.  It should be added to
the -external-library-path (not the -library-path).  If you have
connections to the CreateJS community, we'd love to get them more involved
and enable FlexJS to create any CreateJS app.

Thanks,
-Alex

On 12/15/16, 8:42 PM, "Tim Diggle" <ti...@gmail.com> wrote:

>Hi, I've been building some of the Flex JS samples and am particularly
>interested in the createjs samples. Looking at the component source, I
>notice that the @flexjsignorecoercion flag is used to allow createjs
>javascript calls to be made and the results attached to a
>WrappedHTMLElement. I was hoping we could use this directly in a Flex JS
>project to quickly prototype stuff before rolling it into a component -
>however even with the directive and the -keep-as-doc compiler setting,
>the compiler still complains about not recognizing the create js classes
>and imports. How is this overcome when the components are built, and
>where is the compiler looking to get the create is imports at that stage?
>Is it possible to inline the JavaScript directly in a project as
>described, or should we always follow the multiple compile steps to make
>a component swc to use these JavaScript libraries?
>
>Many thanks
>
>Tim