ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

Improve JSModuleAnalyzer to support local names for dependency detection

Open matz3 opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently, the UI5 Tooling is not able to detect all dependencies of a JavaScript module when it analyzes the code. When using local names for certain APIs, such as jQuery.sap.require or sap.ui.require, the calls are not recognized and the dependencies are not detected.

Describe the solution you'd like

The underlaying JSModuleAnalyzer (part of ui5-builder) should be improved in a way that allows recognition of the known APIs in case they are using a local variable name.

Describe alternatives you've considered

Additional context

One example (there are many more use cases)

Dependency to my/module.js is detected

sap.ui.define(["jquery.sap.global"], function() {
  jQuery.sap.require("my.module");
});

Dependency to my/module.js is NOT detected

sap.ui.define(["jquery.sap.global"], function(jq) {
  jq.sap.require("my.module");
});

matz3 avatar Mar 30 '21 10:03 matz3