Hi Carlos,

I had used your blog post to create my initial version ... but I added your 
copy-resources solution to stage my test-code. Thanks for that.
But I also needed to replace the goog.addDependency urls in all of the modules 
to use the relative path or my modules wouldn't load.
Now it's working, as I said yesterday, but if a module uses a class that the 
main application also provides I get an error as soon as the
the module tries to add the already loaded type ... it doesn't cause an error, 
but I get error reports in the developer-tools.

Chris


Am 24.08.20, 12:19 schrieb "Carlos Rovira" <[email protected]>:

    Hi Chris,

    I solved that in blog example [1] via maven [2].
    Maybe a hack similar to what you did?

    Anyway I think I vaguely remember to see something related to that in repo,
    going to check and see if I find it and will come back.

    I think this could be improved.

    [1]
    
https://royale.apache.org/dividing-an-apache-royale-application-with-modules/
    [2]
    
https://github.com/apache/royale-asjs/blob/fad51dad1cc77d27492dbf224233179da8483e36/examples/blog/BE0013_Dividing_an_Apache_Royale_application_with_modules/JewelModule/pom.xml#L48

    El dom., 23 ago. 2020 a las 22:44, Christofer Dutz (<
    [email protected]>) escribió:

    > Ok ... so my replace plugin hack worked.
    >
    > Now I got the next little issue:
    >
    > - If a module declares a type which was declared somewhere else, I am
    > getting errors in the browser, however the application still seems to 
work.
    >
    > Is there a way to tell the system to not fire errors if a type was already
    > declared?
    >
    > Chris
    >
    >
    >
    > Am 23.08.20, 22:04 schrieb "Christofer Dutz" <[email protected]>:
    >
    >     Ok ... so I got even further.
    >
    >     If I modify the TestAModule__deps.js file and replaced the "../../../"
    > prefixes with "../../../main/TestAModule/".
    >     It seems to work ... so is there a way to have this generated by the
    > compiler?
    >
    >     Otherwise I'll probably just have to use a replace maven plugin to
    > modify the files.
    >
    >     Chris
    >
    >
    >     Am 23.08.20, 21:24 schrieb "Christofer Dutz" <
    > [email protected]>:
    >
    >         Ok ... so it seems to be picking up the "TestAModule__deps.js"
    > correctly ...
    >
    >         However this tells the application to load stuff from the root (No
    > idea why all entries there have "../../../" as prefix. But it seems all
    > output files of Royale have this 3-segment prefix.
    >
    >         Chris
    >
    >
    >         Am 23.08.20, 20:57 schrieb "Christofer Dutz" <
    > [email protected]>:
    >
    >             Hi all,
    >
    >             today I extended my experiments to loading of modules. So as
    > soon as a user logs in, it gets a list of modules he’s allowed to use.
    >             Then the application dynamically loads only these modules.
    >
    >             So I managed to get the ModuleLoader to correctly load the css
    > file from a subdirectory:
    >
    >             <j:SectionContent name="TestAModule">
    >               <j:ModuleLoader height="100%" width="100%" autoLoad="true"
    >                               moduleName="TestAModule"
    > modulePath="main/TestAModule"/>
    >             </j:SectionContent>
    >
    >             In the browser I can see it loading some stuff from the
    > subdirectory “main/TestAModule” … unfortunately it tries to load the js
    > file “TestAModule.js” from the root and not from that sub-directory.
    >
    >             What do I have to do to make it load this from the right 
place?
    >
    >             Chris
    >
    >
    >
    >
    >

    -- 
    Carlos Rovira
    http://about.me/carlosrovira

Reply via email to