When a class becomes a static dependency, it's goog.require goes in the class 
that statically depends on it, unless the GoogDepsWriter can determine that 
some other class has already goog.require'd it.  All other dependencies are 
gathered and stuffed into the main app.  So yes, when we come up other reasons 
a dependency has to be "static" (might be needed as the scripts load instead of 
after the main app is created, these dependencies will disappear from the main 
app's list, and should show up elsewhere.  So grep for goog.require of the 
missing class and it should show up in another file.

But if you didn't blow away all of your files in bin/js-debug, they may contain 
cached dependency information that is now invalid.   Please confirm that you 
deleted all of those files.

Allowing more files to be in the requires for the main app might fix your 
problem, but could introduce a circular dependency in other situations, so it 
is best to truly understand whether the missing dependency is listed elsewhere 
or not and why.  Also, please provide the error you are getting and why you are 
getting it.

-Alex

On 11/29/18, 6:46 AM, "Yishay Weiss" <yishayj...@hotmail.com> wrote:

    By “dependency list” I mean the list of
    
    
    
    goog.require('…');
    
    
    
    statements at the beginning of the transpiled application file.
    
    
    
    After debugging this, I found out that in GoogDepsWriter:229 replacing
    
    
    
                                      if (!restOfDeps.contains(gd.className) && 
!gd.fileInfo.isExtern && !isExternal(gd.className) && 
!usedDeps.contains(gd.class Name))
    
    
    
    with
    
                                      if (!restOfDeps.contains(gd.className) && 
!gd.fileInfo.isExtern && !isExternal(gd.className)) seems to fix this 
particular problem.
    
    
    
    I’m still not sure what the proper fix is. Our class (A) gets added to 
usedDeps in this snippet
    
    
    
                                      if (gd.fileInfo.staticDeps != null)
    
                                      {
    
                                             for (String dep : 
gd.fileInfo.staticDeps)
    
                                             {
    
                                                   if (!deps.contains(dep))
    
                                                          deps.add(dep);
    
                                                   if (!usedDeps.contains(dep))
    
                                                          usedDeps.add(dep);
    
                                             }
    
                                      }
    
    When I inspect this I see that gd.className == A, and 
gd.fileInfo.staticDeps[0] is also A.
    
    
    
    Does that make sense?
    
    
    
    
    
    
    
    
    
    
    
    ________________________________
    From: Alex Harui <aha...@adobe.com.INVALID>
    Sent: Wednesday, November 28, 2018 7:03:55 PM
    To: dev@royale.apache.org
    Subject: Re: Dependency Missing
    
    What is the "dependency list" you are referring to?
    
    On 11/28/18, 8:55 AM, "Yishay Weiss" <yishayj...@hotmail.com> wrote:
    
        Hi Alex,
    
        It  looks like commit 3252eb312b09cbf5270d78aadc785d757743d323 (fix 
deps writing when we promote requires from static initializers)  in the 
compiler has broken our app. One of the classes isn’t added to the dependency 
list despite being imported.
    
        I still haven’t been able to isolate this to a test case, but one thing 
that strikes me about the missing dependency is that it has a static function 
before the constructor. Also, the constructor takes an argument.
    
        If something pops to mind, please let us know. Otherwise, I’ll try to 
debug the compiler tomorrow.
    
        Thanks.
    
    
    
    

Reply via email to