davedawkins / Sutil

Lightweight front-end framework for F# / Fable. No dependencies.
https://sutil.dev
MIT License
285 stars 17 forks source link

Any chance of jsx getting implemented #80

Open pkese opened 1 year ago

pkese commented 1 year ago

https://github.com/fable-compiler/Feliz.JSX

Is there any chance that something like the above would be added to Sutil?

pkese commented 1 year ago

I'm of the opinion, that the F# HTML DSLs are taking away more than they are bringing to the table.

For somebody doing web apps only occasionally, searching for Feliz style CSS selectors is really cumbersome.

Its not where F# really shines and it makes it really hard to sell F# to JS/TS developers used to JSX.
I think there's a market space for a F# web framework with an option of nice JSX integration.

davedawkins commented 1 year ago

https://github.com/fable-compiler/Feliz.JSX

Is there any chance that something like the above would be added to Sutil?

@alfonsogarciacaro did create support for Sutil and something like this. I need to dig through and find it.

I'm of the opinion, that the F# HTML DSLs are taking away more than they are bringing to the table.

It's a fair criticism. Personally, I value the (degree of) type-safety + intellisense it provides, but then again, it's always out of date and requires constant maintenance to stay up-to-date. With my own projects, I mix the DSLs regularly with *.css stylesheets, and even my DSL CSS code will fall back to Css.custom ("template-grid-rows", "...") etc

Its not where F# really shines and it makes it really hard to sell F# to JS/TS developers used to JSX. I think there's a market space for a F# web framework with an option of nice JSX integration.

I appreciate the insight and constructive criticism; I will dig out @alfonsogarciacaro 's contribution - I'm hoping it's exactly what you're asking for. If not, it's something very similar

MattMS commented 6 months ago

I personally feel that JSX fights against what Sutil helps, which is using the native web vs virtual-DOMs.

By focusing on F# patterns, it allows us to more easily expand things into functions (as a superset of function components) and more quickly/concisely develop pages. I'll concede there is some learning time, but it is well worth it, and actually educates on proper web standards.

It does take some reset time from the React mindset, but it is totally worth it, since you can pick up any framework to include from there (including React).