Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

[Tooling] Adapt Fabulous.CodeGen to automate creation of widget builders #12

Closed
TimLariviere opened this issue Nov 23, 2021 · 3 comments
Assignees
Milestone

Comments

@TimLariviere
Copy link
Owner

In v1, we created Fabulous.CodeGen to automate the creation of wrappers around Xamarin.Forms controls.
It works by taking a mapping file (Xamarin.Forms.Core.json) which has the path to dlls and how we should map the types inside those dlls.
It outputs 2 F# files with the attribute keys and wrappers for all mapped controls.

The idea is to reuse Fabulous.CodeGen and adapt it so it can generate both Xamarin.Forms.Core.Attributes.fs and Xamarin.Forms.Core.fs

Doing this will avoid us to implement everything by hand and make a lot more controls available in v2.

@edgarfgp
Copy link
Contributor

I would like to try and implement this

@edgarfgp
Copy link
Contributor

edgarfgp commented Dec 1, 2021

After looking at the changes needed for code generation to be adapted to v2. Im not sure if will be worth as it adds a lot complexity due new way of creating and updating widgets
@TimLariviere @twop

  • Xamarin.Forms.Core.json will need to be adapted to contain a new format that maps the new approach
  • Xamarin.Forms.Core.json maps the Xamarin.Forms.Core API with is not going to change as the Xamarin.Forms is now out of support
  • Before we had a single AttributeKey<_> and now we have : Attributes.define, Attributes.defineBindable, .. etc . Which makes the code generation(also the mapping.json) more complex
  • As Already noted the are some special Widgets that we want to create like LabelStyle, ButtonStyle , FormattedLabel

IMHO I think at this stage we will get more benefit from mapping the bindable properties Xamarin.Forms.Core API manually which seems a big task but make sure we cover all the special cases .

@TimLariviere
Copy link
Owner Author

Closing this one in favor of #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants