is there any plan to support attribute and more complex reflection features?
as title also memory span and ArraySegment moreover ArraySegment can be implemented directly in F#, and Span can also be simulated directly using TypedArray+offset. and it seems that there are many ways to support attribute such as setting a property named "__metadata" in class (store together with datafields and configured to be "not enumerable" or you can just use "Symbol" or some other equivalents) and "__attrs" which is used to save the references to the classentity(compile result) of the attribute and the reflection operations can be used to find these infomation to achieves the more prefer reflection supports
is there any plan to implelement those feature above?
the main problem is that I've used it in a company project
Hello,
Could you please specify which target are you referring too? My supposition is JavaScript but I could be wrong.
I am not familiar with the API mentioned above so I don't how in which scenario they are useful or not. Fable doesn't aims to support all the BCL API but if an API can be implemented and "make sense" in general we are open to adding support for it.
- Adding
ArraySegmentshould be possible yes, to do that we probably need to create our own type because I don't think JavaScript has an equivalent or we can simulate using F# to copy/paste the code between targets (if the output is performant enough as I suppose it is used for performance) -
Span: at the time of introduction ofSpan, I think Alfonso decided to not support them because their was not equivalent in JavaScript. Does it make sense to supportSpanwhich are using for performance / memory control when in JavaScript it will not have exactly the same behaviour? - Improving reflection support: perhaps it depends on the scenario you would like to support. Fable reflection API is limited, decision for that was to not increase the bundle size too much. For example, right now we support reflection for DUs, Field, Types level (not the members, etc.). So perhaps, we could add the
Attributesinformation for the cases we currently support but for the members this means we need to evaluate if we can support them or not. Right the Reflection API of Fable can be removed by the bundlers if not used and we want to keep that I think.