Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soft-deprecate old generated LocalizedStringResource extensions #87

Merged
merged 1 commit into from
May 28, 2024

Conversation

liamnichols
Copy link
Owner

@liamnichols liamnichols commented May 28, 2024

Closes #81

In #82, we've introduced the static LocalizedStringResource.localizable(_:) method which allows you to use String.Localizable in order to create a LocalizedStringResource instance with the similar sugar that LocalizedStringResource.String... and LocalizedStringResource.localizable provided:

- Text(.localizable.foo)
+ Text(.localizable(.foo))

It's not so obvious what the difference is with type inference, so to explain some more:

- Text(LocalizedStringResource.localizable.foo)
+ Text(LocalizedStringResource.localizable(String.Localizable.foo))

This means that it's no longer worth the effort to generate LocalizedStringResource.String and as a result, we're going to remove it.

Before doing that though, I am going to mark it as soft-deprecated. This means to add the deprecation annotation but without triggering a warning (by setting the version number to 100000).

This will go live with 0.4.0. Then, in 0.5.0, I'll make the deprecation produce a warning and in 1.0.0, i'll remove the legacy generated code entirely.

@liamnichols liamnichols self-assigned this May 28, 2024
@liamnichols liamnichols marked this pull request as ready for review May 28, 2024 18:06
@liamnichols liamnichols merged commit f30f6d3 into main May 28, 2024
4 checks passed
@liamnichols liamnichols deleted the ln/soft-deprecate-old-code branch May 28, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate accessors generated in extensions on both String and LocalizedStringResource
1 participant