How to Set Path in UIModuleLoader

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Set Path in UIModuleLoader

doug777
Re Converting my project from Spark browser project to Royale JS only.

I have done some initial testing of my modules by making them into
individual Views, but can't get very far with this as I need to pass data
from one to the next. However they are built correctly and will run to some
extent.

I have now changed them to modules so that the original structure is
restored in order to make it all work together -

 For each module in Main.mxml
js:UIModuleLoader moduleName="myModule" modulePath="??"

 And in the module
js:UIModule etc

Relative to Main.mxml my modules are located at
com.mySiteName.myProjectName.folder1 and folder2.

I have tried various modulePaths, but the browser always reports -

Loading failed for the <script> with source
“entire_url_including_the_modulePath_I've_specified.|/|\MyModule__deps.js”.

The browser is correct, there are no files something__deps.js in the build.

I have tried every combination with dot notation, /, \, with and without
com.mySiteName in the path, but there is never any file in the build called
something__deps.js and none of the modules themselves are built to JS
either, although their mxml files are in the folder myProjectName in the
build.

What am I missing here?

Doug

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

Alex Harui-2
Hi Doug,

What is the Flex code you are trying to migrate?  How did you pass data in
Flex?

Thanks,
-Alex

On 4/2/18, 8:56 PM, "doug777" <[hidden email]> wrote:

>Re Converting my project from Spark browser project to Royale JS only.
>
>I have done some initial testing of my modules by making them into
>individual Views, but can't get very far with this as I need to pass data
>from one to the next. However they are built correctly and will run to
>some
>extent.
>
>I have now changed them to modules so that the original structure is
>restored in order to make it all work together -
>
> For each module in Main.mxml
>js:UIModuleLoader moduleName="myModule" modulePath="??"
>
> And in the module
>js:UIModule etc
>
>Relative to Main.mxml my modules are located at
>com.mySiteName.myProjectName.folder1 and folder2.
>
>I have tried various modulePaths, but the browser always reports -
>
>Loading failed for the <script> with source
>“entire_url_including_the_modulePath_I've_specified.|/|\MyModule__deps.js”
>.
>
>The browser is correct, there are no files something__deps.js in the
>build.
>
>I have tried every combination with dot notation, /, \, with and without
>com.mySiteName in the path, but there is never any file in the build
>called
>something__deps.js and none of the modules themselves are built to JS
>either, although their mxml files are in the folder myProjectName in the
>build.
>
>What am I missing here?
>
>Doug
>
>Doug
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C437cf
>f0f34ff45c2eb8708d59916d924%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36583245833525579&sdata=63DTZGaJRlSV8jp%2BTrpQuOMbIInFavWZfTaoiP1C%2F7Q%3D
>&reserved=0

Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

doug777
Hi Alex,

Main.mxml contains initialView/View and a bunch of getters and setters.

Inside this View is a header group, a body group that contains the modules
and a footer group. Originally the modules were contained in a ViewStack,
but I've written something I hope will replace this, but I can't check it
until the modules can build.

The first module gets data from CF and then depending on the choices the
user makes, the second module gets appropriate data from CF and is displayed
in place of module 1 and so on depending on the choices made in each module.
The modules can appear in any order depending on user choice.

I'm not sure what that has to do with getting the modules in the build, but
basically that's how it works.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

Alex Harui-2
Hi Doug,

I was just trying to understand what the Flex code looked like to make
sure you were using the right Royale code.  IIRC, in Flex there was a
ModuleLoader that loaded a Module and created a single instance of its
main class, expecting it to be UI.  I didn't think you could pass
parameters to it when loading.  There was also a ModuleManager that loaded
modules that extended ModuleBase.  That one I think you could pass
parameters.  I don't think we've created a Royale equivalent for
ModuleManager/ModuleBase scenarios.

Note also that Royale modules do not unload at this time.  Probably for a
while.

Have you run the examples/royale/ModuleExample?  It sets up the
bin/js-debug output in a particular folder structure and I think a bit
differently for bin/js-release.  Maybe that example will contain the clue
you need.

HTH,
-Alex

On 4/2/18, 10:58 PM, "doug777" <[hidden email]> wrote:

