SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
426 stars 94 forks source link

[SF]: i18nBundle Bug (TS) #4845

Closed 2028942481 closed 1 year ago

2028942481 commented 1 year ago

Describe the bug

Hello, we are using ui5 for front-end development. The previous version we used was:

"@ui5/webcomponents": "^1.7.1",

"@ui5/webcomponents-react": "^0.28.0"

Now you want to upgrade to:

"@ui5/webcomponents": "^1.15.0",

"@ui5/webcomponents-react": "^1.17.0".

However, when we upgraded the version to the target version, the following issue occurred.

Since we're using the TS language, it has strong type checking, but the interface to i18nBundle has changed in the updated version. Here is some of the code:

const i18nBundle = useI18nBundle('test');

message = i18nBundle.getText("TEST");

When TS compiles we get the following error:

“Argument of type 'string' is not assignable to parameter of type 'I18nText'.”

After checking the code, we find that in the file i18nBundle.d.ts, the getText method first receives arguments of type I18nText, which should also accept arguments of type string, otherwise the previous TS code will not work after updating the UI5 version.

Please help us solve it, thank you.

Isolated Example

No response

Reproduction steps

1. 2. 3. ...

Expected Behaviour

No response

Screenshots or Videos

Screenshot 2023-07-06 135719

UI5 Web Components for React Version

1.17.0

UI5 Web Components Version

1.15.0

Browser

Chrome, Edge, Firefox, Safari

Operating System

No response

Additional Context

No response

Relevant log output

No response

Declaration

MarcusNotheis commented 1 year ago

Hi @2028942481,

I moved the exact same issue to the UI5 Web Components repository an hour ago. Please follow SAP/ui5-webcomponents#7300 for updates.

Closing this issue as duplicate.