SAP / ui5-migration

ARCHIVED - A tool to support the migration of UI5 projects by adapting code for new UI5 framework versions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'migrate', tool uses an incorrect replacement for the UriParameter

StSche opened this issue · comments

The following replacement is done by the migration tool:
„jQuery.sap.getUriParameters().get("$direct")“ by “new UriParameters(window.location.href).get("$direct")”
But in the JSDoc of the UriParameter is described under "Future Migration", one should not use the constructor

Future Migration

* * Note: To simplify a future migration from this class to the standard URLSearchParams * API, consuming code should follow some recommendations: *
    *
  • **do not use the constructor,** either use {@link #.fromURL UriParameters.fromURL} when the input is a full URL, * or use {@link #.fromQuery UriParameters.fromQuery} when the input only contains the query part of an URL * (e.g. location.search).
  • *
  • do not use the get method with the second parameter bAll; use the getAll * method instead
  • *
  • do not access the internal property mParams (you never should access internal properties of * UI5 classes or objects). With the predecessor of this API, access to mParams was often used * to check whether a parameter is defined at all. Using the new has method or checking the * result of get against null serves the same purpose.
  • *

Thanks for this feedback.

This is definitely something which needs to be adjusted.

#fromURL was introduced with 1.68.0 and should be used