glacasa / Mastonet

C# Library for Mastodon
MIT License
225 stars 36 forks source link

Add Json source generators and mark the library as trimmable #112

Closed eduardobragaxz closed 11 months ago

eduardobragaxz commented 1 year ago

Also add .NET 8 as framework target since stable release is next week. I'm not entirely sure how that works, or if it was necessary. I did have to update the nuget packages to .NET 8 RC2 for the source generators to work, though.

Of note, I still see a trimming warning in TryDeserialize since I couldn't specify a type for the Deserialize method. I don't know how to fix that. Having said that, I haven't hit any errors on my app for now.

Fixed the last trim warning recently. Will continue testing it.

This is the first pull request I make ever, so I'm not sure if I'm doing it right.

eduardobragaxz commented 11 months ago

I didn't realize subsequent commits would make part of this pull request 🥲

glacasa commented 11 months ago

I didn't have time to watch the PR at first, and then I saw you were working on it, so I thought I'd let you finish 🤣

My work will finally let me some time to watch it (this week or next maybe), how do you feel about this PR ? Should I look at all the commits or just the initial one ?

eduardobragaxz commented 11 months ago

Somehow only three changes are unrelated, so I think it'd be better if you took a look at all of them. I'll stop making new commits 😄

eduardobragaxz commented 11 months ago

All of the properties in the History class are int, even though they come as string. I wrote a json converter to parse it to int, but I'm wondering if it would be better to just make them strings instead. It would technically be a breaking change.