loio |
---|
c1025c2e30a748ae82e929cb7f6d2f9a |
view on: demo kit nightly build | demo kit latest release
When upgrading to the current OpenUI5 version from a version below 1.38 (released in June 2016), check whether the changes listed below influence your apps.
With this OpenUI5 version, jQuery has been upgraded to version 2.2.3.
This upgrade may impact your OpenUI5 apps. The following sections give an overview of our findings and how to deal with them.
If you use additional open-source libraries that depend on jQuery, check whether they need to be upgraded as well.
jQuery removed some robustness checks in its event handling code. Without these checks, the jQuery.trigger
function must only be called with events that either have no originalEvent
property or where the originalEvent
has all methods that window.Event implements
(especially preventDefault
, stopPropagation
and stopImmediatePropagation
).
When a jQuery.Event
is constructed with an object literal (properties
) or when originalEvent
is set to some object after construction, this constraint is not fulfilled. Unfortunately, many OpenUI5 unit tests used this approach to simulate mouse or key events.
For each code that creates events, you have to apply the following fix:
The module QUnitUtils
now rewrites the jQuery.Event
constructor so that any given object literal is enriched with the missing methods. Most OpenUI5 unit tests include the QUnitUtils
module early, which then fixes the issue.
Application code that needs to simulate an event, either should omit the originalEvent
or use Event.create
to create a native event and only then create a jQuery.Event
.
jQuery.fn.position
now takes the scroll positions of the parent element into account. This change was recoginzed as incompatible by the jQuery team and reverted with version 2.2.1.
Nothing, this is automatically fixed.
jQuery.now
is now set to Date.now
for all browsers. But as the jQuery property represents a separate reference to that function, it is not touched by code that modifies Date.now
, especially not by Sinon fake timers. Therefore Sinon fake timers don't work with jQuery 2.2 if Sinon is started after jQuery
.
As a workaround, QUnitUtils
redefines jQuery.now
so that it delegates to the current Date.now
. This will then use any installed fake timer.
Somewhere between jQuery 1.11.1 and 2.2.0, the behavior of the :visible
selector has changed. For empty inline elements (for example, a span
with no text), the selector now reports :visible = true
whereas jQuery 1.1.1 reported it as hidden
. There was only one functionality in the sap.ui.dt
library where this change in behavior caused problems.
Instead of using :visible
, that functionality now uses its own implementation similar to jQuery 1.11.1.
jQuery 2.2.0 simplified the implementation of jQuery.isPlainObject
. As a side-effect, objects with a constructor
property with a non-function value (like a string
value) caused a runtime error when jQuery.isPlainObject
was applied.
This issue is fixed with jQuery 2.2.2.
If you want to add new attributes of a descriptor version higher than V2 (SAPUI5 1.30) to your existing manifest.json
file, see Migration Information for Upgrading the Manifest File.