Created
December 13, 2018 19:15
-
-
Save sukima/17e52b6ef3de7b85f42b74c2a21ebed7 to your computer and use it in GitHub Desktop.
ember-perf broken
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 instanceInitializer from '../instance-initializers/monitor-perf'; | |
var EMBER_VERSION_REGEX = /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:(?:\-(alpha|beta)\.([0-9]+)(?:\.([0-9]+))?)?)?(?:\+(canary))?(?:\.([0-9abcdef]+))?(?:\-([A-Za-z0-9\.\-]+))?(?:\+([A-Za-z0-9\.\-]+))?$/; | |
/** | |
* VERSION_INFO[i] is as follows: | |
* | |
* 0 complete version string | |
* 1 major version | |
* 2 minor version | |
* 3 trivial version | |
* 4 pre-release type (optional: "alpha" or "beta" or undefined for stable releases) | |
* 5 pre-release version (optional) | |
* 6 pre-release sub-version (optional) | |
* 7 canary (optional: "canary", or undefined for stable releases) | |
* 8 SHA (optional) | |
*/ | |
var VERSION_INFO = EMBER_VERSION_REGEX.exec(Ember.VERSION); | |
export function initialize() { | |
const application = arguments[1] || arguments[0]; | |
const registry = !!arguments[1] ? arguments[0] : application.registry; | |
var isPre111 = parseInt(VERSION_INFO[1], 10) < 2 && parseInt(VERSION_INFO[2], 10) < 12; | |
const container = application.__container__; | |
if (isPre111) { | |
// For versions before 1.12.0, we have to call the instanceInitializer | |
instanceInitializer.initialize(registry, application); | |
} | |
} | |
export default { | |
name: 'monitor-perf', | |
initialize: initialize, | |
after: 'ember-perf-setup' | |
}; |
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
export function initialize(appInstance) { | |
// Must use appInstance per [issue #143](https://github.com/mike-north/ember-perf/issues/143) | |
let perfService = appInstance.lookup('service:ember-perf'); | |
perfService.on('transitionComplete', transitionData => { | |
console.log('transitionComplete', transitionData); | |
}); | |
perfService.on('renderComplete', transitionData => { | |
console.log('renderComplete', transitionData); | |
}); | |
} | |
export default { | |
name: 'monitor-perf-instance', | |
initialize | |
}; |
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 EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('foo'); | |
this.route('bar'); | |
this.route('baz'); | |
}); | |
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.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"ENV": { | |
"emberPerf": { | |
"injectionFactories": [] | |
} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2", | |
"ember-perf": "0.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment