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

Use auto properties and misc code cleanup #398

Merged
merged 11 commits into from
Oct 20, 2024

Conversation

alexander-jesner-AP
Copy link
Contributor

This PR adds a .NET8 compilation target to the main library and addresses performance related warnings that came up with the new build target.
Furthermore, this PR contains a few low hanging code cleanups .

Copy link
Member

@Shane32 Shane32 left a comment

Choose a reason for hiding this comment

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

Thanks for the code cleanup! We won’t be adding a .NET 8 target unless there is some benefit. As it is now, the compiled code would be identical for .NET 6 or .NET 8. So adding a target would simply increase the size of the nuget download.

src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated Show resolved Hide resolved
src/GraphQLParser/GraphQLParser.csproj Outdated Show resolved Hide resolved
src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated Show resolved Hide resolved
@Shane32
Copy link
Member

Shane32 commented Oct 19, 2024

We could change the .net analyzers to use the .net 8 analyzers so these issues are displayed even when not targeting .net 8

@alexander-jesner-AP
Copy link
Contributor Author

I was under the impression, .NET8 generates slightly better MSIL. But I diffed the IL and you are right, a few attributes are no longer compiled in, but the rest is the same.

@Shane32
Copy link
Member

Shane32 commented Oct 19, 2024

I was under the impression, .NET8 generates slightly better MSIL. But I diffed the IL and you are right, a few attributes are no longer compiled in, but the rest is the same.

Likely enough the .NET 8 SDK does compile better than its predecessors, for any target. I’m not sure. I believe we are using the .NET 8 SDK for compilation.

@Shane32 Shane32 changed the title Add .NET8 compilation target Use auto properties and misc code cleanup Oct 20, 2024
@Shane32 Shane32 merged commit 3150fe6 into graphql-dotnet:master Oct 20, 2024
7 checks passed
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.

2 participants