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

2024 Source Generator Rewrite #140

Merged
merged 152 commits into from
Dec 16, 2023
Merged

2024 Source Generator Rewrite #140

merged 152 commits into from
Dec 16, 2023

Conversation

aspriddell
Copy link
Member

This update essentially rewrites most of the library to be more consise and easier to use.

Major Changes

Moving to semantic versioning

From now on, the project will use semantic versioning due to source generators being liable to breaking mixed libraries (as some may now have source-generated request building methods)

This will be release v4.0.0:

  • v1 was the integrated Dragon6 edition
  • v2 was the separately packaged one
  • v3 was the one being replaced

(Breaking) Older NuGet packages will be delisted to maintain correct versioning in IDEs

Serializer class name changes

  • ApiSystemJsonSerializer is now ApiJsonSerializer (and is supplied within the main data project)
  • ApiHtmlSerializer is now HtmlSerializer
  • ApiJsonSerializer is now NewtonsoftJsonSerializer

ApiRequest changes

  • ApiRequests must be partial to use source generation (if the source generator is excluded, this can be ignored)
  • internal and private members will be ignored
  • Most properties have been removed for decorators/other applications
    • This will be documented in a migration guide
  • Path has changed to RequestPath
  • Method has been renamed to RequestMethod and now supplies HttpMethod (class) instead of Method (enum)
  • [QueryParameter]/[FormParameter] has been removed and replaced with [RequestParameter(ParameterType.Query, "name"]/[RequestParameter(ParameterType.Form, "name"]
  • Multipart form support has been added via class decorator
  • ApiDownloadRequest class has been removed and replaced in favour of using ApiRequest and ApiClient.PerformDownload(request, destinationStream)`.

ApiClient changes

  • HttpClient is now a singleton and is created once
  • Default handler is now platform-specific with all enabling automatic decompression of responses and no cookies
  • Clients will now default to HTTP/1.1 and try to upgrade to the newest version supported by the server and client (upto HTTP/3)
  • Added new PerformDownload method for downloading files to a predefined stream
  • Headers now returns a HttpRequestHeaders, the old header container has been removed

Migration Guide and Docs need to be written before a v4.0.0 release ()

@aspriddell aspriddell merged commit d583601 into master Dec 16, 2023
2 checks passed
@aspriddell aspriddell deleted the 2024-sourcegen-rewrite branch December 16, 2023 18:42
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.

1 participant