Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

'migrate' tends to add a dependency to the module itself #33

@codeworrior

Description

@codeworrior

While working on UI5/openui5@c782ce9 , I encountered the following issue with the ui5-migration tooling:

When the source of a module contains a global reference to the export of the same module, then the 'migrate' command adds a dependency to self and tries to use the resulting import whenever the export value is references. This happens in nearly each library.js module, but also in a few others.

Before

sap.ui.define([
	'sap/ui/core/library', // library dependency
	'sap/ui/commons/library'], // library dependency
	function() {
	...
	return sap.ui.ux3;

After (please also note that the 'library dependency' comments are also misplaced)

sap.ui.define([
	"sap/ui/ux3/library", // library dependency
	'sap/ui/core/library',
	'sap/ui/commons/library'], // library dependency
	function(ux3Library) {
	...
	return ux3Library;
});

To reproduce, you can execute the following commands

cd openui5
git checkout 6555a38
ui5-migration migrate src/sap.ui.ux3/src/sap/ui/ux3/library.js
ui5-migration migrate src/sap.ui.core/src/sap/ui/core/support/Support.js

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions