FsSpreadsheet icon indicating copy to clipboard operation
FsSpreadsheet copied to clipboard

[BUG] FsTable and FsRangeBase inerhitance fable issues

Open Freymaurer opened this issue 2 years ago • 5 comments

image

ColumnCount is part of the inheritance of FsRangeBase. Using this language construct the transpiled javascript code i not easily accessible FsRangeBase__ColumnCount(fstable). Maybe this needs some testing or must be refactored

Freymaurer avatar Jul 31 '23 07:07 Freymaurer

Is inheritance in general a problem for Fable? Or for JS? Must we replace all inheritance? @Freymaurer

omaus avatar Jul 31 '23 08:07 omaus

From what i see inerhitance does not work the same way in js. it is transpiled such that the code still works. but ColumnCount is not a member of FsTable, but of FsRangeBase. Js Syntax could be improved by adding "[<AttachMembers>]" to FsBaseRange, but i don't think this will make the fsrangebase members accessible from fstable.

Freymaurer avatar Jul 31 '23 08:07 Freymaurer

So if I understand you correctly, it is a must to have no inheritance in F# projects that you want to have transpiled to JS.

omaus avatar Jul 31 '23 09:07 omaus

AttachMembers would make it usable, albeit a bit unintuitive.

Freymaurer avatar Jul 31 '23 09:07 Freymaurer

Same question as in the other issue: Do we need these classes easily accessible? The frontend API should be designed in a way that you don't have to mingle with them.

HLWeil avatar Jul 31 '23 10:07 HLWeil