Improve type generation of the i18n plugin #16139
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.
Summary
This updates the Rancher Shell type generation to include the i18n plugin.
Occurred changes and/or fixed issues
stringFor()with a dostring to include typest()function ofuseI18nTechnical notes summary
Kubewarden UI will fail with the following error when updating to the latest versions of
@rancher/shell:This issue appears to be isolated to Kubewarden, but the root cause can be linked to kubewarden depending on later versions of typescript than shell and other extensions, so this failure could be linked to better type checking overall.
There's also a risk that we will encounter these issues for other extensions in the future as we update dependencies in shell.
After updating the types for the i18n plugin, we received a new typescript warning:
I added some guards to ensure that the store is available before invoking
stringFor().Areas or cases that should be tested
Publish an updated versions of shell to a local registry or link the package. Kubewarden should no longer show type errors.
We will want to test with a few other extensions, but that should be covered by CI.
Areas which could experience regressions
This adds better type support for the i18n plugin. Other extensions might rely on ill defined types and will need to updated accordingly to support the change.
Screenshot/Video
NA
Checklist
Admin,Standard UserandUser Base