>Hi Alex,
>
>Main.mxml contains initialView/View and a bunch of getters and setters.
>
>Inside this View is a header group, a body group that contains the modules
>and a footer group. Originally the modules were contained in a ViewStack,
>but I've written something I hope will replace this, but I can't check it
>until the modules can build.
>
>The first module gets data from CF and then depending on the choices the
>user makes, the second module gets appropriate data from CF and is
>displayed
>in place of module 1 and so on depending on the choices made in each
>module.
>The modules can appear in any order depending on user choice.
>
>I'm not sure what that has to do with getting the modules in the build,
>but
>basically that's how it works.
>
>Doug
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C3064f
>c565fc948905b5a08d59927fa2f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36583319358141648&sdata=OyQo%2BFRiiCRFkN3fHfGpqnhnO1C%2FjVEuu9%2FmOUiYMZs%
>3D&reserved=0

Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

doug777
Hi Alex,

I've built Module Example and run it and the result is exactly the same as
for my project.

There is no Module.js in the build and in the browser, Module Should Appear
Below appears at the top and nothing else.

The console shows -

Loading failed for the <script> with source
“file:///C:/My%20Documents/FlexJS%20Projects/Module%20Example/bin/js-debug/modules/Module__deps.js”.

There is no modules folder in the build.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

Alex Harui-2
OK, I will take a look later today.  Maybe something broke.

-Alex

On 4/3/18, 12:49 AM, "doug777" <[hidden email]> wrote:

>Hi Alex,
>
>I've built Module Example and run it and the result is exactly the same as
>for my project.
>
>There is no Module.js in the build and in the browser, Module Should
>Appear
>Below appears at the top and nothing else.
>
>The console shows -
>
>Loading failed for the <script> with source
>“file:///C:/My%20Documents/FlexJS%20Projects/Module%20Example/bin/js-debug
>/modules/Module__deps.js”.
>
>There is no modules folder in the build.
>
>Doug
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C4a453
>a2b8e1042b1ad0608d59937750f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36583385824576215&sdata=IdnGgx7y0yqhRJCxTRJrcX3%2FpaQMECS55AHhprPxR30%3D&r
>eserved=0

Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

doug777
Thanks very much, Alex.

No rush though - it's a long public holiday here through to the weekend.

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

Alex Harui-2
Hi Doug,

I build the Module Example using Ant on Mac and Win and it worked fine.
There are two sibling projects in ModuleExample.  The Ant script builds
the main app first then the module, adjusts the module files and copies
them to main app's bin/js-debug/modules and bin/js-release/modules folder.
 The Ant script won't put output in the ModuleExample folder.  It is in
ModuleExample/MainApp/bin

Did you build it with Ant?  If not, try that.  If you did, then maybe zip
up the output and put it in an GitHub issue.

HTH,
-Alex

On 4/3/18, 5:01 PM, "doug777" <[hidden email]> wrote:

>Thanks very much, Alex.
>
>No rush though - it's a long public holiday here through to the weekend.
>
>Doug
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Cb4097
>24315d24f26c7f008d599bf2c28%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36583968753896659&sdata=nHYssPq%2F57EUhvHX%2BDCTVX0JqZAZsbm0auZjIjeudq4%3D
>&reserved=0

Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

doug777
Hi Alex,

I built it with Moonshine. I don't doubt that it works with Ant, but I don't
want to have to build my whole project with Ant.

Shall I report the problem to the Moonshine guys or is it something outside
Moonshine's control?

Doug



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: How to Set Path in UIModuleLoader

Alex Harui-2
Hi Doug,

Right now there is some output manipulation going on in the js-debug build
because of the way Google Closure Library fixes up dependencies.  Maybe
the Royale compiler should somehow take care of that, but I'm not sure.
I'm also not sure Moonshine has gotten around to automating that file
manipulation for you, so, while you can compile each project with
Moonshine, to work with the debuggable output you will have to manipulate
the output in some way.  To run the production version, you should be able
to copy the .js file into the right place.

HTH,
-Alex

On 4/3/18, 9:28 PM, "doug777" <[hidden email]> wrote:

>Hi Alex,
>
>I built it with Moonshine. I don't doubt that it works with Ant, but I
>don't
>want to have to build my whole project with Ant.
>
>Shall I report the problem to the Moonshine guys or is it something
>outside
>Moonshine's control?
>
>Doug
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Ce603e
>1ca0b3e4a5485b208d599e4972f%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36584129457555936&sdata=Vi5iI%2FDp4WO8n7Tax4mQbjw0TpcAJbEVZYY9gnzbvzE%3D&r
>eserved=0