egil / Htmxor

Supercharges Blazor static server side rendering (SSR) by seamlessly integrating the Htmx.org frontend library.
MIT License
109 stars 12 forks source link

Track htmx v2 - htmxor should support v2 #11

Open egil opened 6 months ago

egil commented 6 months ago

While there is only an alpha release of htmx, it makes sense that htmxor supports it. Depending on htmx release cadance, it may even be the default.

https://v2-0v2-0.htmx.org/migration-guide-htmx-1/


These are changes that likely impact htmxor directly:

egil commented 2 months ago

Code for passing response handling in htmxconfig:

public partial record HtmxConfig
{
    [JsonPropertyName("responseHandling")]
    public IList<ResponseHandlingRule>? ResponseHandling { get; set; }
}

public record class ResponseHandlingRule
{
    public required string Code { get; set; }

    public bool Swap { get; set; }

    public bool? Error { get; set; }

    public bool? IgnoreTitle { get; set; }

    public string? Select { get; set; }

    public string? Target { get; set; }

    public string? SwapOverride { get; set; }
}
egil commented 2 months ago

New swap style:

public enum SwapStyle
{
    /// <summary>
    /// Replace the text content of the target element, without parsing the response as HTML.
    /// </summary>
    /// <remarks>
    /// NOTE: Available in Htmx version 2 and later.
    /// </remarks>
    TextContent
}