Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinmoris committed May 24, 2021
2 parents fdba5cd + ff7b59d commit 313d7f1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
19 changes: 16 additions & 3 deletions src/Giraffe.ViewEngine/Engine.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -634,14 +638,23 @@ module RenderView =

[<RequireQualifiedAccess>]
module AsBytes =
open System.Buffers

let private outputAsBytes (sb : StringBuilder) =
let chars = ArrayPool<char>.Shared.Rent sb.Length
let chars =
#if NETSTANDARD2_0
Array.create (sb.Length) Char.MinValue
#else
System.Buffers.ArrayPool<char>.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<char>.Shared.Return chars

#if !NETSTANDARD2_0
System.Buffers.ArrayPool<char>.Shared.Return chars
#endif

result

let xmlNode (node : XmlNode) : byte[] =
Expand Down
4 changes: 2 additions & 2 deletions src/Giraffe.ViewEngine/Giraffe.ViewEngine.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<NeutralLanguage>en-GB</NeutralLanguage>

<!-- Build settings -->
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<DebugType>portable</DebugType>
<OutputType>Library</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -46,5 +46,5 @@
<Compile Include="StringBuilderPool.fs" />
<Compile Include="Engine.fs" />
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions tests/Giraffe.ViewEngine.Tests/Giraffe.ViewEngine.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.*" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.*" />
<PackageReference Include="System.Net.Http" Version="4.3.*" />
<PackageReference Include="xunit" Version="2.4.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Include="NSubstitute" Version="4.2.*" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.*" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 313d7f1

Please sign in to comment.