Skip to content

Use auto properties and misc code cleanup - #398

Merged
Shane32 merged 11 commits into
graphql-dotnet:masterfrom
alexander-jesner-AP:net8
Oct 20, 2024
Merged

Shane32 merged 11 commits into
graphql-dotnet:masterfrom
alexander-jesner-AP:net8

Conversation

@alexander-jesner-AP

Copy link
Copy Markdown
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 .

@Shane32 Shane32 left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated
Comment thread src/GraphQLParser/GraphQLParser.csproj Outdated
Comment thread src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated
@Shane32

Shane32 commented Oct 19, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Shane32 commented Oct 19, 2024

Copy link
Copy Markdown
Member

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.

Comment thread src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated
Comment thread src/GraphQLParser/Exceptions/GraphQLParserException.cs Outdated
@Shane32 Shane32 changed the title Add .NET8 compilation target Use auto properties and misc code cleanup Oct 20, 2024
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