Skip to content

16.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Sep 01:00
1459f55

Summary

Refit 16.0.0 is a major version because the .NET 11 assemblies are built without runtime-async. The public API does not change.

Why runtime-async is off

  • In .NET 10 and older, the C# compiler adds a state machine to each async method. The state machine stores the local variables and tracks where to resume after each await.
  • .NET 11 adds a feature called runtime-async. The runtime does this work instead, so async code can run faster.
  • Refit 12.0.0 to 15.2.0 built the .NET 11 assemblies with runtime-async on. We did not use it with older .NET 8-10 nor .NET framework assemblies.
  • The feature needs a runtime that supports it. CoreCLR does, and Mono does not.
  • Blazor WebAssembly runs on Mono unless you opt into CoreCLR. WASI, Android API levels 21 to 23, and apps that set UseMonoRuntime=true also run on Mono.
  • Refit built with runtime-async can fail in every app that runs on Mono.
  • Microsoft builds its framework assemblies twice, once for each runtime. ASP.NET Core turns the feature on only for libraries inside the shared framework, and leaves it off for libraries that also ship on NuGet.
  • A NuGet package ships one build for every runtime, so Refit leaves the feature off. The feature is opt-in, so doing nothing is the correct setting.
  • Apps that target .NET 10 or older are not affected, because only the .NET 11 assemblies used the feature. Apps on .NET 11 that run on CoreCLR do not get the speed gain inside Refit's own async code.
  • You can turn on runtime-async in your own app if it runs only on CoreCLR.

Other changes

  • Refit has a documentation website at https://reactiveui.net/documentation/refit/. It has guides for requests, results, clients, serialization and testing, and one page that lists the full API.
  • The README is a short overview of the packages, the build requirements and the links to the website.
  • src/examples/Documentation has a project for every website page, plus larger samples for topics such as multipart uploads, serializers and compression. Each project builds with Refit.slnx and checks its results against local replies, so none needs a live service.
  • On older target frameworks, Refit checks the cancellation token before it buffers or reads HTTP content. A token that is already cancelled stops the operation before it starts.
  • Doc comments were corrected to match how Refit works. They state that [Options] sends OPTIONS, that [Url] accepts an empty path or /, and that [PathPrefix] does not add a leading slash. The Refit.Testing docs state that VerifyAllCalled ignores reusable and fallback routes.
  • The Blazor WebAssembly sample builds for .NET 10 and .NET 11. It uses a generated client and JSON source generation, and builds without trimmer warnings.
  • Refit depends on ReactiveUI.Primitives 8.0.0. On .NET 11, Refit.HttpClientFactory depends on Microsoft.Extensions.Http 11.0.0-rc.1, and other targets depend on 10.0.12.
  • SECURITY.md lists the supported versions and explains how to report a vulnerability through GitHub private reporting.
  • CI workflows drop code scanning of fork pull requests and pass sourceRef to the shared release workflow. Renovate handles package updates per target framework, and the generator snapshot tests use a small in-repo helper instead of the Verify packages.

🗞️ What's Changed

✨ Features

🧹 General Changes

📝 Documentation

📦 Dependencies

  • 45fcc59 chore(deps): pin mcr.microsoft.com/dotnet/sdk docker tag to e622deb (#2324) renovate[bot]
  • 8b71ed0 chore(deps): update dependency minver to v8 (#2320) renovate[bot]
  • 2d89767 chore(deps): update dependency sonaranalyzer.csharp to 10.33.0.1635 (#2316) renovate[bot]
  • 2f75847 chore(deps): update dependency microsoft.testing.extensions.codecoverage to 18.11.2 (#2322) renovate[bot]
  • 9bf02a3 chore(deps): update dependency verify.tunit to v32 (#2318) renovate[bot]
  • 96e91c6 chore(deps): update dependency roslynator.analyzers to v5 (#2317) renovate[bot]
  • 47698c4 chore(deps): pin github actions digests (#2323) renovate[bot]
  • 5d9fe43 chore(deps): update dependency sonaranalyzer.csharp to 10.34.0.3385 (#2321) renovate[bot]
  • 38471c8 chore(deps): update dependency publicapisharp.analyzers to v2 (#2328) renovate[bot]

📌 Other

🔗 Full Changelog: v15.2.0...v16.0.0

🙌 Contributions

💖 Thanks to all the contributors: @glennawatson

🤖 Automated services that contributed: renovate[bot]