You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/09/06 16:19:28 UTC

[GitHub] [royale-compiler] mrchnk opened a new issue #95: Unneeded dependency on 'xml' in every JS file.

mrchnk opened a new issue #95: Unneeded dependency on 'xml' in every JS file.
URL: https://github.com/apache/royale-compiler/issues/95
 
 
   If a project has a dependency on XML in any class, that dependency is appended to every JS files.
   option `-remove-circulars` should be set to `false` to reproduce that.
   
   Also sometimes line with dependency `goog.require("XML");` placed wrongly at file tail (1 line before last)
   That happened when goog.provide is not present in JS file (expected for files with `@externs`)
   ```
   package {
   
     /**
      * @externs
      */
     public interface ExternalWithoutDependency {
   
       function doSomething():void;
   
     }
   } 
   ```
   
   ```
   /**
    * Generated by Apache Royale Compiler from ExternalWithoutDependency.as
    * ExternalWithoutDependency
    *
    * @fileoverview
    * @externs
    *
    * @suppress {checkTypes|accessControls}
    */
   
   
   /**
    * @interface
    */
   ExternalWithoutDependency = function() {
   };
   ExternalWithoutDependency.prototype.doSomething = function() {
   goog.require('XML');
   };
   ```
   
   
   When `-remove-circulars` set to `true` dependencies on `XML` removed except wrongly placed.
   In that case building with `closure-compiler` for release will fail in most cases with messages:
   
   ```
   SEVERE: .../royale-compiler-problems/goog-require-xml/out/bin/js-debug/ExternalWithoutDependency.js:18: ERROR - Closure primitive methods (goog.provide, goog.require, goog.define, etc) must be called  at file scope.
   goog.require('XML');
   ^^^^^^^^^^^^^^^^^^^
   ```
   
   A minimal project to reproduced that could be found at https://github.com/mrchnk/royale-compiler-problems/tree/master/goog-require-xml
   
   Found that behavior in nightly maven builds.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services