fix(ui5-icon): ui5-icon i18n works for all packages #2816
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change removes the dependency of
ui5-icon
to the@ui5/webcomponents-icons
package.Changes:
packageName
property in icon data)Icon.js
no longer fetches automatically thei18n
assets for@ui5/webcomponents-icons
, but rather fetches the ones for the currently loaded icon's package. This would make it possible to have other icon packages withi18n
data rather than the first icons package only.Icon.js
theaccessibleNameText
is no longer a getter, but rather a metadata entity. This allows the Icon to be automatically invalidated once thei18n
assets have been fetched and the acc text calculated.Additional information: The first icon on the page may be invalidated up to 2 times. Firstly, if there is no data for the icon (the app did not load the icon individually), there will be a fetch for the icons bundle, and then the icon will be invalidated and actually painted with the SVG. Secondly, now that we have the icon's data, if the icon has an ACC text, and the app did not explicitly fetch the i18n bundle for the icon's package (which will almost always be the case), there will be a second fetch. After that - no requests will be done and all subsequent icons will be loaded normally.
closes: #2739