Re: [FlexJS] technical debt

2017-07-05 Thread Justin Mclean
Hi,

> In the differential all 30 of the bugs are of the form:
> 
> Make this class “Event" override "Event.clone()” function

Which some are false positives as there’s a cloneEvent method. Note you can 
mark them as such in the interface. I had already fixed a couple of these a few 
weeks back.

> The singular code smell (Sonar says that flex smells very good indeed.)

Not sure where you seeing just 1 as I can see 13,100 and their are a varieties 
of issues. Again some worth looking into and others not.

Thanks,
Justin

4.16.0 Install issues

2017-07-05 Thread Nicholas Kwiatkowski
Is anybody actually addressing the issues people have been reporting about
the installer and/or ANT script for Flex SDK 4.16.0?

Right now I see two major issues that are preventing even people who are
familiar with the SDK from doing installs :

 - In the installer, selecting AIR 25.0 gives users a non-descript "error
1000".  This is due toe the md5 checking in the installer running out of
memory
 - Trying to install via ANT is also broken under Windows (any version of
AIR SDK).  As packaged, it always errors because it tries to install the
MacOS AIR SDK.  Additionally, the optional components that are currently
hosted on sourceforge fail to download due to some SSL errors (I've tested
this with the latest java sdk and ANT build).

The AIR installer issue will require us to rip-and-replace the md5
calculation functions.  I've started looking at it, but I don't think it
will be an easy feat.
Fixing the ANT script for Windows trying to install the mac air dmg is an
easy fix (but it will require us to do a dot release to push it out)
The SSL errors are because sourceforge is using SANs on their SSL certs,
and the current versions of ANT don't know how to read them to validate
them.  This may be out of our control.  Anybody know if we can convince
Adobe to either donate those chunks of code or at least to move them to a
different host?  It looks like the code involved is OSMF, AFE, AGLJ,
rideau and Flex-Fontkit.  The alternative to a different host is for us to
ignore SSL errors, but that could be potentially dangerous.

If nobody is working on these, I can start to take a crack at them, but
honestly, the installer is extremely fragile at this point and I'm not
looking forward to even trying to figure out what is going on in there
again.

-Nick


Re: [FlexJS] Use of typeof

2017-07-05 Thread Alex Harui
I've noticed lots of advice on the internet to use feature detection
instead of browser/runtime detection.  Did you rule out doing that?
Browsers may implement new features over time.

But otherwise, I see some clever tests that check for "window" and a few
other things.

HTH,
-Alex

On 7/5/17, 1:54 PM, "Harbs"  wrote:

>No. I was trying to use process to check whether it’s running in a Node
>runtime (such as Node or Electron). window does not have process.
>
>I’m trying to add a class that lets the client know what environment it’s
>running in.
>
>Adding global sounds like a good idea. Between window and global, I think
>that would offer a solution everywhere.
>
>> On Jul 5, 2017, at 7:48 PM, Alex Harui  wrote:
>> 
>> Sure, I know it wouldn't work at runtime, but it sounded like Harbs
>> couldn't even get the compiler to accept window["process"] which it
>>should.
>> 
>> So, it should be ok to write:
>> 
>> if(typeof window !== "undefined")
>> {
>>theProcess = window["process"];
>> }
>> else
>> 
>>theProcess = global.process
>> 
>> But is there really a process property in the browser?
>> 
>> We could create or own single variable if we want.  How often do
>>libraries
>> need stuff in window/global?  Classes that need it should be able to use
>> inject_html and run some JS that maps window to global or the other way
>> around.
>> 
>> HTH,
>> -Alex
>> 
>> On 7/5/17, 6:43 AM, "Josh Tynjala"  wrote:
>> 
>>> Node.js doesn't have a window variable, so window["process"] won't
>>>work.
>>> They have a global variable instead.
>>> 
>>> I remember reading that there is a proposal for ECMAScript to
>>>standardize
>>> a
>>> single variable that refers to window in the browser and global in
>>> Node.js,
>>> but that doesn't exist yet.
>>> 
>>> - Josh
>>> 
>>> On Tue, Jul 4, 2017 at 11:35 PM, Alex Harui 
>>> wrote:
>>> 
 What class in Core needs this dependency?  I think one drawback is
that
 users of that class will need to add node.swc to their project
 dependencies.  But I don't think every consumer of Core will need
 node.swc.
 
 But first, why didn't window["process"] work?  In theory Falcon will
let
 you access anything off of window.  We could also add global if we
want.
 Or maybe we should only allow global and have some bootstrap code that
 maps global to window?
 
 -Alex
 
 On 7/4/17, 2:09 PM, "Harbs"  wrote:
 
> Actually, I see that the Node typedefs has all the process
>declarations
> in global.js.
> 
> Is there an issue with adding a dependency in CoreJS to node.swc?
> 
> Should a class that has this dependency go somewhere else? (I don’t
> really see an issue with adding the dependency, but I’m throwing this
 out
> in case I’m missing something.)
> 
> Harbs
> 
>> On Jul 5, 2017, at 12:00 AM, Harbs  wrote:
>> 
>> Looks like it.
>> 
>> I see this in missing.js:
>> 
>> /**
>> * @export
>> * This gets mapped to org.apache.flex.utils.Language.trace() by the
>> compiler
>> * @param {...} rest
>> */
>> function trace(rest) {}
>> 
>> /**
>> * @type {!Console}
>> * @const
>> */
>> var console;
>> 
>> 
>> I guess I can add another one like so:
>> 
>> /**
>> * @type {!Process}
>> * @const
>> */
>> var process;
>> 
>> However, it seems like a drag to have to add a typedef every time a
>> developer needs to check for the existence of a global that we did
>>not
>> think of.
>> 
>>> On Jul 4, 2017, at 9:13 PM, Harbs  wrote:
>>> 
>>> Thanks. Here’s what I see:
>>> 
>>> if(typeof window !== "undefined")
>>> {
>>>theConsole = window.console;
>>> }
>>> else if(typeof console !== "undefined")
>>> {
>>>theConsole = console;
>>> }
>>> 
>>> Did you define console in a typedef maybe?
>>> 
>>> I’m thinking that Falcon should really allow undefined variables
 when
