Closed Supereg closed 1 year ago
Ping @PSchmiedmayer CI help 🙈
I'm at a point where I think I have fixed some issue with a timeout on the HTTP view tests, but am now at a point where the CI is completely broken. Can't event view the TestApp.xresult
anymore because it seems to be incomplete 🙃
@Supereg Yes, seems like the simulator is not starting which is strange. I will take a look at that ...
@Supereg restated the build agents and restarted everything. Seems to pass now 👍
Merging #7 (c1d6af5) into main (c6975e8) will increase coverage by
0.71%
. The diff coverage is94.00%
.
Add
DefaultErrorDescription
environment key; Localization features; restructure project; fix spelling:recycle: Current situation & Problem
The current situation is as follows:
Further, the current API design imposes some inconveniences or could be improved in regard to usability and flexibility.
AnyLocalizedError
always requires the view using it to request a default error description. This is tedious e.g., when creating smaller, reusable view components as it clutters the initializer with configuration values. Also a view that reuses several components that rely on the same default error description has the overhead of passing the value to every single subview.FieldLocalization
localizes its content instantly.:bulb: Proposed solution
This PR addresses the above-introduced situation as follows:
Views
,ViewModifier
,Environment
(e.g., EnvironmentKeys) and more openly defined categoriesModel
(any Models or ViewModel related types) orUtilities
(extensions or otherwise helpful types).DefaultErrorDescription
EnvironmentKey to resolve the above introduced shortcomings. Additionally, we introduce a global default error description.FieldLocalizationResource
that is based onLocalizationStringResource
instead of localized strings for greater flexibility.:gear: Release Notes
.defaultErrorDescription
EnvironmentKey
that can be used for view components creatingAnyLocalizedError
to source thedefaultErrorDescription
from the environment. Equally, views can set the.defaultErrorDescription
EnvironmentKey
to pass down customized configuration options.FieldLocalizationResource
StringProtocol.localized
was deprecated and replaced withStringProtocol.localized()
to better communicate its effectsThe PR introduces the following breaking changes:
Label
initializer exposed a spelling mistake in itstextAlignment
(previouslytextAllignment
) external property name. Update your code to the corrected name.FieldLocalization
was replaced byFieldLocalizationResource
. Typical SwiftUI initializers should be able to handle the update types (e.g. replacing String with LocalizationStringResource), otherwise we ship a conveniencelocalizedString()
extension forLocalizationStringResource
to easily convert to a String.:heavy_plus_sign: Additional Information
Related PRs
--
Testing
New UI tests were added. The TestApp was updated to adapt to the breaking changes.
Reviewer Nudging
Look altho e
DefaultErrorDescription
type and atAnyLocalizedError
. Refer to theDefaultErrorDescriptiontestView
to see how it is used.Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: