Guide transition to TS/Dojo-2


Hi there,

I wanted to give some hints how to migrate larger codebases to TS:

  1. Since the new dojo build chain, or more precise the google closure compiler supports the ES6, you can use a tool called ‘lebab’. It converts old code to new code,ie: :
    npm install -g jscodeshift

lebab --replace ./Context_UI.js --transform arrow // notice that the ‘arrow’ transform breaks the dojo build since it doesn’t support the arrow on 'define’
See mee transform options here :

  1. there is another tool which converts AMD to CJS modules:
    npm install jscodeshift
    jscodeshift -t node_modules/5to6-codemod/transforms/amd.js mymodule

In both cases you still need to make some fine tuning

  1. Never got this working properly but you can instruct the TS compiler to load AMD modules, as outlined here : ht:// or here ht://

That’s it for the start,
regards, Guenter