On Thu, Dec 31, 2015 at 2:42 AM, Alex Harui <aha...@adobe.com> wrote:
> > On 12/30/15, 10:31 PM, "Andy Dufilie" <andy.dufi...@gmail.com> wrote: > >- When I run flexjs/js/bin/compc I get a bin-release folder with the JS > >output files. I then try to run closure manually on these files, and I > >get > >circular dependency errors for my code that do not appear when using > >flexjs/js/bin/mxmlc. Is there an additional step that happens behind the > >scenes, removing circular dependencies? > > Yes. GoogDepsWriter does that. Unless you are porting existing libraries > and it is important to retain the APIs, you might want to consider > designing libraries to not have circular dependencies. I don't want to > make that a hard rule so we try to handle circularities, and there is an > open JIRA to try a more sophisticated scheme of handling circularities. > > I'm porting a code base that is nearly 100,000 lines of code. The entire project is over 200,000 lines, but I'm only porting the non-GUI code. Every time I remember having a circular dependency it turned into a runtime problem that the compiler couldn't help me with. For example, a static instance of an object wouldn't get created because a class is unavailable during static initialization due to a circular dependency. I would actually prefer if the compiler treated circular dependencies as errors instead of trying to force things to work. Errors showing "A -> B -> C -> A" helped me resolve some issues that I didn't know existed. I'd recommend making removeCirculars() available as an option, but not the default. Thanks for listing specific source files and their purpose - very helpful for someone like me who wants to contribute but isn't familiar with the architecture. Andy