It's all about the answers!

Ask a question

Replacement for dojo jazz.core.loader ?


Daniel Reguero (114) | asked Feb 09 '17, 4:21 p.m.

 I have a custom Rational Team Concert extension that requires in other custom dojo (javascript) files (in the same directory). All of These files are using the modern AMD syntax. I am using Rational Team Concert 6.0.1

Reading the documentation has lead me to a jazz file that I can import in. 

dojo.require("jazz.core.loader"); 

https://jazz.net/wiki/bin/view/WebUIBook/DynamicCodeLoading

This is working as expected, however, when I run Rational Team Concert in debug mode, I get an JS alert message stating that this module is deprecated and will soon be removed. If that is the case, then what is the replacement for this ? If I require in my custom dojo js files like a normal dojo widget file, I get a console error saying "Unresolved module with id: id.of.my.custom.dojo.js.file". However my custom files get loaded anyways. 

I found some similar problems with custom dojo files that are in AMD, see this thread. https://jazz.net/forum/questions/171336/modern-dojoamd-notation-causing-troubles-widget-creation-with-ibm-modules


Comments
Jonas Studer commented Feb 20 '17, 2:33 a.m.

Hello Daniel,

I also (still) get this message.
Nevermind about this! It's just the way dojo handles this.

!Dont forget! If you want to use it this way, you have to access it through "dojo.global" after the require statement.
E.g. my.old.module --> dojo.global.my.old.module

Just keep in mind that the installed dojo Version is 1.8.4
At least in RTC 6.0.1

Since almost all of the IBM Code is written with the old Dojo, they just CANT make a major change in the dojo version.
Otherwise most of their code would become unusable!

Since the Dojo Team stated, that in the first few Versions of Dojo 2.0 AMD surely is usable dont worry too much.
If you use AMD Code. You're already ahead of IBM.

Greetings

Jonas Studer


Jonas Studer commented Feb 20 '17, 2:45 a.m.

Also Daniel,

You really shouldn't fear the deprecation.
We're creating big Widgets and still trying to handle it proper.

My tipp towards you:
Modularize you code as much as possible.

Since you can load your code relative in the AMD structure you just need one File in the old Syntax. All the other Code you just load relative.
The Error Messages will show you where the problem is.

Since you need to "require" all external Modules you'll be able to detect the problem relatively fast.
Also I'd suggest you to ALWAYS develop on the newest Versions of RTC.
So you'll be able to detect such as these things/changes before your Server Administrator wants to upgrade your system.

This is the Tool we're working on.
Timebox Planning Tool

One answer



permanent link
Donald Nong (14.4k313) | answered Feb 14 '17, 11:54 p.m.

If you are worried that your code may not work in the future when the Dojo framework is upgraded within CLM, you probably don't need to. From what I can gather, the Dojo framework within CLM is not going to change any time soon - the last major upgrade request that I can find is back in 2014.

In fact, there was a request to add AMD support but it was rejected.
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/335394

Your answer


Register or to post your answer.