Skip to content

Instantly share code, notes, and snippets.

@adamjmcgrath
Last active August 12, 2017 00:19
Show Gist options
  • Save adamjmcgrath/d6644950e2755c960c6cddbbe07d78b4 to your computer and use it in GitHub Desktop.
Save adamjmcgrath/d6644950e2755c960c6cddbbe07d78b4 to your computer and use it in GitHub Desktop.
Ember partial memory leak
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
show: true,
version: Ember.VERSION,
actions: {
toggle() {
this.toggleProperty('show');
this.set('glimmerEnvStrings', Ember.getOwner(this).lookup('service:-glimmer-environment').constants.strings.length);
},
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<button {{action "toggle"}}>show/hide</button>
<br><br>
{{#if show}}
{{ partial "partial" }}
{{/if}}
<br>
<br>
<b>Ember Version</b>: {{version}}
<br>
<br>
<b>glimmerEnv.constants.strings.length</b>: {{glimmerEnvStrings}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "release",
"ember-template-compiler": "release",
"ember-testing": "release",
"ember-data": "2.12.1"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment