Skip to content

Improve reflection support #2085

@alfonsogarciacaro

Description

@alfonsogarciacaro

It'd be great to improve reflection support for Fable 3. We can do it by bringing the reflection changes in #1839, but if possible I'd like to have these changes:

  • Have a separate PR for reflection and quotation support.
  • Keep the current style in Reflection.ts. That is, use module functions instead of class methods so it works better with tree shaking.
  • Instead of adding attribute and member information to all types. We could have the following functions in the Fable.Core.Reflection module:
generateConstructors<'T>()
generateProperties<'T>()
generateProperty<'T>(name)
generateMethods<'T>()
generateMethod<'T>(name)
generateCustomAttributes<'T>()

The Replacements module would replace calls to these methods with the necessary info inline, so we only generate the code where is needed.

What do you think @krauthaufen? Do the changes look good? Would you like to help with this? (If you want to sart working, please note we'll be using the next branch for Fable 3 development).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions