Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giraffe.ViewEngine.StrongName breaks compatability with Giraffe server #452

Open
anpin opened this issue May 9, 2024 · 2 comments
Open

Comments

@anpin
Copy link

anpin commented May 9, 2024

Description

Hey, thanks for you effort in this library, it really is amazing.

I came about an issue with the fork project mentioned here giraffe-fsharp/Giraffe.ViewEngine#23

It is currently not possible to render a chart to json in a giraffe backend via toJson gChart as it was added in version 4.1.0 which doesn't work with giraffe due to a presence of forked Giraffe.ViewEngine.StrongName package

Components.fs(286,9): error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 
'Giraffe.ViewEngine.HtmlElements.XmlAttribute (Giraffe.ViewEngine.StrongName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=028aa8e2a326f4d0)'. 
This element has type 'Giraffe.ViewEngine.HtmlElements.XmlAttribute (Giraffe.ViewEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)'. 
[Components.fsproj::TargetFramework=net8.0]

Repro steps

dotnet new giraffe -o plot
cd plot
dotnet add package Plotly.Net
dotnet build

Expected behavior

Project builds

Actual behavior

/home/a/projects/plot/Program.fs(57,14): error FS0001: This expression was expected to have type    'Giraffe.ViewEngine.HtmlElements.XmlNode (Giraffe.ViewEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)'    but here has type    'Giraffe.ViewEngine.HtmlElements.XmlNode (Giraffe.ViewEngine.StrongName, Version=2.0.0.0, Culture=neutral, PublicKeyToken=028aa8e2a326f4d0)' [/home/a/projects/plot/plot.fsproj]

Build FAILED.

Known workarounds

Fork Plotly.Net and revert the change

Related information

  • Operating system Linux
  • Branch v4.1.0+
  • dotnet 8.0.204
@kMutagene
Copy link
Collaborator

kMutagene commented May 13, 2024

Hey, thanks for you effort in this library, it really is amazing.

thanks!

Fork Plotly.Net and revert the change

this will only work in an environment that does not care about this strong naming clusterfck. I really regret supporting this, and I think i might actually revert it in a future version. But for the moment i have no idea what i could do about this that would not lead to either a) breaking compatibility for netfx/strong naming stuff or b) depend on the Giraffe team on signing the original package.

@kMutagene
Copy link
Collaborator

However, a workaround could be including the raw html output, which would be GenericChart.toChartHTML, which is just calling toChartHTMLNodes and renders it as a string, meaning it should lead to the same output if you just yield the raw string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants