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

The value or constructor 'MudCard'' is not defined. #2

Closed
MichielNass opened this issue Nov 29, 2021 · 7 comments
Closed

The value or constructor 'MudCard'' is not defined. #2

MichielNass opened this issue Nov 29, 2021 · 7 comments

Comments

@MichielNass
Copy link

When I use the sample code I get this error:

Severity Code Description Project File Line Suppression State
Error FS0039 The value or constructor 'MudCard'' is not defined. Maybe you want one of the following:� MudCard� MudChart� MudCardMedia� MudCardHeader� MudCardActions DSL C:\Users\drbbr\source\repos\TraceOkApp\DSL\MudBlazor.fs 22 N/A

How can I resolce this?

@albertwoo
Copy link
Contributor

Can you share your demo repo? Or let me know how you are using it?

@MichielNass
Copy link
Author

Maybe I should clarify my intention. I intended to use this to persuade my C# colleague of the wonders of F#. And I do really like F# but everytime UI gets involved I seem to hit a brick wall.

My C# colleague and I both know Blazor and like it a lot. I was hoping to rebuild our Blazor components we have in production and gradually replace them with components build in F#.

Can this be used in such a way or is it an all or nothing situation?

@albertwoo
Copy link
Contributor

You can check repo https://github.com/slaveOftime/Fun.Blazor.Samples for UseWithCSharpBlazor.

You can use it in anyway you want. Use csharp blazor component in fsharp, or use fsharp blazor component in csharp. But it has cost, because you need to write wrapper class or use Fun.Blazor.Cli to auto generate DSL for you.

If you are trying to build a big components in F#, it should worth it. But if you are just want to create basic controls like button etc. in F# and share in csharp project, it will not worth it.

But you should try the samples and evaluate some edge cases you can get with a POC to find out.

Because I believe there is no production use for this project, and it kind of new. So you should evaluate carefully. But I will try to make it as better as possible. You can think this project as a utility of bolero project, so if you think you can use bolero in production then this project will make it better.

And there is no hot reload for F# so far, so every time you need to start your project again after you made changes. It is in prgress and tracked in dotnet/fsharp#11636

@MichielNass
Copy link
Author

My colleague helped me and we downloaded the Samples zip but when we build we get this :

Error FS3087 The custom operation 'childContent' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. MinimalBlazorWASMApp Fun.Blazor.Samples-main\Fun.Blazor.Samples-main\MinimalBlazorWASMAppWithMudBlazor\App.fs 13 N/A

@albertwoo
Copy link
Contributor

  1. You can use .NET 6 SDK to build the project
  2. You can add preview
<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <LangVersion>preview</LangVersion>
  </PropertyGroup>

Because custom operation override for computation expression is in preview in dotnet 5.

I just commit the fix too. Sorry for that.

@MichielNass
Copy link
Author

Yes, with this fix it works, thank you!

@MichielNass
Copy link
Author

If you are trying to build a big components in F#, it should worth it. But if you are just want to create basic controls like button etc. in F# and share in csharp project, it will not worth it.

Don't sell this project short. I know it is early days, but I think there will come a time when type safety becomes the norm.

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