Search code examples
javascriptdojojs-amd

Dojo transition from non-AMD project to AMD


What is the best way to transition non-AMD Dojo 1.7 project to AMD structure?

Is there any converter? Or the only solution is start using new structure for all new classes and refactor old classes one by one?


Solution

  • The team I work with is in the process of a 1.6 to 1.7 migration.

    I am not aware of any way of automating the upgrade.

    Work can be done incrementally from a development point of view when mixing AMD and 1.6 declarations, but we struggled creating a release build that mixed the two declaration methods. Expect async mode to expose bugs in your app too - particularly where you're getting lucky with missing dependencies and load order. A significant amount of the work is in replacing deprecated API calls.

    My 2¢:

    • Test your build system against 1.7 before you start (1.7 build system)
    • Read the release notes carefully
    • At time of writing, the livedocs are the most useful reference for APIs aside from the sources themselves
    • Have good DOH unit test coverage before you start