Releases: reactiveui/refit
Release list
16.3.0
🗞️ What's Changed
✨ Features
- 053873c feat(analyzers): explain why a method cannot generate and flag unbound route placeholders (#2340) @glennawatson
🔗 Full Changelog: v16.2.0...v16.3.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
16.2.0
🗞️ What's Changed
✨ Features
- d864935 feat(testing): add controllable streams, request capture and a test clock to Refit.Testing (#2337) @glennawatson
- 0418743 feat(bodies): typed JSON Lines uploads from IEnumerable and IAsyncEnumerable (#2338) @glennawatson
🧹 General Changes
- 2ecbf2a chore: update packages, credit Refit's origins, remove stale files (#2336) @glennawatson
- 7aa89fa chore: remove the Jekyll site files now that GitHub Pages redirects to reactiveui.net @glennawatson
✅ Tests
- a463e8a test(bodies): cover the remaining typed JSON Lines branches (#2339) @glennawatson
📝 Documentation
- 5d17ac9 docs(readme): name the programme behind each sponsor @glennawatson
- ceb75e8 docs(readme): link to the ReactiveUI sponsors page @glennawatson
- a330a63 docs(readme): keep the README renderable on nuget.org @glennawatson
- 176ebdb docs: new Refit logo and official sponsor logos @glennawatson
- 7333739 docs(readme): credit OpenAI's Codex for Open Source support @glennawatson
📦 Dependencies
🔗 Full Changelog: v16.1.0...v16.2.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
🤖 Automated services that contributed: renovate[bot]
16.1.0
🗞️ What's Changed
✨ Features
- aa139a2 feat: add lazy paging with generated PagedEnumerable methods (#2332) @glennawatson
- bb98726 feat: register JSON contexts and accept JsonTypeInfo parameters (#2333) @glennawatson
📝 Documentation
- 9df0751 docs: point the code of conduct at the website @glennawatson
📌 Other
- 5106e9c Update copyright year in LICENSE file @glennawatson
🔗 Full Changelog: v16.0.0...v16.1.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
16.0.0
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=truealso 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/Documentationhas a project for every website page, plus larger samples for topics such as multipart uploads, serializers and compression. Each project builds withRefit.slnxand 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]sendsOPTIONS, that[Url]accepts an empty path or/, and that[PathPrefix]does not add a leading slash. The Refit.Testing docs state thatVerifyAllCalledignores 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.mdlists 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
sourceRefto 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
- 6f0507f feat: expand generated request support & docs (#2329) @glennawatson
- 6445e42 feat: update nuget packages, update Renovate configuration, enhance generator tests, remove unused packages (#2330) @glennawatson
- 1459f55 feature: Remove runtime-async feature from Directory.Build.props (#2331) @glennawatson
🧹 General Changes
- ba8f492 ci: let the shared fork SonarCloud workflow resolve the pull request itself @glennawatson
- 1542153 ci: remove SonarCloud scanning of fork pull requests @glennawatson
- 7b1c3be ci(lock): run the lock workflow at its own time of day @glennawatson
- dd2a75f ci: pass sourceRef to the shared release workflow @glennawatson
📝 Documentation
- c2bd862 docs(readme): link combined API reference @glennawatson
- dee79fc docs: add security policy @glennawatson
📦 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
- bb49573 Update sponsors section in README @glennawatson
- 5106e9c Update copyright year in LICENSE file @glennawatson
🔗 Full Changelog: v15.2.0...v16.0.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
🤖 Automated services that contributed: renovate[bot]
15.2.0
🗞️ What's Changed
✨ Features
- 1643323 feat(body): compress request bodies (#2311) @glennawatson
🐛 Fixes
- 96316a6 fix(debugging): stop debugger displays rendering as a bare null (#2315) @glennawatson
- 05c856a fix(generator): keep the analyzers loadable in Visual Studio (#2309) @glennawatson
- 1dc4377 fix(headers): stop rewriting raw header values (#2310) @glennawatson
📦 Dependencies
🔗 Full Changelog: v15.1.0...v15.2.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
🤖 Automated services that contributed: renovate[bot]
15.1.0
🗞️ What's Changed
🐛 Fixes
- 74cbb64 fix(generator): ship a single Roslyn analyzer slot (#2305) @glennawatson
⚡ Performance
- b455f65 perf(generator): return the request task instead of awaiting it (#2302) @glennawatson
🧹 General Changes
- 0065f72 build: raise the analyzer rules to error and fix the reported code (#2299) @glennawatson
📦 Dependencies
- 46071eb chore(deps): update dependency sonaranalyzer.csharp to 10.32.0.713 (#2303) renovate[bot]
- 51368ea chore(deps): update dependency roslynator.analyzers to 4.16.0 (#2298) renovate[bot]
🔗 Full Changelog: v15.0.0...v15.1.0
🙌 Contributions
💖 Thanks to all the contributors: @glennawatson
🤖 Automated services that contributed: renovate[bot]
15.0.0
🗞️ What's Changed
✨ Features
- 6f5aa73 feat: introduce GeneratedSingleTypeParameterAttributeProvider for single attribute type handling @glennawatson
- 873c8bd feat: keyed refit generated client DI registration (#2297) @rmja
- 0ebbaf4 feat: Implement a more legible Source Code (#2282) @glennawatson @JaviergarcíadelaNocedaArgüelles @jgarciadelanoceda
🐛 Fixes
- 285cc67 fix: resolve generated clients when the module initializer runs late (#2289) @glennawatson
- ee87983 fix: differentiate explicitly empty string delimiter from "no delimiter" (#2295) @rmja
- 69ee15f fix: Propagate cancellation exceptions during response buffering (#2284) @lukas @radixy0
🧹 General Changes
- dc278d3 chore(renovate): group related dependency cohorts (#2286) @glennawatson
- 5d4a0b9 build: track public API with PublicApiSharp.Analyzers (#2288) @glennawatson
📦 Dependencies
- 7d6f29d chore(deps): update dependency sonaranalyzer.csharp to 10.31.0.145097 (#2290) @renovate[bot]
- 52345ac chore(deps): update dependency verify.tunit to 31.28.0 (#2291) @renovate[bot]
🔗 Full Changelog: v14.0.1...v15.0.0
🙌 Contributions
🌱 New contributors since the last release: @lukas, @radixy0
💖 Thanks to all the contributors: @glennawatson, @jgarciadelanoceda, @lukas, @radixy0, @rmja
🤖 Automated services that contributed: @renovate[bot]
15.0.0-beta.1
🗞️ What's Changed
✨ Features
- 6f5aa73 feat: introduce GeneratedSingleTypeParameterAttributeProvider for single attribute type handling @glennawatson
- 0ebbaf4 feat: Implement a more legible Source Code (#2282) @glennawatson @JaviergarcíadelaNocedaArgüelles @jgarciadelanoceda
🐛 Fixes
- 285cc67 fix: resolve generated clients when the module initializer runs late (#2289) @glennawatson
- 69ee15f fix: Propagate cancellation exceptions during response buffering (#2284) @lukas @radixy0
🧹 General Changes
- dc278d3 chore(renovate): group related dependency cohorts (#2286) @glennawatson
- 5d4a0b9 build: track public API with PublicApiSharp.Analyzers (#2288) @glennawatson
📦 Dependencies
- 52345ac chore(deps): update dependency verify.tunit to 31.28.0 (#2291) @renovate[bot]
- 7d6f29d chore(deps): update dependency sonaranalyzer.csharp to 10.31.0.145097 (#2290) @renovate[bot]
🔗 Full Changelog: v14.0.1...v15.0.0-beta.1
🙌 Contributions
🌱 New contributors since the last release: @lukas, @radixy0
💖 Thanks to all the contributors: @glennawatson, @JaviergarcíadelaNocedaArgüelles, @jgarciadelanoceda, @lukas, @radixy0
🤖 Automated services that contributed: @renovate[bot]
14.0.1
🗞️ What's Changed
🐛 Fixes
- 132f72d fix(generator): support path and header bindings (#2281) @glennawatson
⚡ Performance
- 2f16caa perf: escape query components in place (#2277) @glennawatson @jgarciadelanoceda
- 6501f88 perf: Use String Interpolation In Code Generation (#2278) @glennawatson @jgarciadelanoceda
🔗 Full Changelog: v14.0.0...v14.0.1
🙌 Contributions
🌱 New contributors since the last release: @JavierGarciadelaNocedaArguelles
💖 Thanks to all the contributors: @glennawatson, @JavierGarciadelaNocedaArguelles, @JaviergarcíadelaNocedaArgüelles, @jgarciadelanoceda
14.0.0
Refit 14.0.0
Refit 14 is a major bug-fix and request-generation release. It fixes a broad set of correctness issues while completing the move to source-generated request building. Most clients can now build requests without runtime reflection, improving trimming, Native AOT support, startup time, and allocations.
What end users need to know
- Check RF006 warnings before upgrading. The reflection request builder has moved out of the main package. If any API method reports RF006, add the
Refit.Reflectionpackage. Fully generated clients should not add it. - Some async APIs now return
ValueTask. This affects the success-guard methods,DefaultApiExceptionFactory.CreateAsync, and severalRefitSettingsdelegates. Most callers can continue toawaitthem; code that stores aTaskmay need.AsTask(). - A few request-building behaviours are intentionally different. Query objects are flattened from their declared type, serializer property names are honoured in query keys, and nested URL-encoded objects are flattened instead of using
ToString(). - Caller-owned streams remain open. Refit no longer disposes streams supplied as request bodies or multipart parts; callers are responsible for disposing them.
- Validation timing can change. Fully generated interfaces validate route templates when the first request is built rather than when the client is created. Generated method frames also no longer appear in
ApiExceptionstack traces. - Empty authorization tokens now omit the header. Returning null, empty, or whitespace from
AuthorizationHeaderValueGetterno longer sends a blankAuthorizationheader.
Major fixes
- Request generation now handles multiple generic overloads, escaped C# keyword identifiers, nullable value-type query objects, nested URL-encoded bodies, and indexed query collections correctly.
- Caller-supplied request streams can be reused, generated helper types no longer collide across
InternalsVisibleToassemblies, and null parameter values round-trip correctly.
Highlights
- New request controls include
[PathPrefix], per-method[Timeout], absolute URLs with[Url], optional route segments, indexed query collections, header validation, and returning a builtHttpRequestMessagewithout sending it. - Query objects, dictionaries, generic methods, multipart form objects, and custom return-type adapters gain broader reflection-free generation.
- Server-Sent Events can be consumed as
IAsyncEnumerable<T>, and transport exceptions can be customized withTransportExceptionFactory. - Runtime, reflection, and source-generator allocation reductions improve throughput; source generation is roughly twice as fast in the measured workload.
See the V14 migration details and complete feature documentation.
🗞️ What's Changed
💥 Breaking Changes
- e511df2 feat!: reflection-free source-generated request building (#2210) @glennawatson @TimothyMakkison
✨ Features
- 88e1c24 feat: add generic tests to
ReflectionTests(#2195) @TimothyMakkison - 463f5cf feat: add [Timeout] attribute for per-method request timeouts (#2238) @glennawatson
- 294e63a feat: add success guards to the non-generic IApiResponse (#2242) @glennawatson
- f754684 feat: add interface-level [PathPrefix] attribute for a shared route prefix (#2240) @glennawatson
- 65f864e feat: only generate
AttributeProviderfield when not empty (#2271) @TimothyMakkison - 99c055b feat: support optional url segments with {name?} syntax (#2237) @glennawatson
- 759a3c0 feat: support returning the built HttpRequestMessage without sending (#2235) @glennawatson
- 88d5e68 feat: add CollectionFormat.Indexed for indexed query collection expansion (#2262) @Copilot @glennawatson @jgarciadelanoceda
- d9b3d5f feat: support Server-Sent Events as a streaming content format (#2232) @glennawatson
- 1e35cc9 feat: add [Url] attribute for absolute request URLs (#2236) @glennawatson
- 7c33871 feat: add opt-in RefitSettings.ValidateHeaders (#2225) @glennawatson
- b583a34 feat: add null handling for round trip parameter and add verifying test (#2201) @TimothyMakkison
- 485c632 feat: opt-in [FormObject] flattens a model into multipart form fields (#2245) @glennawatson
- 7ac3e1a feat: fix failiure when multiple generic overloads (#2199) @TimothyMakkison
- 852cb2c feat: move version configuration into
AddConfiguredRequestOptions(#2214) @glennawatson @TimothyMakkison - a2b1581 feat: add analyzer diagnostics for invalid Refit interfaces (#2220) @glennawatson
- 4068d97 feature: Create a TransportExceptionFactory to let the user decide the exception to be thrown (#2205) @glennawatson @jgarciadelanoceda
- ed63528 feat: optional auth header and scoped authorization token provider (#2221) @glennawatson
- 7bf7b41 feat: inline constrained-generic path-bound objects in the source generator (#2222) @glennawatson
- 14895a4 feat: expose call argument values to DelegatingHandlers (#2223) @glennawatson
- 37efb4e feat: add per-type URL parameter formatter registry (#2226) @glennawatson
- aa1c19b feat: publish method name and route template in request options (#2239) @glennawatson
♻️ Refactoring
- aa2229b refactor: resolve analyzer diagnostics across solution (#2268) @ChrisPulman
🐛 Fixes
- 8e4237b fix:Analyzer false positive on Indexed CollectionFormat (#2274) @jgarciadelanoceda
- 809de10 fix: do not dispose caller-supplied request streams (#2234) @glennawatson
- 71634f2 fix: escape keyword identifiers in generated interface member names (#2248) @glennawatson
- 17c24d8 fix: name generated helper types per assembly to avoid InternalsVisibleTo conflicts (#2257) @glennawatson
- 78271e1 fix: generate inline query building for nullable value-type query objects (#2265) @rmja
- 02a037b fix: flatten nested objects in url-encoded request bodies (#2224) @glennawatson
⚡ Performance
- 147282a perf: replace
StringBuilderwithValueStringBuilderinRoundTripEscapePath(#2253) @TimothyMakkison - b193498 perf: replace
StringBuilderwithValueStringBuilder(#2270) @TimothyMakkison - eb92914 perf: call
PooledStringBuilderdirectly and removeConcatPartsandJoinParts(#2275) @TimothyMakkison - b575c9d perf:
AllAttributesCachereplaceLazywith laziliy initialised code (#2211) @TimothyMakkison - 8382bed perf: reduce Refit.Reflection memory allocations (#2267) @glennawatson
- fc06c57 perf: check for
allowUnmatchedParameterbefore callingIndexOf(#2252) @TimothyMakkison - f24d171 perf: wrap helper methods in
MethodImplOptions.AggressiveInlining(#2260) @TimothyMakkison - 8cea3f1 perf: reduce runtime Refit memory allocations (#2263) @glennawatson
- 5dcfcc9 perf: cut source generator allocations and roughly halve generation time (#2259) @glennawatson
🧹 General Changes
- 44f81de ci: gate native AOT smoke test via shared reusable workflow (#2244) @glennawatson
- a9932f8 chore: enable 1000 lines for real @glennawatson
- 393b245 ci: add alpha/beta/rc pre-release channel to release workflow @glennawatson
- 8cc1c37 chore: Relax number of file lines to 1000 lines instead of 500 @glennawatson
✅ Tests
- e5da8b8 test: reach 100% product code coverage (#2243) @glennawatson
- 865d0f2 test(refit.testing): cover retry and timeout scenarios (#2208) @glennawatson
- e67c5c4 test: cover TransportExceptionFactory cancellation and timeout behavior (#2203) @arpitjain099 @glennawatson
📝 Documentation
- 544db0b docs: make v12 Error.Content migration discoverable and add interface composition...