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

Accept field(ty = "...") to ease migration to syn 2.0 #306

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

TedDriggs
Copy link
Collaborator

@TedDriggs TedDriggs commented Feb 1, 2024

On syn 2.0, field(type = "...") will break with a not-very-informative error message.

While we can't prevent that, we can make it possible for people to switch to the new property name without needing to change anything else, so that the eventual dependency version bump is fully source-compatible.

Alternatives Considered

I debated using DeprecationNotes to put a warning on all uses of type, but decided it wasn't worth the code churn necessary to plumb that through from the options area all the way to code generation. This is already a highly specialized feature, and the fix is pretty easy once you read the release notes.

On syn 2.0, field(type = "...") will break with a not-very-informative error message.

While we can't prevent that, we can make it possible for people to switch to the new property name without needing to change anything else, so that the eventual dependency version bump is fully source-compatible.
@TedDriggs TedDriggs mentioned this pull request Feb 1, 2024
Copy link

@jtran jtran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much experience using darling. But I read the code and tried it on my codebase, and it looks good to me.

@TedDriggs TedDriggs merged commit 977d023 into master Feb 2, 2024
30 checks passed
@TedDriggs TedDriggs deleted the accept-field-ty branch February 2, 2024 21:13
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.

None yet

2 participants