Partial classes
Add support of partial classes. Mixins is not the same, because it's run-time realization. Need compile realization, where partial classes will be combine into one before converting typescript to javascript.
//FileA.ts
partial class ClassA
{
constructor(public name: string) {}
public sayHello(): string { return "hi!"; }
}
//FileB.ts
partial class ClassA
{
public sayBye(): string { return "by!"; }
}
will be:
partial class ClassA
{
constructor(public name: string) {}
public sayHello(): string { return "hi!"; }
public sayBye(): string { return "by!"; }
}
@aluanhaddad why do you keep making this out as a run-time thing? Module loaders and all that have nothing to do with transpiling.
+1
@cosmoKenney
@aluanhaddad why do you keep making this out as a run-time thing? Module loaders and all that have nothing to do with transpiling.
That is not correct.
Look at the SystemJS and Webpack ecosystems and you will see otherwise.
Even more traditional, and rock solid gulp workflows rely on the correspondence between input and output files.
+1
I need partial class because we are generating most of the base class using tools (to automate when there's a changes in the model). We then use partial class to add functionality to the class in a separate files so it won't be overwrite by the tool (that auto-generate the class).