Unify member accessor contract - #987
Merged
Merged
Conversation
Canonicalize identifiers per template and let built-in member accessors return FluidValue directly on the rendering hot path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the split synchronous, asynchronous, and FluidValue accessor interfaces with a single MemberAccessor abstraction that returns ValueTask<FluidValue>. Update runtime, reflection, generated, and registered accessor paths to use the engine-native value contract directly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a5b2c42-bcdc-4c1f-b0c4-26e49441e90b
Restore direct identifier string creation during parsing and remove the parse-local canonicalization state and its reference-identity test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a5b2c42-bcdc-4c1f-b0c4-26e49441e90b
Describe migration from the removed accessor interfaces to MemberAccessor, including conversion helpers, nil semantics, and exact-name registration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a5b2c42-bcdc-4c1f-b0c4-26e49441e90b
Document only the current MemberAccessor API without describing compatibility or removed interfaces. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9a5b2c42-bcdc-4c1f-b0c4-26e49441e90b
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.
Member access currently uses separate synchronous, asynchronous, and engine-native accessor paths. This consolidates them into one contract so every accessor can return a
FluidValuedirectly without maintaining parallel dispatch and source-generation logic.Changes
IMemberAccessor,IAsyncMemberAccessor, and the internal direct-value accessor path withMemberAccessor.GetAsync, returningValueTask<FluidValue>.MemberAccessorimplementations and conversion helpers.Breaking change
Custom accessor implementations now derive from
MemberAccessor. This is intentional for the next breaking release.Performance
Order-balanced, three-launch
FluidBenchmarks.Renderruns showed no measurable change:origin/mainThe change is intended as API and implementation simplification, not a performance claim.
Validation
dotnet test Fluid.Tests/Fluid.Tests.csproj -c Releasedotnet test Fluid.Tests/Fluid.Tests.csproj -c Release /p:Compiled=truedotnet build Fluid/Fluid.csproj -c Releasefornetstandard2.0,net8.0,net9.0, andnet10.0Task<T>,ValueTask<T>, custom converters, generic registrations, and dotted access