SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.95k stars 1.23k forks source link

A few instances where modules are referenced globally even though they were loaded locally #2585

Closed jbragiel closed 5 years ago

jbragiel commented 5 years ago

This is different than https://github.com/SAP/openui5/issues/2584 because, in this case, the dependencies are being properly required/imported, but then the module/object is referenced from the global namespace instead of the AMD-style function parameter result.

OpenUI5 version: 1.60 (but checked that issue is still present in master branch)

Browser/version (+device/version): N/A

Any other tested browsers/devices(OK/FAIL): N/A

URL (minimal example if possible): N/A

User/password (if required and possible - do not post any confidential information here): N/A

Steps to reproduce the problem:

  1. Open one of the referenced files. The file is the line with the complete path and js extension in the list below.
  2. Search for one of the modules under the file name in the list below.
  3. See that the API dependency IS being required/imported properly with the AMD-style sap.ui.define, but then the module is referenced in the global namespace (eg. sap.ui.Device.browser.msie) as opposed to the local reference from the sap.ui.define function (eg. Device.browser.msie).

What is the expected result? Use of the global namespace is kept to a minimum.

What happens instead? There are some instances where the global namespace is used, even though the same object is available from the sap.ui.define API.

Any other information? (attach screenshot if possible)

src/sap.m/src/sap/m/MultiComboBox.js sap.m.Tokenizer.TokenChangeType

src/sap.m/src/sap/m/PDFViewer.js jquery.sap.global (It provides jQuery.sap.log.warning)

src/sap.m/src/sap/m/PlanningCalendar.js sap.m.Sticky

src/sap.m/src/sap/m/StepInput.js sap.m.StepInputValidationMode

src/sap.m/src/sap/m/Table.js sap.m.ListBaseRenderer

src/sap.ui.core/src/sap/ui/core/routing/async/Target.js sap.ui.core.ComponentLifecycle

src/sap.ui.core/src/sap/ui/model/FilterProcessor.js sap.ui.Device

src/sap.ui.unified/src/sap/ui/unified/calendar/Month.js sap.ui.unified.DateRange

src/sap.ui.ux3/src/sap/ui/ux3/DataSet.js sap.ui.model.SelectionModel

codeworrior commented 5 years ago

These should all be fixed with the cleanup mentioned in https://github.com/SAP/openui5/issues/2584#issuecomment-511097339 . I'll update this ticket once the cleanup has been submitted.

codeworrior commented 5 years ago

Yep, all fixed by a run of the ui5-migraton tooling.