diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b7aa949..adba10e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,11 @@ Release Notes ============= +## 1.4.0 + +- Added `slot` and `template` elements +- Added .NET Standard 2.0 support for full framework support + ## 1.3.0 Upgraded to `net5.0` target framework. diff --git a/src/Giraffe.ViewEngine/Engine.fs b/src/Giraffe.ViewEngine/Engine.fs index b9f3ea0..33cde3d 100644 --- a/src/Giraffe.ViewEngine/Engine.fs +++ b/src/Giraffe.ViewEngine/Engine.fs @@ -232,6 +232,10 @@ module HtmlElements = let menuitem = voidTag "menuitem" let summary = tag "summary" + // Web Components + let slot = tag "slot" + let template = tag "template" + // Others let iframe = tag "iframe" @@ -634,14 +638,23 @@ module RenderView = [] module AsBytes = - open System.Buffers let private outputAsBytes (sb : StringBuilder) = - let chars = ArrayPool.Shared.Rent sb.Length + let chars = + #if NETSTANDARD2_0 + Array.create (sb.Length) Char.MinValue + #else + System.Buffers.ArrayPool.Shared.Rent sb.Length + #endif + sb.CopyTo(0, chars, 0, sb.Length) let result = Encoding.UTF8.GetBytes(chars, 0, sb.Length) StringBuilderPool.Release sb - ArrayPool.Shared.Return chars + + #if !NETSTANDARD2_0 + System.Buffers.ArrayPool.Shared.Return chars + #endif + result let xmlNode (node : XmlNode) : byte[] = diff --git a/src/Giraffe.ViewEngine/Giraffe.ViewEngine.fsproj b/src/Giraffe.ViewEngine/Giraffe.ViewEngine.fsproj index 2e8e664..a743353 100644 --- a/src/Giraffe.ViewEngine/Giraffe.ViewEngine.fsproj +++ b/src/Giraffe.ViewEngine/Giraffe.ViewEngine.fsproj @@ -8,7 +8,7 @@ en-GB - net5.0 + net5.0;netstandard2.0 portable Library true @@ -46,5 +46,5 @@ - + diff --git a/tests/Giraffe.ViewEngine.Tests/Giraffe.ViewEngine.Tests.fsproj b/tests/Giraffe.ViewEngine.Tests/Giraffe.ViewEngine.Tests.fsproj index 324bb04..a14e3fc 100644 --- a/tests/Giraffe.ViewEngine.Tests/Giraffe.ViewEngine.Tests.fsproj +++ b/tests/Giraffe.ViewEngine.Tests/Giraffe.ViewEngine.Tests.fsproj @@ -12,14 +12,14 @@ - - - - - - - - + + + + + + + +