GithubHelp home page GithubHelp logo

explorecompoentbasereplace's Introduction

ExploreComponentBaseReplace

I have been banging my head on this all week. I am asking for help. I am willing to pay consulting fees for someone to help me answer questions up to full on dev. It is just on very piecemeal basis.

Here is the repo: https://github.com/IvanRainbolt/ExploreCompoentBaseReplace

Changing between the C# base components is in startup.fs

Change the commented lines.

The idea is to not use inherit from (Microsoft.AspNetCore.Components) ComponentBase (reasons are not really relevant for this issue, this is just a very first step in my overall plan) but instead implement the IComponent interface directly.

I have gotten a lot of understanding and help from the following:

https://github.com/ShaunCurtis/Rebuilding-The-Blazor-Component https://www.codeproject.com/Articles/5277618/A-Dive-into-Blazor-Components

https://fsharpforfunandprofit.com/posts/interfaces/

https://chrissainty.com/building-a-custom-router-for-blazor/

https://fsharpforfunandprofit.com/posts/porting-to-csharp-intro/

https://dev.to/madhust/blazor-in-depth-create-blazor-component-without-lifecycle-methods-2786

lot of MS docs: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.icomponent?view=aspnetcore-5.0

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.componentbase?view=aspnetcore-5.0

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendering.rendertreebuilder?view=aspnetcore-5.0

and MS github: https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/IComponent.cs

https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/Routing/Router.cs

https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/ComponentBase.cs

lots of reviewing .fs files in https://github.com/fsbolero/Bolero/tree/master/src/Bolero especially Components.fs and Render.fs

trying to understand fsbolero/Bolero#202 dotnet/aspnetcore#29260

and ref my own question of fsbolero/Bolero#150

The C# working component in my repo is based on https://www.codeproject.com/Articles/5277618/A-Dive-into-Blazor-Components

https://dev.to/madhust/blazor-in-depth-create-blazor-component-without-lifecycle-methods-2786

So my ask for help would be to do a direct port of the C# ClassLibrary1.Rating2 to an F# version that actually works the same way.

Second, would there be a better F# version? If so, an example.

This is WASM Blazor but not really and Bolero, but not really (as was told to me that Bolero is really elmish) so I am using and referencing Bolero code but really it's a matter of running ui in f# on WASM. A big part of the Bolero basis is just because it is the only F# on WASM really out there.

My hangup is that first, I still do not understand the steps happening with the RenderTree (like how it actually renders), and the RenderFragment and those sort of things. Still working on that learning.
The crucial hangup seems to be the usage of delegates. From studying ComponentBase and routers and such, the key seems to be _renderHandle.Render(_renderFragment)
a type Microsoft.AspNetCore.Components.RenderHandle instance that has the render method. The .Render takes a Microsoft.AspNetCore.Components.RenderFragment which is defined as a delegate. That is where I go off the rails.

explorecompoentbasereplace's People

Contributors

ivanrainbolt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.