Questions about compatibility with Fable 2
See original GitHub issueHi @humhei! Thanks again for all your work with ts2fable. Sorry, I haven’t followed all the latest conversations so I’d like to confirm a couple of points to make sure Fable 2 will be compatible with ts2fable:
-
Are you using classes to declare some JS types or only interfaces? In the past ts2fable used classes sometimes, but we talked about using only interfaces (with a separate interface for static methods if needed). Is this the case now? I’m asking because we’re considering to have a common base for all F# classes in Fable 2 which will produce slightly different runtime behavior than JS classes in some situations (equality, etc). /cc @ncave
-
The other question (actually not related to Fable 2) is about code generation. For Fable libraries we’re distinguishing between “pure bindings” (containing only type info and metadata) and libraries with actual code. For the former we only need a .dll file (which is faster to read by the F# compiler), but for the latter we also need the source files so the F# compiler can parse the AST and send it to Fable. I think ts2fable is generating some actual code now. Do you know in which situations? Maybe we can use some metadata instead (like
Emit
attributes) so we can use bindings generated by tsfable just in .dll form.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Might be the best approach, since fable-import isn’t using fable2 yet.
ts2fable
is (at this stage) only generating interfaces(clear pure bindings for invoking js codes by literal)Only interfaces
is useful for most cases but not for all cases (in my POV) Sometimes i have to manually define abstract class for type inherienceBut as your said these shouldn’t insurmountable obstacles So i think you should just go ahead @alfonsogarciacaro
I think considering this is too early as the performace of f# compiler is completely is ok for me