I can't tell from this thread what an "extern" is, but I believe at least in js-debug, if you goog.require something that doesn't have a goog.provide in it, there can be other problems. So maybe it was already broken, but this does not seem like a positive change. I expect other things to break. I'm surprised the GoogDepsWriter didn't output warnings or errors.
Most Externs are in royale-typedefs and their SWCs should be on the -external-library-path. In theory, their .js files get handed to Google Closure Compiler as externs not as regular js files. Source externs are supposed to do the same thing. IIRC, if you use a typedefs SWC to compile a framework SWC, then the typedefs SWC must be in the external-library-path for the application that uses the framework SWC. Thanks, -Alex On 7/9/19, 9:11 AM, "Josh Tynjala" <[email protected]> wrote: Without a goog.require(), the .js file for the extern does not seem to be copied to the output folder, and Closure renames its APIs. How the compiler behaved *before* my change: * If I reference the extern in a library, the compiler did not add a goog.require() for it. * If I reference the extern in an application, *the compiler added a goog.require() for it.* How it works after my change: * If I reference the extern in a library, the compiler adds a goog.require() for it. * If I reference the extern in an application, the compiler adds a goog.require() for it. I made the compiler's behavior more consistent because the it was already adding goog.require() for externs in applications. If that's wrong, it was already wrong before I made any changes. -- Josh Tynjala Bowler Hat LLC <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbowlerhat.dev&data=02%7C01%7Caharui%40adobe.com%7Cc589f5d7d32c425579c208d70488262a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636982855118961103&sdata=B4z9PGs%2FVKFu7ZOPupm1UTRVxdw38MEx2yehIFPNKmc%3D&reserved=0> On Mon, Jul 8, 2019 at 11:26 PM Alex Harui <[email protected]> wrote: > This doesn't seem right to me. Externs should be representing JS files > that don't have goog.provide in them. > > -Alex > > On 7/8/19, 1:40 PM, "[email protected]" <[email protected]> > wrote: > > This is an automated email from the ASF dual-hosted git repository. > > joshtynjala pushed a commit to branch develop > in repository > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-compiler.git&data=02%7C01%7Caharui%40adobe.com%7Cc589f5d7d32c425579c208d70488262a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636982855118961103&sdata=C4JjqtBaAcFyhUCORG7jgDP3X0bthRGexYZVS%2B1A29Q%3D&reserved=0 > > > The following commit(s) were added to refs/heads/develop by this push: > new 942a423 PackageHeaderEmitter: output goog.require() for > externs because release builds fail without it > 942a423 is described below > > commit 942a4235758020239eca707a5e5c73e94a63df8c > Author: Josh Tynjala <[email protected]> > AuthorDate: Mon Jul 8 13:40:05 2019 -0700 > > PackageHeaderEmitter: output goog.require() for externs because > release builds fail without it > --- > .../royale/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > | 3 --- > 1 file changed, 3 deletions(-) > > diff --git > a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > index 7c8b9ac..57cfc76 100644 > --- > a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > +++ > b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > @@ -380,9 +380,6 @@ public class PackageHeaderEmitter extends > JSSubEmitter implements > > if (imp.equals(cname)) > continue; > - > - if (project.sourceExterns.contains(imp)) > - continue; > > if (NativeUtils.isNative(imp)) > { > > > >
