Repository navigation
Add asynchronous template file providers - #968
Merged
Merged
Conversation
Replace synchronous runtime template resolution with cancellation-aware async providers across core tags, view engines, and Minimal APIs. Preserve existing IFileProvider integrations through an adapter and add contextual cache isolation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 377d3293-943b-436f-93ea-ffb6eecd0fb2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remote template stores such as S3, Azure Blob Storage, and databases expose asynchronous APIs, but Fluid previously resolved runtime templates through synchronous
IFileProvidercalls. This forced integrations to block during template lookup and content reads.Summary
ITemplateFileProviderandTemplateSourceInfofor two-stage asynchronous metadata and content loading, including source versions and context-specific cache keys.IFileProviderimplementations and delegate-based custom providers.include,render,from, views, partials, layouts, and_ViewStartfiles through the async provider contract.TemplateContext.CancellationTokenthrough loading, rendering checkpoints, enumeration, generated templates, and output writes. MVC and Minimal APIs use the request cancellation token.IViewEnginecontract is synchronous.Migration
This is an intentional Fluid 3.0 source-breaking change:
TemplateOptions.FileProviderand the ViewEngine provider properties now acceptITemplateFileProvider. Existing providers can be wrapped withFileProviderTemplateFileProvider.Tests
dotnet build --no-restore --nologodotnet test --no-build --no-restoredotnet test --no-restore /p:Compiled=trueFixes: #955