Skip to content

Missing autofix for methods related to deprecated Core APIs #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
flovogt opened this issue Apr 3, 2025 · 2 comments · May be fixed by #639
Open

Missing autofix for methods related to deprecated Core APIs #619

flovogt opened this issue Apr 3, 2025 · 2 comments · May be fixed by #639
Labels
autofix An issue related to the autofix capabilities

Comments

@flovogt
Copy link
Member

flovogt commented Apr 3, 2025

Missing autofix for methods related to deprecated Core APIs

Methods available on sap.ui.getCore().* are deprecated. Therefore an autofix should be offered by UI5 linter.

For a detailed overview about deprecated APIs, see Deprecated Core API

@flovogt flovogt added the autofix An issue related to the autofix capabilities label Apr 3, 2025
@flovogt
Copy link
Member Author

flovogt commented Apr 3, 2025

Will be implemented in CPOUI5FOUNDATION-991.

@RandomByte
Copy link
Member

RandomByte commented Apr 22, 2025

Legacy API and Migration Plan Notes
applyTheme(sThemeName, sThemeBaseUrl?)
Migrate to sap/ui/core/Theming.setTheme(sTheme)
Migrate only if second argument is omitted or undefined
attachInit(fnFunction)
Migrate to Core#ready(fnReady?)
attachInitEvent(fnFunction)
Migrate to Core#ready(fnReady?)
attachIntervalTimer(fnFunction, oListener?)
Migrate to sap/ui/core/IntervalTrigger.addListener(fnFunction, oListener?)
Do not migrate if second argument is provided. We can't generate a ".bind" call since detaching wouldn't be possible anymore
attachLocalizationChanged(fnFunction, oListener?)
Migrate to sap/base/i18n/Localization.attachChange(fnFunction)
Do not migrate if second argument is provided. We can't generate a ".bind" call since detaching wouldn't be possible anymore. Also note from the docs: "The Event object has a different API than on the Core facade. There is no more getParameters()"
attachThemeChanged(fnFunction, oListener?)
Migrate to sap/ui/core/Theming.attachApplied(fnFunction)
Do not migrate if second argument is provided. We can't generate a ".bind" call since detaching wouldn't be possible anymore. Also note from the docs: "The Event object has a different API than on the Core facade. There is no more getParameters()"
byFieldGroupId(vFieldGroupIds?)
Migrate to sap.ui.core.Control.getControlsByFieldGroupId(vFieldGroupIds?)
byId(sId )
Migrate to sap/ui/core/Element.getElementById(sId)
createComponent(vComponent, sUrl?, sId?, mSettings?)
Migrate to sap.ui.core.Component.create(mOptions)
Individual arguments must be mapped to "options" object
detachIntervalTimer(fnFunction, oListener?)
Migrate to sap/ui/core/IntervalTrigger.removeListener(fnFunction, oListener?)
Do not migrate if second argument is provided
detachLocalizationChanged(fnFunction, oListener?)
Migrate to sap/base/i18n/Localization.detachChange(fnFunction)
Do not migrate if second argument is provided
detachThemeChanged(fnFunction, oListener?)
Migrate to sap/ui/core/Theming.detachApplied(fnFunction)
Do not migrate if second argument is provided
getComponent(sId)
Migrate to sap/ui/core/Component.get(sId)
getControl(sId)
Migrate to sap/ui/core/Element.getElementById(sId)
Same as byId(sId)
getCurrentFocusedControlId(sId)
Migrate to Element.getActiveElement() && sap/ui/core/Element.getElementById(Element.getActiveElement())
Be aware, Element.getActiveElement() can return undefined
getElementById(sId)
Migrate to sap/ui/core/Element.getElementById(sId)
Same as byId(sId)
getEventBus()
Migrate to sap/ui/core/EventBus.getInstance()
getLibraryResourceBundle(sLibraryName?, sLocale?, bAsync?)
Migrate to sap/ui/core/Lib.getResourceBundleFor(sLibrary, sLocale?)
The bAsync argument can be ignored, the new API still returns the resource bundle synchronously
getMessageManager()
Migrate to Replace with sap/ui/core/Messaging module
getStaticAreaRef()
Migrate to sap/ui/core/StaticArea.getDomRef
getTemplate(sId)
Migrate to sap/ui/core/tmpl/Template.byId(sId)
initLibrary(oLibInfo)
Migrate to sap/ui/core/Lib.init(mSettings)
isMobile()
Migrate to sap.ui.Device.browser.mobile
isStaticAreaRef(oDomRef)
Migrate to sap/ui/core/StaticArea.contains(oDomRef)
loadLibrary(sLibrary, vUrl?)
Migrate to sap.ui.core.Lib.load(mOptions)
Individual arguments must be mapped to "options" object
notifyContentDensityChanged()
Migrate to sap/ui/core/Theming.notifyContentDensityChanged()
applyChanges()
⚡️ Migration not possible
attachControlEvent(fnFunction, oListener?)
⚡️ Migration not possible
attachFormatError(oData?, fnFunction, oListener?)
⚡️ Migration not possible
attachParseError(oData?, fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
attachValidationError(oData?, fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
attachValidationSuccess(oData?, fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
createRenderManager()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
createUIArea(oDomRef)
⚡️ Migration not possible
Unclear which control to use
detachControlEvent(fnFunction, oListener?)
⚡️ Migration not possible
detachFormatError(fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
detachParseError(fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
detachValidationError(fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
detachValidationSuccess(fnFunction, oListener?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
fireFormatError(oParameters?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
fireParseError(oParameters?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
fireValidationError(oParameters?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
fireValidationSuccess(oParameters?)
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
getApplication()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
getConfiguration() No direct replacement available
getLoadedLibraries()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
getModel()
⚡️ Migration not possible
getRenderManager()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
getRootComponent()
⚡️ Migration not possible
getUIArea(o)
⚡️ Migration not possible
We can't determine whether the static UIArea is requested
getUIDirty()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
hasModel()
⚡️ Migration not possible
Recommended replacement only available on ManagedObject
includeLibraryTheme()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
isInitialized()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
isLocked()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
isThemeApplied()
⚡️ Migration not possible
Developers should migrate to the theme-applied event
lock()
⚡️ Migration not possible
API has been removed, migration likely involves more than removing the usage
registerPlugin()
⚡️ Migration not possible
sap.ui.core.Core.extend()
⚡️ Migration not possible
sap.ui.core.Core.getMetadata()
⚡️ Migration not possible
setModel()
⚡️ Migration not possible
setRoot()
⚡️ Migration not possible
setThemeRoot()
⚡️ Migration not possible
unlock()
⚡️ Migration not possible
unregisterPlugin()
⚡️ Migration not possible

@maxreichmann maxreichmann linked a pull request Apr 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix An issue related to the autofix capabilities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants