Skip to content

Commit

Permalink
Avoid upgrading template if no hostProps, for better perf.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 10, 2019
1 parent b7c73bd commit 65a5b48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/utils/templatize.js
Expand Up @@ -364,7 +364,11 @@ function createTemplatizerClass(template, templateInfo, options) {
*/
function addPropagateEffects(template, templateInfo, options) {
let userForwardHostProp = options.forwardHostProp;
if (userForwardHostProp) {
const hasHostProps = templateInfo.hasHostProps ||
(templateInfo.hasHostProps =
Boolean(templateInfo.hostProps &&
Object.keys(templateInfo.hostProps).length));
if (userForwardHostProp && hasHostProps) {
// Provide data API and property effects on memoized template class
let klass = templateInfo.templatizeTemplateClass;
if (!klass) {
Expand Down

0 comments on commit 65a5b48

Please sign in to comment.