-
-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
We're updating Fluid to v2.25 and ran into a Context RootScope backwards compatibility issue, and are wondering if this particular change was purposeful or inadvertent.
The recently [Obsolete] Render(...) method now calls RenderAsync(template, writer, context, encoder);
[Obsolete("Use Render(this IFluidTemplate template, TextWriter writer, TemplateContext context, TextEncoder encoder) instead. This method will be removed in a future version.")]
public static void Render(this IFluidTemplate template, TemplateContext context, TextEncoder encoder, TextWriter writer)
{
var task = RenderAsync(template, writer, context, encoder);
And at runtime, that calls this RenderAsync extension method (template.RenderAsync(...)
) which defaults isolateContext
true:
public static async ValueTask RenderAsync(this IFluidTemplate template, TextWriter textWriter, TemplateContext context, TextEncoder encoder, bool isolateContext = true)
{ ...
...instead of the original FluidTemplate's RenderAsync method:
public ValueTask RenderAsync(TextWriter writer, TextEncoder encoder, TemplateContext context)
{ ...
...which was originally this (note the order of the encoder, context
vs context, encoder
above):
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Render(this IFluidTemplate template, TemplateContext context, TextEncoder encoder, TextWriter writer)
{
var task = template.RenderAsync(writer, encoder, context);
if (!task.IsCompletedSuccessfully)
{
task.AsTask().GetAwaiter().GetResult();
}
}
Ultimately I'm wondering if the obsoleted Render was supposed to pass isolateContext: false
to that or if that is intentional.
If it's intentional, please forgive me and close this issue.
Metadata
Metadata
Assignees
Labels
No labels