ts-transform-inferno
ts-transform-inferno copied to clipboard
Idea: Auto optimize feature
Hi,
Lately I have been thinking that it would be cool, if we could automatically add optimization flags. Can we detect type information in this plugin?
For example if we have simple use case like this:
function translateText(): string {
return 'Okay!'
}
// Could we automatically flag this vNode with $HasTextChildren? because we know translateText always returns string
const div = <div>{translateText()}</div>;
This could be used for another vNode, numeric values, strings, nulls?. Lists might be problematic because there we need to know if its keyed or not.