perf(compiler): +6% Pre-compute ViewFactories, styles for components.

This sped up the TreeComponent benchmark by 6%.

Closes #1134