Open Freymaurer opened 5 months ago
@Freymaurer Nice blogpost!
A small note, the default behavior of not attaching members to the class for JS/TS is done not just to allow member overloads, but mainly to allow the members to be tree-shaken by bundlers (if not used), and thus minimize bundle size.
Also, since interface implementation members are attached by default, implementing an interface would be another way to keep the members from being mangled and detached (although this doesn't work for static interface members yet, unless they have a default implementation).
That makes sense! Is there a way to allow tree shaking with attached members?
Thanks for the input!
@Freymaurer
Is there a way to allow tree shaking with attached members?
It was not possible in the past, that's why the default detached member behavior in Fable is like that.
(e.g. from an old rollup
article, "It doesn’t currently remove things like unused methods from objects that are used"
).
But things might have changed, you may have to check your bundler's documentation.
@Freymaurer
Really interesting blog post, and can serve as a basis if others want to explore use Fable and generating code to consume from Native languages.
Great job 👍
Hey, so i spent some time on a hobby project, in which i used Fable to create a library i published for python, js (+types), f# and c#.
In addition i wrote a blogpost about it on the issues i encountered, possible solutions and more.
If you are interested have a look here.