Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api-overwrites/tag-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ example:
---

---
uid: Ramstack.HtmxToolkit.TagHelpers.HtmxHeaderTagHelper
uid: Ramstack.HtmxToolkit.TagHelpers.HtmxHeadersTagHelper
example:
- |-
[!code-razor[](../snippets/tag-helpers/HeaderTagHelper.cshtml)]
[!code-razor[](../snippets/tag-helpers/HeadersTagHelper.cshtml)]
---

---
Expand Down
2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the guides show how those pieces fit into an application.
| Set swap styles, event timing, or a follow-up request | [HtmxSwap](xref:Ramstack.HtmxToolkit.HtmxSwap), [HtmxTriggerTiming](xref:Ramstack.HtmxToolkit.HtmxTriggerTiming), [HtmxLocationOptions](xref:Ramstack.HtmxToolkit.HtmxLocationOptions) | [Response instructions](../articles/responses.md#choose-a-response-instruction) |
| Select or configure MVC actions | [HtmxRequestAttribute](xref:Ramstack.HtmxToolkit.HtmxRequestAttribute), [HtmxResponseAttribute](xref:Ramstack.HtmxToolkit.HtmxResponseAttribute) | [MVC action selection](../articles/requests.md#select-mvc-actions-declaratively) |
| Generate URLs in Razor | [HtmxUrlTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxUrlTagHelper) | [Request URLs](../articles/tag-helpers.md#generate-request-urls) |
| Add values, headers, or request options | [HtmxValsTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxValsTagHelper), [HtmxHeaderTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxHeaderTagHelper), [HtmxRequestTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxRequestTagHelper) | [Tag Helpers](../articles/tag-helpers.md) |
| Add values, headers, or request options | [HtmxValsTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxValsTagHelper), [HtmxHeadersTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxHeadersTagHelper), [HtmxRequestTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxRequestTagHelper) | [Tag Helpers](../articles/tag-helpers.md) |
| Register the toolkit and render configuration | [ServiceCollectionExtensions](xref:Ramstack.HtmxToolkit.Hosting.ServiceCollectionExtensions), [HtmxToolkitOptions](xref:Ramstack.HtmxToolkit.Configuration.HtmxToolkitOptions), [HtmxConfigTagHelper](xref:Ramstack.HtmxToolkit.TagHelpers.HtmxConfigTagHelper) | [Configuration](../articles/configuration.md) |
| Configure a specific HTMX version | [HtmxV1Config](xref:Ramstack.HtmxToolkit.Configuration.HtmxV1Config), [HtmxV2Config](xref:Ramstack.HtmxToolkit.Configuration.HtmxV2Config), [HtmxV4Config](xref:Ramstack.HtmxToolkit.Configuration.HtmxV4Config) | [Choose a version](../articles/choosing-version.md) |

Expand Down
5 changes: 4 additions & 1 deletion docs/articles/migrate-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ These changes affect fewer applications:
The numeric values of the members that follow them changed; this matters only if the values are stored or cast.
- Typed swap getters, such as `HtmxResponseHeaders.Reswap`, parse the style the way HTMX does:
case-sensitively, and ignoring leading whitespace. A value such as `OUTERHTML` now returns `null`.
- `HtmxHeaderTagHelper.Headers` changed from `Dictionary<string, string>` to `IDictionary<string, string>`,
- `HtmxHeaderTagHelper` was renamed to `HtmxHeadersTagHelper`. `@addTagHelper *, Ramstack.HtmxToolkit` is not affected.
**Silent:** a directive that names the old class still builds but no longer matches it. With `@addTagHelper`,
`hx-header-*` attributes are rendered unchanged; with `@removeTagHelper`, the Tag Helper stays active.
- `HtmxHeadersTagHelper.Headers` changed from `Dictionary<string, string>` to `IDictionary<string, string>`,
and header names are compared without case.
- `hx-header-*` and `hx-all-headers` throw `InvalidOperationException` when the element also has a hand-written
`hx-headers` or `data-hx-headers`. In 1.x, the hand-written value was silently lost.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Ramstack.HtmxToolkit.TagHelpers;
[HtmlTargetElement(Attributes = AppendAttributeName)]
[HtmlTargetElement(Attributes = HeadersDictionaryName)]
[HtmlTargetElement(Attributes = HeadersPrefix + "*")]
public sealed class HtmxHeaderTagHelper(IOptions<HtmxToolkitOptions> options) : TagHelper
public sealed class HtmxHeadersTagHelper(IOptions<HtmxToolkitOptions> options) : TagHelper
{
private const string InheritedAttributeName = "hx-headers-inherited";
private const string AppendAttributeName = "hx-headers-append";
Expand Down
2 changes: 1 addition & 1 deletion tests/Ramstack.HtmxToolkit.AotValidation/TrimmerRoots.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<namespace fullname="Ramstack.HtmxToolkit.Internal" />
<namespace fullname="Ramstack.HtmxToolkit.Serialization" />
<type fullname="Ramstack.HtmxToolkit.TagHelpers.HtmxConfigTagHelper" />
<type fullname="Ramstack.HtmxToolkit.TagHelpers.HtmxHeaderTagHelper" />
<type fullname="Ramstack.HtmxToolkit.TagHelpers.HtmxHeadersTagHelper" />
<type fullname="Ramstack.HtmxToolkit.TagHelpers.HtmxRequestTagHelper" />
<type fullname="Ramstack.HtmxToolkit.TagHelpers.HtmxValsTagHelper" />
</assembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Ramstack.HtmxToolkit.Tests.TagHelpers;

[TestFixture]
public class HtmxHeaderTagHelperTests
public class HtmxHeadersTagHelperTests
{
[Test]
public async Task ProcessAsync_SerializesHeaders()
Expand Down Expand Up @@ -181,7 +181,7 @@ public void ProcessAsync_DeclaredHxHeaders_Throws(string name)
Assert.That(exception!.Message, Does.StartWith($"The {name} attribute"));
}

private static HtmxHeaderTagHelper CreateHelper(HtmxTargetVersion version = HtmxTargetVersion.V2)
private static HtmxHeadersTagHelper CreateHelper(HtmxTargetVersion version = HtmxTargetVersion.V2)
{
var options = new HtmxToolkitOptions();

Expand All @@ -200,6 +200,6 @@ private static HtmxHeaderTagHelper CreateHelper(HtmxTargetVersion version = Htmx
throw new ArgumentOutOfRangeException(nameof(version));
}

return new HtmxHeaderTagHelper(Options.Create(options));
return new HtmxHeadersTagHelper(Options.Create(options));
}
}
Loading