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

Fable.Form.Simple with pure HTML? #35

Open
leolorenzoluis opened this issue Jul 15, 2022 · 2 comments
Open

Fable.Form.Simple with pure HTML? #35

leolorenzoluis opened this issue Jul 15, 2022 · 2 comments

Comments

@leolorenzoluis
Copy link
Contributor

I'm trying to understand the code but I'm having a hard time groking it. Could you provide a sample on how to create like simple asHtml with no dependencies and just pure HTML? I'm trying to use Fable.Lit in this scenario.

@MangelMaxime
Copy link
Owner

Right now, Fable.Form.Simple as a strong dependencies over React

val custom :
config : CustomConfig<'Msg, 'Attributes> ->
viewConfig : ViewConfig<'Values,'Msg> ->
form : Form<'Values,'Msg, 'Attributes> ->
model : Model<'Values> ->
Feliz.ReactElement

See how Feliz.ReactElement is hardcorded.

So there is 2 solutions:

  1. Wait for Make Fable.Form.Simple renderer agnostic #14 to be fixed
  2. Implements your own Form logic.

Option 2, means re-coding Fable.Form.Simple with Fable.Lit as a strong dependency. In theory, this means copy/paste the code and replacing it Feliz.ReactElement with the equivalent in Fable.Lit.
And then, you need to preview the actual implementation of your view.

If you are confused by the .fsi files, just know that they make the module private by default because only what is listed in the .fsi file is made public from the corresponding file.

@MangelMaxime
Copy link
Owner

Version 5, is now renderer agnostic.

Currently, we provide support for Sutil and React directly. But any UI library can work.

At some point in time, I wanted to support Fable.Lit too but I already spent 10 more times on the update than I initially planned so I removed it.

You can see, the initial Fable.Lit implementation in this commit.

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