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 2020/08/25 09:02:30 UTC

[GitHub] [royale-asjs] chrisdutz opened a new issue #899: When using modules together with the "-module-output" compiler option, there are differences between loading a module with "autoLoad=true" or "autoLoad=false"

chrisdutz opened a new issue #899:
URL: https://github.com/apache/royale-asjs/issues/899


   When loading modules I get browser errors if "autoLoad=true" for my modules, but all works if I manually call "loadModule()". I am using the "-module-output" compiler option so the modules are output in "modules/module1" and "modules/module2" directories. So the result is that dependencies are located in the final application in multiple locations. (At least once for each module that uses them) 
   
   If I user autoLoad=true I get a browser error for every time a type is loaded that has been previously loaded by the main application or a previously loaded module.
   
   However if I select "autoLoad=false" and explicitly load the module by clicking a button all seems to work and I don't get the error.
   
   I would at least expect consistency in this matter.


----------------------------------------------------------------
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



[GitHub] [royale-asjs] chrisdutz commented on issue #899: When using modules together with the "-module-output" compiler option, there are differences between loading a module with "autoLoad=true" or "autoLoad=false"

Posted by GitBox <gi...@apache.org>.
chrisdutz commented on issue #899:
URL: https://github.com/apache/royale-asjs/issues/899#issuecomment-679900987


   The above zip contains an example that reproduces the errors.


----------------------------------------------------------------
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



[GitHub] [royale-asjs] chrisdutz commented on issue #899: When using modules together with the "-module-output" compiler option, there are differences between loading a module with "autoLoad=true" or "autoLoad=false"

Posted by GitBox <gi...@apache.org>.
chrisdutz commented on issue #899:
URL: https://github.com/apache/royale-asjs/issues/899#issuecomment-679948253


   So currently I think if something requires a class, royale checks if it's already registered. If it's not, it uses the information in the "addDependency" to fetch it. As soon as the class is loaded, the first code-line in the type makes it register itself so the next component requiring the same type will re-use that.
   
   So I think a solution would be not to only track which types are "provided" (actively loaded already) but also which ones where requested and sort of are "in flight" and to not re-request ones that have been requested.


----------------------------------------------------------------
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



[GitHub] [royale-asjs] chrisdutz commented on issue #899: When using modules together with the "-module-output" compiler option, there are differences between loading a module with "autoLoad=true" or "autoLoad=false"

Posted by GitBox <gi...@apache.org>.
chrisdutz commented on issue #899:
URL: https://github.com/apache/royale-asjs/issues/899#issuecomment-679946643


   I think I narrowed down the problem: 
   So I assume that the "{modulename}__deps.js" files act as a hint to where to get stuff that's missing and what's the actual content of the module ("goog.require('JewelModule');" call after all of the goog.addDependency calls) ... and when setting autoLoad=true both start loading almost simultaneously. I know it's not multi-threadded, but I would assume the first module starts and as nothing is declared yet, it fetches all ... asynchronously using the urls it has in it's __deps.js file. Then comes the next module and as the asnychronous call hasn't returned and the browser hasn't registered the types yet the second module requests it's versions (which have a different URL) ... so as soon as the first request is returned all is ok ... but as soon as the second comes: BOOM!
   ![autoLoad-true](https://user-images.githubusercontent.com/651105/91164760-e43c5780-e6cf-11ea-99f9-bd1c67a305db.png)
   ![autoLoad-false](https://user-images.githubusercontent.com/651105/91164762-e56d8480-e6cf-11ea-9638-eada3eb688ed.png)
   
   


----------------------------------------------------------------
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



[GitHub] [royale-asjs] chrisdutz commented on issue #899: When using modules together with the "-module-output" compiler option, there are differences between loading a module with "autoLoad=true" or "autoLoad=false"

Posted by GitBox <gi...@apache.org>.
chrisdutz commented on issue #899:
URL: https://github.com/apache/royale-asjs/issues/899#issuecomment-679900806


   [BE0013_Dividing_an_Apache_Royale_application_with_modules (1).zip](https://github.com/apache/royale-asjs/files/5122560/BE0013_Dividing_an_Apache_Royale_application_with_modules.1.zip)
   


----------------------------------------------------------------
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