-
-
Save amk221/daec57f2d61263fee9eb8d64e0ed5f80 to your computer and use it in GitHub Desktop.
Glimmer 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { subscribe } from 'ember-instrumentation'; | |
import { bind } from 'ember-runloop'; | |
import EmberObject from 'ember-object'; | |
export default EmberObject.extend({ | |
init() { | |
this._super(...arguments); | |
subscribe('render.component', { | |
before: bind(this, '_before'), | |
after: bind(this, '_after') | |
}); | |
}, | |
_before(name, timestamp) { | |
return timestamp; | |
}, | |
_after(name, end, payload, start) { | |
let time = (end - start) / 1000; | |
console.log(name, time); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
init() { | |
this._super(...arguments); | |
console.time('my-component'); | |
}, | |
didInsertElement() { | |
this._super(...arguments); | |
console.timeEnd('my-component'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Glimmer', | |
init() { | |
this._super(...arguments); | |
this.set('times', []); | |
for (let i = 0; i < 1000; i++) { | |
this.get('times').push(i); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
import Metrics from './_metrics'; | |
// Ember.__loader.require('glimmer-util/lib/logger').default.level = 1; | |
// Metrics.create(); | |
const Router = Ember.Router.extend({ | |
location: 'none' | |
}); | |
Router.map(function() { | |
}); | |
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.8.1", | |
"EmberENV": { | |
"FEATURES": { | |
"ember-glimmer": true | |
} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "canary", | |
"ember-template-compiler": "canary" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment