You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by lizhi <sl...@qq.com> on 2015/12/01 03:33:43 UTC

Re: flexjs ERROR - Circular dependency detected

in develop the flash api flexjs,i have a lot of this iuuse.
but i alreay fixed it.

1, in flash the stage extends the displayobject,and displayobject have a
stage var.

2,graphics have to use sprite,and sprite have a graphics var.

3,
...

etc,
many

and now i make stage extends object,fixed it.
https://github.com/matrix3d/spriteflexjs/blob/master/src/flash/display/Stage.as



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50364.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by Alex Harui <ah...@adobe.com>.

On 12/6/15, 6:31 PM, "lizhi" <sl...@qq.com> wrote:

>can you code it?i can not understand.
>and pls output the full info of Circular dependency detected.
>
>i some code,i just get A Circular dependency detected A.
>i need A -B,B-C,C-A.
>
>but now i just get A-A,no clear
>

Unfortunately, it is the Google Closure Compiler reporting the circular
dependency so we can't get more information very easily.

-Alex


Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
can you code it?i can not understand.
and pls output the full info of Circular dependency detected.

i some code,i just get A Circular dependency detected A.
i need A -B,B-C,C-A.

but now i just get A-A,no clear



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50521.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
http://www.bitnative.com/2015/02/03/circular-dependencies-in-requirejs/



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50645.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
yes,your are right.

but i am said,
it is will lost of a lot of great lib(starling,away3d).

use this lib,must do a lot of rebuild.

but if the flexjs,support the cdd,it will good for as3 lib.

helpful this same code,gen as and js.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50751.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by Alex Harui <ah...@adobe.com>.

On 12/15/15, 8:41 PM, "lizhi" <sl...@qq.com> wrote:

>1,yes it is involves you changing your code,but the code it is the js code
>from the as.
>the same as code gen diffrent js code?

Sure, but the compiler does not create or break class dependencies.
Whether we use Google's require or RequireJS, a circularity is a
circularity.  It is interesting that none of the suggestions in the links
were about using interfaces, which is what I would recommend for new code,
but if you are implementing an existing API you don't have that choice.

>
>2,pls try this,https://github.com/matrix3d/Starling-Framework
>i an working on starling flexjs.
>it is get this bug.
>
>if can not slove the bug,a lot of lib can not run.
>
>so,thie bug is the higt level of flexjs.

So are plenty of other bugs that have been filed recently.  I will get to
them as fast as I can, but we need to finish the back port first.  Others
are more than welcome to contribute patches for these bugs.

-Alex


Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
1,yes it is involves you changing your code,but the code it is the js code
from the as.
the same as code gen diffrent js code? 

2,pls try this,https://github.com/matrix3d/Starling-Framework
i an working on starling flexjs.
it is get this bug.

if can not slove the bug,a lot of lib can not run.

so,thie bug is the higt level of flexjs.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50650.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

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

In both links, every suggestion involves you changing your code, not any
change to the compiler.  We are not using RequireJS, we are using Google
Closure's provide/require.  I am going to experiment with different ways
of generating the requires list after we finish merging the back port
branch and I fix other bugs that are in the queue.

-Alex

On 12/15/15, 4:24 PM, "lizhi" <sl...@qq.com> wrote:

>http://misko.hevery.com/2008/08/01/circular-dependency-in-constructors-and
>-dependency-injection/
>
>
>
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular
>-dependency-detected-tp50323p50646.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
http://misko.hevery.com/2008/08/01/circular-dependency-in-constructors-and-dependency-injection/



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50646.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
it is a bug very importent by flexjs.i think it is must be fix



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50644.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by Alex Harui <ah...@adobe.com>.
This example doesn't actually "use B" because still no code actually
instantiates a B.

I think we'll have to revisit how we choose the requires.  I'll play
around with it.

Google recommends using more interfaces to get rid of the cycles.

On 12/6/15, 6:43 PM, "lizhi" <sl...@qq.com> wrote:

>package 
>{
>	/**
>	 * ...
>	 * @author lizhi
>	 */
>	public class Test
>	{
>		private var b:B;
>		public function Test()
>		{
>			new A;
>			alert("ok");
>		}
>		
>	}
>
>}
>
>i now make Test class,use the B;
>but also not work
>
>
>
>--
>View this message in context:
>http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular
>-dependency-detected-tp50323p50523.html
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: flexjs ERROR - Circular dependency detected

Posted by lizhi <sl...@qq.com>.
package 
{
	/**
	 * ...
	 * @author lizhi
	 */
	public class Test 
	{
		private var b:B;
		public function Test() 
		{
			new A;
			alert("ok");
		}
		
	}

}

i now make Test class,use the B;
but also not work



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/flexjs-ERROR-Circular-dependency-detected-tp50323p50523.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: flexjs ERROR - Circular dependency detected

Posted by Alex Harui <ah...@adobe.com>.

On 11/30/15, 6:33 PM, "lizhi" <sl...@qq.com> wrote:

>in develop the flash api flexjs,i have a lot of this iuuse.
>but i alreay fixed it.
>
>1, in flash the stage extends the displayobject,and displayobject have a
>stage var.
>
>2,graphics have to use sprite,and sprite have a graphics var.
>
>3,

There are plenty of circular dependencies in the FlexJS framework and the
compiler handles it by removing certain goog.require statements that the
Google Closure optimizing compiler is complaining about.  In the small
test case you provided there was no other class that required "B".

I'm wondering if you are creating empty definitions for flash classes and
not actually creating instances of those classes.  Usually there is a
chain of dependencies that start with the main app needing to create
instances of classes instead of just setting the type of a property.

There is an @flexjsignoreimport asdoc tag you can try that should cause
the compiler to skip the goog.require and could eliminate the circularity
so you don't have to mess up the base class hierarchy.

HTH,
-Alex