>>> used with “typeof”.
>>> 
>>> Truth be told, I really need to do something like one of these:
>>> if(typeof (process) != 'undefined' && {}.toString.call(process) ==
>>> '[object process]’)
>>> or:
>>> if(typeof process != 'undefined' && process &&
>>> process.constructor.name == "process”)
>>> 
>>> Of course every reference to process causes a compiler error. I
 wonder
>>> if there’s some way to tell the compiler to accept it without
>>> complaining…
>>> 
 On Jul 4, 2017, at 8:54 PM, Josh Tynjala 
 wrote:
 
 I don't remember exactly what I did, but in order to get trace()
 working in
 Node.js, I had to figure out how to find the console object 

RE: [FlexJS] question about porting an Adobe Flex 3 project to HTML+JS

2017-07-05 Thread Allen YANG
Hi Yishay,

After trying for quite a while, I found that we might be talking about two 
different things.  I informed Piotr that was able to use Maven and VS Code to 
build and run Piotr's "Hello World" example successfully.  But I was unable to 
successfully run demo_for_presentation using Flash Builder 4.7.  You might be 
thinking that I was talking about being able to use VS Code and Maven to build 
and run demo_for_presentation successfully; which is not the case for me yet.

So I went back to your email on 07/01 and I installed Ant and added it to PATH; 
I also set ANT_HOME to where I installed Ant: C:\apache-ant-1.10.1; and already 
have JAVA_HOME to its installation folder: C:\Program Files\Java\jdk1.8.0_131
At the folder demo_for_presentation where build.xml file resides, I typed 'ant' 
in the cmd window.  I got the following error:
--
Buildfile: C:\Projects\demo_for_presentation\build.xml

clean:

build_example.compilejs:
 [echo] Compiling demo_for_presentation.js
 [echo] FLEX_HOME: ${env.FLEXJS_HOME}
 [echo] FALCONJX_HOME: ${FALCONJX_HOME}
 [echo] env GOOG_HOME: ${env.GOOG_HOME}
 [echo] GOOG_HOME: ${GOOG_HOME}
 [java] Error: Could not find or load main class ${mxmlc.jvm.args}
 [java] Java Result: 1

BUILD FAILED
C:\Projects\demo_for_presentation\build_example.xml:124: code: 1

Total time: 0 seconds

Can you help me to see what's wrong?

Thanks and Regards,
Allen
-

-Original Message-
From: yishayw [mailto:yishayj...@hotmail.com]
Sent: Wednesday, July 05, 2017 12:54 AM
To: dev@flex.apache.org
Subject: RE: [FlexJS] question about porting an Adobe Flex 3 project to HTML+JS

yishayw wrote
> Now assuming you have pom.xml and build.xml in your project you should
> be able to run Maven like this:

Should read:


Now assuming you have pom.xml and build.xml in your project you should be able 
to run Maven *or ant* like this:




--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-question-about-porting-an-Adobe-Flex-3-project-to-HTML-JS-tp62698p62835.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.



Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir 
des informations sensibles et/ ou confidentielles ne devant pas être 
divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous 
recevez ce message par erreur), nous vous remercions de le notifier 
immédiatement à son expéditeur, et de détruire ce message. Toute copie, 
divulgation, modification, utilisation ou diffusion, non autorisée, directe ou 
indirecte, de tout ou partie de ce message, est strictement interdite.


This e-mail, and any document attached hereby, may contain confidential and/or 
privileged information. If you are not the intended recipient (or have received 
this e-mail in error) please notify the sender immediately and destroy this 
e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution 
or other use of the material or parts thereof is strictly forbidden.


Re: [FlexJS] technical debt

2017-07-05 Thread Dave Fisher
Hi -

In the differential all 30 of the bugs are of the form:

Make this class “Event" override "Event.clone()” function

All of the 133 vulnerabilities are of these forms:

Make this "public static" field const
Remove this use of the "trace" function.

The singular code smell (Sonar says that flex smells very good indeed.)

Last statement in this switch-clause should be an unconditional break

This looks like recent work. I’d say it looks pretty good and would be easy to 
address.

I agree with Justin that it is something that all devs should look at from time 
to time.

Regards,
Dave

> On Jul 5, 2017, at 4:24 PM, Justin Mclean  wrote:
> 
> Hi,
> 
> If you take a look at this [1] you see that technical debt increased a bit 
> between the 0.8 and 0.9 releases. It would be good if we could reduce this.
> 
> While Sonar cube isn’t perfect, probably needs some tuning, and there are a 
> number of false positives in there it is trying to tell us something.
> 
> Thanks,
> Justin
> 
> 1. https://builds.apache.org/analysis/overview?id=20942



signature.asc
Description: Message signed with OpenPGP


[FlexJS] technical debt

2017-07-05 Thread Justin Mclean
Hi,

If you take a look at this [1] you see that technical debt increased a bit 
between the 0.8 and 0.9 releases. It would be good if we could reduce this.

While Sonar cube isn’t perfect, probably needs some tuning, and there are a 
number of false positives in there it is trying to tell us something.

Thanks,
Justin

1. https://builds.apache.org/analysis/overview?id=20942

Re: [FlexJS] 0.8.0 not working in IntelliJ IDEA

2017-07-05 Thread Justin Mclean
Hi,

> I was trying some time ago to do as you are doing and failed. - Not sure
> whether it was same problem. After some time I gave up. 
> 
> The conclusion is that I end up with pom for Maven build and setup where the
> intelisence is working. 

That mirrors my experience as well. I know Chris looked deeper into the issues 
here but not sure how far he got.

Thanks,
Justin

Re: [FlexJS] 0.8.0 not working in IntelliJ IDEA

2017-07-05 Thread piotrz
Hi Josh,

I was trying some time ago to do as you are doing and failed. - Not sure
whether it was same problem. After some time I gave up. 

The conclusion is that I end up with pom for Maven build and setup where the
intelisence is working. 

Piotr



-
Apache Flex PMC
piotrzarzyck...@gmail.com
--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-0-8-0-not-working-in-IntelliJ-IDEA-tp62848p62849.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


[FlexJS] 0.8.0 not working in IntelliJ IDEA

2017-07-05 Thread Josh Tynjala
I'm trying to create a new FlexJS 0.8.0 project in IntelliJ IDEA, and I'm
getting the following output when I try to build the project:

Information:[HelloIDEA]: Starting Flex compiler:
"/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/java"
-Dapplication.home=/Users/joshtynjala/Development/Flex/sdks/flexjs-0.8.0
-Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en
-Duser.region=en -Xmx512m -classpath "/Applications/IntelliJ
IDEA.app/Contents/plugins/flex/lib/idea-flex-compiler-fix.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/flex/lib/flex-compiler.jar:/Users/joshtynjala/Development/Flex/sdks/flexjs-0.8.0/lib/flex-compiler-oem.jar"
com.intellij.flex.compiler.FlexCompiler 54900
Information:[HelloIDEA]: mxmlc
-load-config=/Users/joshtynjala/Library/Caches/IntelliJIdea2017.1/compile-server/helloidea_6d5abd99/_temp_/IntelliJ_IDEA/idea-B028A5AE-12E86E20.xml
-load-config+=/Users/joshtynjala/Development/Flex/sdks/flexjs-0.8.0/ide/IDEA/intellij-config.xml
Information:[HelloIDEA]: unknown error
Information:[HelloIDEA]: at java.lang.Class.getConstructor0(Class.java:3082)
Information:[HelloIDEA]: at
java.lang.Class.getDeclaredConstructor(Class.java:2178)
Information:[HelloIDEA]: at
flex2.tools.MxmlJSC.getCompilerInstance(MxmlJSC.java:48)
Information:[HelloIDEA]: at flex2.tools.MxmlJSC.execute(MxmlJSC.java:89)
Information:[HelloIDEA]: at flex2.tools.Tool.compile(Tool.java:68)
Information:[HelloIDEA]: at flex2.tools.Mxmlc.mxmlc(Mxmlc.java:73)
Information:[HelloIDEA]: at
com.intellij.flex.compiler.flex4.Flex4Handler.compileSwf(Flex4Handler.java:81)
Information:[HelloIDEA]: at
com.intellij.flex.compiler.CompilationThread.run(CompilationThread.java:48)
Information:[HelloIDEA]: Compilation failed
Information:7/5/17, 2:56 PM - Compilation completed with 1 error and 0
warnings in 595ms
Error:[HelloIDEA]: java.lang.NoSuchMethodException:
org.apache.flex.compiler.clients.MXMLJSC.(org.apache.flex.compiler.driver.IBackend)

I followed the steps in these instructions that worked correctly with 0.7.0:

https://cwiki.apache.org/confluence/display/FLEX/Using+FlexJS+with+IntelliJ+IDEA

I'm not very familiar with this part of the code, but it looks to me like
the call to MxmlJSC.getCompilerInstance() can't find IBackend? Could it be
that flex-compiler-oem.jar is missing something in its classpath?

- Josh


Re: [FlexJS] Use of typeof

2017-07-05 Thread Harbs
No. I was trying to use process to check whether it’s running in a Node runtime 
(such as Node or Electron). window does not have process.

I’m trying to add a class that lets the client know what environment it’s 
running in.

Adding global sounds like a good idea. Between window and global, I think that 
would offer a solution everywhere.

> On Jul 5, 2017, at 7:48 PM, Alex Harui  wrote:
> 
> Sure, I know it wouldn't work at runtime, but it sounded like Harbs
> couldn't even get the compiler to accept window["process"] which it should.
> 
> So, it should be ok to write:
> 
> if(typeof window !== "undefined")
> {
>theProcess = window["process"];
> }
> else
> 
>theProcess = global.process
> 
> But is there really a process property in the browser?
> 
> We could create or own single variable if we want.  How often do libraries
> need stuff in window/global?  Classes that need it should be able to use
> inject_html and run some JS that maps window to global or the other way
> around.
> 
> HTH,
> -Alex
> 
> On 7/5/17, 6:43 AM, "Josh Tynjala"  wrote:
> 
>> Node.js doesn't have a window variable, so window["process"] won't work.
>> They have a global variable instead.
>> 
>> I remember reading that there is a proposal for ECMAScript to standardize
>> a
>> single variable that refers to window in the browser and global in
>> Node.js,
>> but that doesn't exist yet.
>> 
>> - Josh
>> 
>> On Tue, Jul 4, 2017 at 11:35 PM, Alex Harui 
>> wrote:
>> 
>>> What class in Core needs this dependency?  I think one drawback is that
>>> users of that class will need to add node.swc to their project
>>> dependencies.  But I don't think every consumer of Core will need
>>> node.swc.
>>> 
>>> But first, why didn't window["process"] work?  In theory Falcon will let
>>> you access anything off of window.  We could also add global if we want.
>>> Or maybe we should only allow global and have some bootstrap code that
>>> maps global to window?
>>> 
>>> -Alex
>>> 
>>> On 7/4/17, 2:09 PM, "Harbs"  wrote:
>>> 
 Actually, I see that the Node typedefs has all the process declarations
 in global.js.
 
 Is there an issue with adding a dependency in CoreJS to node.swc?
 
 Should a class that has this dependency go somewhere else? (I don’t
 really see an issue with adding the dependency, but I’m throwing this
>>> out
 in case I’m missing something.)
 
 Harbs
 
> On Jul 5, 2017, at 12:00 AM, Harbs  wrote:
> 
> Looks like it.
> 
> I see this in missing.js:
> 
> /**
> * @export
> * This gets mapped to org.apache.flex.utils.Language.trace() by the
> compiler
> * @param {...} rest
> */
> function trace(rest) {}
> 
> /**
> * @type {!Console}
> * @const
> */
> var console;
> 
> 
> I guess I can add another one like so:
> 
> /**
> * @type {!Process}
> * @const
> */
> var process;
> 
> However, it seems like a drag to have to add a typedef every time a
> developer needs to check for the existence of a global that we did not
> think of.
> 
>> On Jul 4, 2017, at 9:13 PM, Harbs  wrote:
>> 
>> Thanks. Here’s what I see:
>> 
>> if(typeof window !== "undefined")
>> {
>>theConsole = window.console;
>> }
>> else if(typeof console !== "undefined")
>> {
>>theConsole = console;
>> }
>> 
>> Did you define console in a typedef maybe?
>> 
>> I’m thinking that Falcon should really allow undefined variables
>>> when
>> used with “typeof”.
>> 
>> Truth be told, I really need to do something like one of these:
>> if(typeof (process) != 'undefined' && {}.toString.call(process) ==
>> '[object process]’)
>> or:
>> if(typeof process != 'undefined' && process &&
>> process.constructor.name == "process”)
>> 
>> Of course every reference to process causes a compiler error. I
>>> wonder
>> if there’s some way to tell the compiler to accept it without
>> complaining…
>> 
>>> On Jul 4, 2017, at 8:54 PM, Josh Tynjala 
>>> wrote:
>>> 
>>> I don't remember exactly what I did, but in order to get trace()
>>> working in
>>> Node.js, I had to figure out how to find the console object on
>>> window
>>> versus global. I feel like I remember using typeof, but maybe it
>>> was
>>> something else. Take a look at the implementation of
>>> Language.trace()
>>> to
>>> see what I did.
>>> 
>>> - Josh
>>> 
>>> On Jul 4, 2017 5:26 AM, "Harbs"  wrote:
>>> 
 I’m trying to figure out how to solve this dilemma:
 
 Browsers attach global variables to window.
 
 Node.js attaches globals to global.
 

Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread yishayw
My AIR_HOME goes to my nightly installation which has Adobe AIR 23.0 SDK.



--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-Mobile-Depends-on-Flash-11-4-tp62811p62846.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Use of typeof

2017-07-05 Thread Alex Harui
Sure, I know it wouldn't work at runtime, but it sounded like Harbs
couldn't even get the compiler to accept window["process"] which it should.

So, it should be ok to write:

if(typeof window !== "undefined")
{
theProcess = window["process"];
}
else

theProcess = global.process

But is there really a process property in the browser?

We could create or own single variable if we want.  How often do libraries
need stuff in window/global?  Classes that need it should be able to use
inject_html and run some JS that maps window to global or the other way
around.

HTH,
-Alex

On 7/5/17, 6:43 AM, "Josh Tynjala"  wrote:

>Node.js doesn't have a window variable, so window["process"] won't work.
>They have a global variable instead.
>
>I remember reading that there is a proposal for ECMAScript to standardize
>a
>single variable that refers to window in the browser and global in
>Node.js,
>but that doesn't exist yet.
>
>- Josh
>
>On Tue, Jul 4, 2017 at 11:35 PM, Alex Harui 
>wrote:
>
>> What class in Core needs this dependency?  I think one drawback is that
>> users of that class will need to add node.swc to their project
>> dependencies.  But I don't think every consumer of Core will need
>>node.swc.
>>
>> But first, why didn't window["process"] work?  In theory Falcon will let
>> you access anything off of window.  We could also add global if we want.
>> Or maybe we should only allow global and have some bootstrap code that
>> maps global to window?
>>
>> -Alex
>>
>> On 7/4/17, 2:09 PM, "Harbs"  wrote:
>>
>> >Actually, I see that the Node typedefs has all the process declarations
>> >in global.js.
>> >
>> >Is there an issue with adding a dependency in CoreJS to node.swc?
>> >
>> >Should a class that has this dependency go somewhere else? (I don’t
>> >really see an issue with adding the dependency, but I’m throwing this
>>out
>> >in case I’m missing something.)
>> >
>> >Harbs
>> >
>> >> On Jul 5, 2017, at 12:00 AM, Harbs  wrote:
>> >>
>> >> Looks like it.
>> >>
>> >> I see this in missing.js:
>> >>
>> >> /**
>> >> * @export
>> >> * This gets mapped to org.apache.flex.utils.Language.trace() by the
>> >>compiler
>> >> * @param {...} rest
>> >> */
>> >> function trace(rest) {}
>> >>
>> >> /**
>> >> * @type {!Console}
>> >> * @const
>> >> */
>> >> var console;
>> >>
>> >>
>> >> I guess I can add another one like so:
>> >>
>> >> /**
>> >> * @type {!Process}
>> >> * @const
>> >> */
>> >> var process;
>> >>
>> >> However, it seems like a drag to have to add a typedef every time a
>> >>developer needs to check for the existence of a global that we did not
>> >>think of.
>> >>
>> >>> On Jul 4, 2017, at 9:13 PM, Harbs  wrote:
>> >>>
>> >>> Thanks. Here’s what I see:
>> >>>
>> >>> if(typeof window !== "undefined")
>> >>> {
>> >>> theConsole = window.console;
>> >>> }
>> >>> else if(typeof console !== "undefined")
>> >>> {
>> >>> theConsole = console;
>> >>> }
>> >>>
>> >>> Did you define console in a typedef maybe?
>> >>>
>> >>> I’m thinking that Falcon should really allow undefined variables
>>when
>> >>>used with “typeof”.
>> >>>
>> >>> Truth be told, I really need to do something like one of these:
>> >>> if(typeof (process) != 'undefined' && {}.toString.call(process) ==
>> >>>'[object process]’)
>> >>> or:
>> >>> if(typeof process != 'undefined' && process &&
>> >>>process.constructor.name == "process”)
>> >>>
>> >>> Of course every reference to process causes a compiler error. I
>>wonder
>> >>>if there’s some way to tell the compiler to accept it without
>> >>>complaining…
>> >>>
>>  On Jul 4, 2017, at 8:54 PM, Josh Tynjala 
>> wrote:
>> 
>>  I don't remember exactly what I did, but in order to get trace()
>> working in
>>  Node.js, I had to figure out how to find the console object on
>>window
>>  versus global. I feel like I remember using typeof, but maybe it
>>was
>>  something else. Take a look at the implementation of
>>Language.trace()
>> to
>>  see what I did.
>> 
>>  - Josh
>> 
>>  On Jul 4, 2017 5:26 AM, "Harbs"  wrote:
>> 
>> > I’m trying to figure out how to solve this dilemma:
>> >
>> > Browsers attach global variables to window.
>> >
>> > Node.js attaches globals to global.
>> >
>> > I’m trying to check for the existence of a global called process.
>>In
>> >JS,
>> > you’d generally do that by checking typeof process == ‘undefined’.
>> >Falcon
>> > does not allow you to do that and complains that process is an
>> >undefined
>> > property. In the browser you can use window[“process”] ==
>>undefined
>> >and in
>> > node you can (theoretically) use global[“process”] == undefined. I
>> >can’t
>> > think of a generic way to do this though.
>> >
>> > Thoughts?
>> > Harbs
>> >>>
>> >>
>> >
>>
>>



Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread Alex Harui
Interesting.  What is your AIR_HOME set to?  I think it is working for
most folks because AIR_HOME is set to something newer than 3.7.

-Alex

On 7/5/17, 12:06 AM, "yishayw"  wrote:

>I was getting the error when doing ant clean all from flex-asjs. I updated
>build.xml under Mobile to include the snippet you provided. Let me know
>if I
>misunderstood, in which case I'll revert. Not sure what, if at all, needs
>to
>change for the Maven build. Thanks.
>
>
>
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.247.n4.nabble.com%2FFlexJS-Mobile-Depends-on-Flash-11-4-
>tp62811p62840.html=02%7C01%7C%7C66502c6bf9284bb9169208d4c376ef83%7Cfa
>7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636348362983945224=hrX6EL2o
>vCouxWqhHm2ZPgMxgAXvhDnhzDt8Q98XUxs%3D=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.



Re: [FlexJS] Use of typeof

2017-07-05 Thread Josh Tynjala
Node.js doesn't have a window variable, so window["process"] won't work.
They have a global variable instead.

I remember reading that there is a proposal for ECMAScript to standardize a
single variable that refers to window in the browser and global in Node.js,
but that doesn't exist yet.

- Josh

On Tue, Jul 4, 2017 at 11:35 PM, Alex Harui 
wrote:

> What class in Core needs this dependency?  I think one drawback is that
> users of that class will need to add node.swc to their project
> dependencies.  But I don't think every consumer of Core will need node.swc.
>
> But first, why didn't window["process"] work?  In theory Falcon will let
> you access anything off of window.  We could also add global if we want.
> Or maybe we should only allow global and have some bootstrap code that
> maps global to window?
>
> -Alex
>
> On 7/4/17, 2:09 PM, "Harbs"  wrote:
>
> >Actually, I see that the Node typedefs has all the process declarations
> >in global.js.
> >
> >Is there an issue with adding a dependency in CoreJS to node.swc?
> >
> >Should a class that has this dependency go somewhere else? (I don’t
> >really see an issue with adding the dependency, but I’m throwing this out
> >in case I’m missing something.)
> >
> >Harbs
> >
> >> On Jul 5, 2017, at 12:00 AM, Harbs  wrote:
> >>
> >> Looks like it.
> >>
> >> I see this in missing.js:
> >>
> >> /**
> >> * @export
> >> * This gets mapped to org.apache.flex.utils.Language.trace() by the
> >>compiler
> >> * @param {...} rest
> >> */
> >> function trace(rest) {}
> >>
> >> /**
> >> * @type {!Console}
> >> * @const
> >> */
> >> var console;
> >>
> >>
> >> I guess I can add another one like so:
> >>
> >> /**
> >> * @type {!Process}
> >> * @const
> >> */
> >> var process;
> >>
> >> However, it seems like a drag to have to add a typedef every time a
> >>developer needs to check for the existence of a global that we did not
> >>think of.
> >>
> >>> On Jul 4, 2017, at 9:13 PM, Harbs  wrote:
> >>>
> >>> Thanks. Here’s what I see:
> >>>
> >>> if(typeof window !== "undefined")
> >>> {
> >>> theConsole = window.console;
> >>> }
> >>> else if(typeof console !== "undefined")
> >>> {
> >>> theConsole = console;
> >>> }
> >>>
> >>> Did you define console in a typedef maybe?
> >>>
> >>> I’m thinking that Falcon should really allow undefined variables when
> >>>used with “typeof”.
> >>>
> >>> Truth be told, I really need to do something like one of these:
> >>> if(typeof (process) != 'undefined' && {}.toString.call(process) ==
> >>>'[object process]’)
> >>> or:
> >>> if(typeof process != 'undefined' && process &&
> >>>process.constructor.name == "process”)
> >>>
> >>> Of course every reference to process causes a compiler error. I wonder
> >>>if there’s some way to tell the compiler to accept it without
> >>>complaining…
> >>>
>  On Jul 4, 2017, at 8:54 PM, Josh Tynjala 
> wrote:
> 
>  I don't remember exactly what I did, but in order to get trace()
> working in
>  Node.js, I had to figure out how to find the console object on window
>  versus global. I feel like I remember using typeof, but maybe it was
>  something else. Take a look at the implementation of Language.trace()
> to
>  see what I did.
> 
>  - Josh
> 
>  On Jul 4, 2017 5:26 AM, "Harbs"  wrote:
> 
> > I’m trying to figure out how to solve this dilemma:
> >
> > Browsers attach global variables to window.
> >
> > Node.js attaches globals to global.
> >
> > I’m trying to check for the existence of a global called process. In
> >JS,
> > you’d generally do that by checking typeof process == ‘undefined’.
> >Falcon
> > does not allow you to do that and complains that process is an
> >undefined
> > property. In the browser you can use window[“process”] == undefined
> >and in
> > node you can (theoretically) use global[“process”] == undefined. I
> >can’t
> > think of a generic way to do this though.
> >
> > Thoughts?
> > Harbs
> >>>
> >>
> >
>
>


RE: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Camera API requires flash verion 11.4

2017-07-05 Thread Yishay Weiss
I’m not sure. See here [1]

[1] 
http://apache-flex-development.247.n4.nabble.com/FlexJS-Mobile-Depends-on-Flash-11-4-td62811.html

From: Piotr Zarzycki
Sent: Wednesday, July 5, 2017 11:56 AM
To: dev@flex.apache.org
Subject: Re: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Camera API 
requires flash verion 11.4

Hi Yishay,

Does Maven build require this changes also ? I will look into that later
today, but maybe you can beat me :)

Thanks,
Piotr

2017-07-05 9:20 GMT+02:00 :

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/develop 722e9eed7 -> 73c18eccf
>
>
> Camera API requires flash verion 11.4
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a4e43605
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a4e43605
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a4e43605
>
> Branch: refs/heads/develop
> Commit: a4e43605769cb812ef772f9ed224fbc141959fbd
> Parents: 722e9ee
> Author: DESKTOP-RH4S838\Yishay 
> Authored: Wed Jul 5 10:11:35 2017 +0300
> Committer: DESKTOP-RH4S838\Yishay 
> Committed: Wed Jul 5 10:11:35 2017 +0300
>
> --
>  frameworks/projects/Mobile/build.xml | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> --
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> a4e43605/frameworks/projects/Mobile/build.xml
> --
> diff --git a/frameworks/projects/Mobile/build.xml
> b/frameworks/projects/Mobile/build.xml
> index 53302cc..d2aef52 100644
> --- a/frameworks/projects/Mobile/build.xml
> +++ b/frameworks/projects/Mobile/build.xml
> @@ -21,10 +21,12 @@
>
>  
>  
> -
> +
>  
>  
> -
> +   
> +
> +   
>  
>
>  
>
>



Re: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Camera API requires flash verion 11.4

2017-07-05 Thread Piotr Zarzycki
Hi Yishay,

Does Maven build require this changes also ? I will look into that later
today, but maybe you can beat me :)

Thanks,
Piotr

2017-07-05 9:20 GMT+02:00 :

> Repository: flex-asjs
> Updated Branches:
>   refs/heads/develop 722e9eed7 -> 73c18eccf
>
>
> Camera API requires flash verion 11.4
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a4e43605
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a4e43605
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a4e43605
>
> Branch: refs/heads/develop
> Commit: a4e43605769cb812ef772f9ed224fbc141959fbd
> Parents: 722e9ee
> Author: DESKTOP-RH4S838\Yishay 
> Authored: Wed Jul 5 10:11:35 2017 +0300
> Committer: DESKTOP-RH4S838\Yishay 
> Committed: Wed Jul 5 10:11:35 2017 +0300
>
> --
>  frameworks/projects/Mobile/build.xml | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> --
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> a4e43605/frameworks/projects/Mobile/build.xml
> --
> diff --git a/frameworks/projects/Mobile/build.xml
> b/frameworks/projects/Mobile/build.xml
> index 53302cc..d2aef52 100644
> --- a/frameworks/projects/Mobile/build.xml
> +++ b/frameworks/projects/Mobile/build.xml
> @@ -21,10 +21,12 @@
>
>  
>  
> -
> +
>  
>  
> -
> +   
> +
> +   
>  
>
>  
>
>


Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread yishayw
I was getting the error when doing ant clean all from flex-asjs. I updated
build.xml under Mobile to include the snippet you provided. Let me know if I
misunderstood, in which case I'll revert. Not sure what, if at all, needs to
change for the Maven build. Thanks.



--
View this message in context: 
http://apache-flex-development.247.n4.nabble.com/FlexJS-Mobile-Depends-on-Flash-11-4-tp62811p62840.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread Alex Harui
Yes but in examples/flexjs/CordovaCameraExample, it specifies 11.4 and
swfversion 17.  Anyone who wants to use a later API than our baseline can
do that.

-Alex

On 7/4/17, 11:30 PM, "Harbs"  wrote:

>Where is that from?
>
>In build.properties I see this:
>
># flex-sdk-description values
>release.name = Apache Flex (FlexJS)
># this is the version that appears in the flex-sdk-description
> tag
># and on the package name.  This is the publicly known version of FlexJS
>release.version = 0.9.0
>
># fb.release.version must start with 4 in order for FB to accept it.
># intellij seems to want it to be at least 4.6 in order to not use certain
># older plugins that have incompatible Java APIs.  We might as well keep
># the major/minor current with the version of FDB we are borrowing from
># the flex-sdk
># this property should only go in flex-sdk-description.xml  tag
>fb.release.version = 4.14.1
>
># override on command line with -Dbuild.number=999 or in local.properties
>build.number = 0
>
># Flash player version for which player global swc to use
>playerglobal.version = 11.1
>
># AIR version number
>air.version = 14.0
>
>> On Jul 5, 2017, at 9:19 AM, Alex Harui  wrote:
>> 
>> Which build?  The Ant build is set for
>> 
>> 
>>
>> 
>> -Alex
>> 
>> On 7/4/17, 12:14 AM, "yishayw" >> wrote:
>> 
>>> I was having a problem building the Mobile package. It was complaining
>>> about
>>> line 151 in Camera.as which does camera.copyToByteArray(). Looking at
>>>the
>>> docs [1], it looks like this method became available in flash 11.4
>>>while
>>> the
>>> build is set to look for flash player 11.1 (under build.properties).
>>> 
>>> So I changed to flash 25.0 and rebuilt, and Mobile passed. The funny
>>>thing
>>> is that after changing back to 11.1, the build now passes.
>>> 
>>> In short, it looks to me like the flash player requirement should be
>>> updated
>>> to 11.4.
>>> 
>>> What do you guys think?
>>> 
>>> [1]
>>> 
>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhelp.ado
>>>be 
>>>>>obe>
>>> 
>>>.com%2Fen_US%2FFlashPlatform%2Freference%2Factionscript%2F3%2Fflash%2Fme
>>>di
>>> 
>>>a%2FCamera.html%23copyToByteArray=02%7C01%7C%7C9957eba96c8347ef1901
>>>08
>>> 
>>>d4c2aee848%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6363475038585349
>>>35
>>> =t2FKQyYZBDQzz1E4L6FVOGYTZObeTGuBx3xIMI%2FfXUk%3D=0()
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> 
>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-f
>>>le 
>>>>>fle>
>>> x-development.247.n4.nabble.com
>>>>>opment.247.n4.nabble.com%2F=02%7C01%7C%7C2ae4650276b3461947dc08
>>>d4c36f6211%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6363483305299484
>>>16=NtbPWx1ixfXzbm3ViAz2hIu9Zt4tEH8kVcSmPoUierQ%3D=0>%2FFl
>>>exJS-Mobile-Depends-on-Flash-11-4-
>>> 
>>>tp62811.html=02%7C01%7C%7C9957eba96c8347ef190108d4c2aee848%7Cfa7b1b
>>>5a
>>> 
>>>7b34438794aed2c178decee1%7C0%7C0%7C636347503858534935=%2BRDJB%2BVo
>>>JU
>>> AqIl1xxh6fniXZ4A5whl%2FFovxyZaaztfg%3D=0
>>> Sent from the Apache Flex Development mailing list archive at
>>>Nabble.com 
>>>>>com%2F=02%7C01%7C%7C2ae4650276b3461947dc08d4c36f6211%7Cfa7b1b5a7b34
>>>438794aed2c178decee1%7C0%7C0%7C636348330529948416=gWaoiD50cLESEnTx
>>>yBDGwsVR8pX8CDOjfSL8UdxZzCY%3D=0>.
>



Re: [FlexJS] Use of typeof

2017-07-05 Thread Alex Harui
What class in Core needs this dependency?  I think one drawback is that
users of that class will need to add node.swc to their project
dependencies.  But I don't think every consumer of Core will need node.swc.

But first, why didn't window["process"] work?  In theory Falcon will let
you access anything off of window.  We could also add global if we want.
Or maybe we should only allow global and have some bootstrap code that
maps global to window?

-Alex

On 7/4/17, 2:09 PM, "Harbs"  wrote:

>Actually, I see that the Node typedefs has all the process declarations
>in global.js.
>
>Is there an issue with adding a dependency in CoreJS to node.swc?
>
>Should a class that has this dependency go somewhere else? (I don’t
>really see an issue with adding the dependency, but I’m throwing this out
>in case I’m missing something.)
>
>Harbs
>
>> On Jul 5, 2017, at 12:00 AM, Harbs  wrote:
>> 
>> Looks like it.
>> 
>> I see this in missing.js:
>> 
>> /**
>> * @export
>> * This gets mapped to org.apache.flex.utils.Language.trace() by the
>>compiler
>> * @param {...} rest
>> */
>> function trace(rest) {}
>> 
>> /**
>> * @type {!Console}
>> * @const
>> */
>> var console;
>> 
>> 
>> I guess I can add another one like so:
>> 
>> /**
>> * @type {!Process}
>> * @const
>> */
>> var process;
>> 
>> However, it seems like a drag to have to add a typedef every time a
>>developer needs to check for the existence of a global that we did not
>>think of.
>> 
>>> On Jul 4, 2017, at 9:13 PM, Harbs  wrote:
>>> 
>>> Thanks. Here’s what I see:
>>> 
>>> if(typeof window !== "undefined")
>>> {
>>> theConsole = window.console;
>>> }
>>> else if(typeof console !== "undefined")
>>> {
>>> theConsole = console;
>>> }
>>> 
>>> Did you define console in a typedef maybe?
>>> 
>>> I’m thinking that Falcon should really allow undefined variables when
>>>used with “typeof”.
>>> 
>>> Truth be told, I really need to do something like one of these:
>>> if(typeof (process) != 'undefined' && {}.toString.call(process) ==
>>>'[object process]’)
>>> or:
>>> if(typeof process != 'undefined' && process &&
>>>process.constructor.name == "process”)
>>> 
>>> Of course every reference to process causes a compiler error. I wonder
>>>if there’s some way to tell the compiler to accept it without
>>>complaining…
>>> 
 On Jul 4, 2017, at 8:54 PM, Josh Tynjala 
wrote:
 
 I don't remember exactly what I did, but in order to get trace()
working in
 Node.js, I had to figure out how to find the console object on window
 versus global. I feel like I remember using typeof, but maybe it was
 something else. Take a look at the implementation of Language.trace()
to
 see what I did.
 
 - Josh
 
 On Jul 4, 2017 5:26 AM, "Harbs"  wrote:
 
> I’m trying to figure out how to solve this dilemma:
> 
> Browsers attach global variables to window.
> 
> Node.js attaches globals to global.
> 
> I’m trying to check for the existence of a global called process. In
>JS,
> you’d generally do that by checking typeof process == ‘undefined’.
>Falcon
> does not allow you to do that and complains that process is an
>undefined
> property. In the browser you can use window[“process”] == undefined
>and in
> node you can (theoretically) use global[“process”] == undefined. I
>can’t
> think of a generic way to do this though.
> 
> Thoughts?
> Harbs
>>> 
>> 
>



Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread Harbs
Where is that from?

In build.properties I see this:

# flex-sdk-description values
release.name = Apache Flex (FlexJS)
# this is the version that appears in the flex-sdk-description  tag
# and on the package name.  This is the publicly known version of FlexJS
release.version = 0.9.0

# fb.release.version must start with 4 in order for FB to accept it.
# intellij seems to want it to be at least 4.6 in order to not use certain
# older plugins that have incompatible Java APIs.  We might as well keep
# the major/minor current with the version of FDB we are borrowing from
# the flex-sdk
# this property should only go in flex-sdk-description.xml  tag
fb.release.version = 4.14.1

# override on command line with -Dbuild.number=999 or in local.properties
build.number = 0

# Flash player version for which player global swc to use
playerglobal.version = 11.1

# AIR version number
air.version = 14.0

> On Jul 5, 2017, at 9:19 AM, Alex Harui  wrote:
> 
> Which build?  The Ant build is set for
> 
> 
>
> 
> -Alex
> 
> On 7/4/17, 12:14 AM, "yishayw"  > wrote:
> 
>> I was having a problem building the Mobile package. It was complaining
>> about
>> line 151 in Camera.as which does camera.copyToByteArray(). Looking at the
>> docs [1], it looks like this method became available in flash 11.4 while
>> the
>> build is set to look for flash player 11.1 (under build.properties).
>> 
>> So I changed to flash 25.0 and rebuilt, and Mobile passed. The funny thing
>> is that after changing back to 11.1, the build now passes.
>> 
>> In short, it looks to me like the flash player requirement should be
>> updated
>> to 11.4.
>> 
>> What do you guys think?
>> 
>> [1]
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhelp.adobe 
>> 
>> .com%2Fen_US%2FFlashPlatform%2Freference%2Factionscript%2F3%2Fflash%2Fmedi
>> a%2FCamera.html%23copyToByteArray=02%7C01%7C%7C9957eba96c8347ef190108
>> d4c2aee848%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636347503858534935
>> =t2FKQyYZBDQzz1E4L6FVOGYTZObeTGuBx3xIMI%2FfXUk%3D=0()
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle 
>> 
>> x-development.247.n4.nabble.com 
>> %2FFlexJS-Mobile-Depends-on-Flash-11-4-
>> tp62811.html=02%7C01%7C%7C9957eba96c8347ef190108d4c2aee848%7Cfa7b1b5a
>> 7b34438794aed2c178decee1%7C0%7C0%7C636347503858534935=%2BRDJB%2BVoJU
>> AqIl1xxh6fniXZ4A5whl%2FFovxyZaaztfg%3D=0
>> Sent from the Apache Flex Development mailing list archive at Nabble.com 
>> .



Re: [FlexJS] Mobile Depends on Flash 11.4?

2017-07-05 Thread Alex Harui
Which build?  The Ant build is set for




-Alex

On 7/4/17, 12:14 AM, "yishayw"  wrote:

>I was having a problem building the Mobile package. It was complaining
>about
>line 151 in Camera.as which does camera.copyToByteArray(). Looking at the
>docs [1], it looks like this method became available in flash 11.4 while
>the
>build is set to look for flash player 11.1 (under build.properties).
>
>So I changed to flash 25.0 and rebuilt, and Mobile passed. The funny thing
>is that after changing back to 11.1, the build now passes.
>
>In short, it looks to me like the flash player requirement should be
>updated
>to 11.4.
>
>What do you guys think?
>
>[1]
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhelp.adobe
>.com%2Fen_US%2FFlashPlatform%2Freference%2Factionscript%2F3%2Fflash%2Fmedi
>a%2FCamera.html%23copyToByteArray=02%7C01%7C%7C9957eba96c8347ef190108
>d4c2aee848%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636347503858534935
>=t2FKQyYZBDQzz1E4L6FVOGYTZObeTGuBx3xIMI%2FfXUk%3D=0()
>
>
>
>
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.247.n4.nabble.com%2FFlexJS-Mobile-Depends-on-Flash-11-4-
>tp62811.html=02%7C01%7C%7C9957eba96c8347ef190108d4c2aee848%7Cfa7b1b5a
>7b34438794aed2c178decee1%7C0%7C0%7C636347503858534935=%2BRDJB%2BVoJU
>AqIl1xxh6fniXZ4A5whl%2FFovxyZaaztfg%3D=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.