Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.96 KB

migrationguide.md

File metadata and controls

45 lines (29 loc) · 1.96 KB

Migration guide

Check out the command line reference for detailed usage information.

Problematic or failed replacements are reported in the log. Consider the following tips when migrating your codebase.

Manual inspection

Every change generated by ui5-migration should be inspected by a human, as there might be problems which can not be solved automatically:

Check for module parameter names like log0

The tool tries not to overwrite existing variable names. Therefore it adds a counter to the name in order to make it unique. Sometimes this is due to a shortcut in the old code e.g. var log = jQuery.sap.log which creates a conflict when introducing the argument log. Even though this shortcut isn't needed anymore, the tool does not remove the variable and thus a rather useless shortcut like var log = log0 remains.

Check the JSDoc comments

Sometimes there are @see or @link references to the old modules, for instance jquery.sap.log. These are not changed, as comments need to be adjusted manually.

Run eslint after migration

Even though the functionality shouldn't break after migration (at least with the replaceGlobals module), it is not guaranteed to generate eslint-compliant code. Especially more complex rules like nested ternary expressions or extra binds might be violated.

Remove commented import parameters

You might have some modules with comments in the sap.ui.define call, e.g.

], function(
    Device,
    Control,
    ShellLayoutRenderer
    /* , jQueryDom, jQueryScript */,
    containsOrEquals
) {

The corresponding dependencies might not exist, or are in different order, so you would have to modify these comments accordingly.

Check the coding style

ui5-migration tries to make the diff between the original source code and the modified one as small as possible while trying to stick to the original source code style. Sometime this fails and the modified code might need some reformatting.