Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX release] Deprecate {{unbound block and multi param usage. #12018

Merged
merged 1 commit into from
Aug 8, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 8, 2015

This directly targets the stable branch, as this functionality has been removed from beta and canary already.

mixonic added a commit that referenced this pull request Aug 8, 2015
[BUGFIX release] Deprecate `{{unbound` block and multi param usage.
@mixonic mixonic merged commit 95cec06 into emberjs:stable Aug 8, 2015
@mixonic mixonic deleted the deprecate-block-crap branch August 8, 2015 20:41
@workmanw
Copy link

workmanw commented Aug 9, 2015

So to be clear, is that this code snippet?

{{#unbound if isActive}}
  {{!-- Stuff --}}
{{/unbound}}

Is there an alternative? We actually got a good bit of performance from {{unbound}} because we had a lot of complicated read-only data.

@rwjblue
Copy link
Member Author

rwjblue commented Aug 9, 2015

@workmanw - Yes, exactly that type of usage is what is being deprecated. You should refactor to nested helper usage. Something like:

{{#if (unbound isActive)}}
  {{!-- Stuff --}}
{{/if}}

@workmanw
Copy link

workmanw commented Aug 9, 2015

@rwjblue Excellent. Thank you.

I've been seeing this helper/subexpression pattern more and more. Is there anywhere I can learn more about these and other changes? I fear that I would have missed this if I hadn't looked through the change log.

@rwjblue
Copy link
Member Author

rwjblue commented Aug 9, 2015

I've been seeing this helper/subexpression pattern more and more. Is there anywhere I can learn more about these and other changes?

Hmm, no. I am not aware of any specific articles or posts that are focused on nested helper (aka sub-expression) usage.

I fear that I would have missed this if I hadn't looked through the change log.

Awesome, I am glad the changelogs are getting more useful (since I started linking PR's)!

@workmanw
Copy link

workmanw commented Aug 9, 2015

Thanks for being awesome!

@mmun
Copy link
Member

mmun commented Aug 9, 2015

Don't use unbound for performance. It is slower in Glimmer and eventually will be removed.

@workmanw
Copy link

workmanw commented Aug 9, 2015

That's a bummer. It's really help us stave off performance issues.

Some background: we have several views that are read-only and based on polymorphic types. In one of our more complex views, we show up to 250 of these components at once, each component has 10 different possible renderings we used unbound because the type can never change and it reduces the binding/setup on the {{if}}s.

Eg:

{{#unbound if isTypeX}}
{{/unbound}}

{{#unbound if isTypeY}}
{{/unbound}}

// 8 more of these

So we found unbound cut the rendering time by like 35% for these components. Any suggestion on how to handle this in glimmer? There isn't much out of the box initial rendering performance yet that we've seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants