reaptor / elmish-land

A framework for building F# browser apps with Fable, React and Elmish. Inspired by Elm Land.
https://elmish.land/
MIT License
4 stars 0 forks source link

Add layout scaffolding #2

Open klofberg opened 8 months ago

klofberg commented 8 months ago

Should they be:

robinjac commented 6 months ago

I've conducted some experiments with this but haven't arrived at any satisfactory implementation. I examined two implementations, NextJS and Elm, and here are my thoughts:

NextJS: Utilizes the folder structure to scope layouts, which seems like a good approach. However, implementing it within an Elmish pattern posed a significant challenge. The complexity of the generated code increased substantially, almost unwarranted for what can be achieved by simply creating a component and sharing it across pages outside of the framework. Additionally, there are some edge cases that become problematic when one wants pages to opt out from a layout, as layouts are intrinsically connected to routes via the folder structure.

Elm: This approach aligns better with the Elmish architecture, but the reasons behind this choice in Elm were due to working within Elm's limitations, which F# doesn't have. Adopting this approach would essentially make Elmish similar to Elm, and I'm currently unconvinced that this is the direction we want to take.

In essence, I believe I need to build more practical examples within the framework before making an educated decision on how something like layouts should work. Another reason why I think we should put this on hold is to ensure that the routing part is flawless before adding a new significant feature.

Cheers! 🍻 😄