Skip to content

Commit

Permalink
upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Feb 17, 2019
1 parent 9e3ca14 commit fc5f73f
Show file tree
Hide file tree
Showing 33 changed files with 19,124 additions and 154 deletions.
20 changes: 20 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
32 changes: 30 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,38 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
browser: true
},
rules: {
}
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.env*
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ install:
- yarn install --non-interactive

script:
- yarn lint:hbs
- yarn lint:js
- yarn test
15 changes: 6 additions & 9 deletions app/components/basic-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ import Ember from 'ember';

const {
select,
partition,
hierarchy,
min,
max,
range,
scaleLinear,
scaleQuantize,
cluster,
zoom,
zoomIdentity
} = self.d3;

const { run, get, inject } = Ember;
const { inject } = Ember;
import { run } from '@ember/runloop';
import { get } from '@ember/object';
import Component from '@ember/component';

const DURATION = 500;

Expand All @@ -26,7 +23,7 @@ const NODE_OFFSET_SIZE = 50;
// copied these functions temporarily from `broccoli-viz` here:
// https://github.com/ember-cli/broccoli-viz/blob/master/lib/node-by-id.js

export default Ember.Component.extend({
export default Component.extend({
classNames: ['basic-tree'],

graph: inject.service(),
Expand Down Expand Up @@ -281,7 +278,7 @@ export default Ember.Component.extend({
.attr("d", function(d) {
let sourceExitY = d.source.y + d.source.computedWidth + NODE_OFFSET_SIZE;
let targetEntranceY = d.target.y - NODE_OFFSET_SIZE;

return "M" + d.target.y + "," + d.target.x
+ "L" + targetEntranceY + "," + d.target.x
+ " " + sourceExitY + "," + d.target.x
Expand Down
11 changes: 8 additions & 3 deletions app/components/flame-graph.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import Ember from 'ember';
import FlameGraph from '../utils/d3-flame-graphs-v4/d3-flame-graph';

const { run, get, inject } = Ember;
import { run } from '@ember/runloop';
import { get } from '@ember/object';
import Component from '@ember/component';
import { readOnly } from '@ember/object/computed';

export default Ember.Component.extend({
const { inject } = Ember;

export default Component.extend({
classNames: ['flame-graph'],
graph: inject.service(),
flameGraph: null,
totalTime: Ember.computed.alias('graph.data.summary.totalTime'),
totalTime: readOnly('graph.data.summary.totalTime'),

init() {
this._super(...arguments);
Expand Down
10 changes: 5 additions & 5 deletions app/components/slow-node-times.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Ember from 'ember';
import { get, set } from '@ember/object';
import { computed } from '@ember/object';
import Component from '@ember/component';

const {
get,
set,
computed,
inject
} = Ember;

Expand Down Expand Up @@ -32,13 +32,13 @@ function computeNodeTimes(node) {
}
}

Ember.set(node._stats.time, 'plugin', total);
set(node._stats.time, 'plugin', total);

return total;
}


export default Ember.Component.extend({
export default Component.extend({
graph: inject.service(),

init() {
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Ember from 'ember';
import fetch from "fetch";
import Controller from '@ember/controller';

const {
inject
} = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
graph: inject.service(),

actions: {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/flame.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import Controller from '@ember/controller';

const {
Controller,
inject
} = Ember;

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/graph.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Ember from 'ember';
import Controller from '@ember/controller';
import { getOwner } from '@ember/application';
import { computed } from '@ember/object';

const {
Controller,
getOwner,
computed,
inject
} = Ember;

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/graph/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Ember from 'ember';
import Controller from '@ember/controller';

const {
inject
} = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
graph: inject.service()
});
3 changes: 2 additions & 1 deletion app/controllers/graph/node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Controller from '@ember/controller';
import Ember from 'ember';

const {
inject
} = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
graph: inject.service()
});
3 changes: 2 additions & 1 deletion app/controllers/selected-node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Ember from 'ember';
import Controller from '@ember/controller';

const {
inject
} = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
graph: inject.service()
})
3 changes: 2 additions & 1 deletion app/controllers/slow-nodes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Controller from '@ember/controller';
import Ember from 'ember';

const {
inject
} = Ember;

export default Ember.Controller.extend({
export default Controller.extend({
graph: inject.service(),

actions: {
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/includes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import { helper as buildHelper } from '@ember/component/helper';

export default Ember.Helper.helper(function([haystack, needle]) {
export default buildHelper(function([haystack, needle]) {
return haystack && haystack.includes && haystack.includes(needle);
});
4 changes: 2 additions & 2 deletions app/helpers/ns-to-ms.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import { helper as buildHelper } from '@ember/component/helper';

export function nsToMs([time]) {
return (time / 1000000).toFixed(2);
}

export default Ember.Helper.helper(nsToMs);
export default buildHelper(nsToMs);
4 changes: 2 additions & 2 deletions app/helpers/stats-iterator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import { helper as buildHelper } from '@ember/component/helper';

export default Ember.Helper.helper(function([node]) {
export default buildHelper(function([node]) {
let stats = {};

for (let [name, value] of node.statsIterator()) {
Expand Down
1 change: 0 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

{{content-for "head"}}

<script src="https://d3js.org/d3.v5.js"></script>
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/heimdalljs-visualizer.css">

Expand Down
9 changes: 3 additions & 6 deletions app/services/graph.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import Ember from 'ember';
import config from '../config/environment';
import heimdallGraph from 'heimdalljs-graph';

const {
getOwner
} = Ember;
import { getOwner } from '@ember/application';
import Service from '@ember/service';

const DATA_STORAGE_KEY = `${config.storageVersion}_graph-data`;
const SELECTED_NODE_STORAGE_KEY = `${config.storageVersion}_selected-node-id`;

export default Ember.Service.extend({
export default Service.extend({
init() {
this._super(...arguments);

Expand Down
Loading

0 comments on commit fc5f73f

Please sign in to comment.