From 34a7567790e320540c3a41047984167175614c6c Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Thu, 22 Feb 2018 23:00:04 -0500 Subject: [PATCH] Start converting to module imports --- app/adapters/basic.js | 6 +++--- app/adapters/bookmarklet.js | 4 ++-- app/adapters/web-extension.js | 4 ++-- app/adapters/websocket.js | 6 +++--- app/app.js | 7 ++++--- app/components/action-checkbox.js | 3 +-- app/components/container-instance.js | 4 ++-- app/components/date-property-field.js | 4 ++-- app/components/deprecation-item-source.js | 6 +++--- app/components/deprecation-item.js | 5 ++--- app/components/drag-handle.js | 18 ++++++++++-------- app/components/draggable-column.js | 5 ++--- app/components/icon-button.js | 3 +-- app/components/iframe-picker.js | 8 +++++--- app/components/main-content.js | 6 ++++-- app/components/mixin-detail.js | 6 +++--- app/components/mixin-details.js | 3 +-- app/components/mixin-property.js | 6 +++--- app/components/object-inspector.js | 5 ++--- app/components/promise-item.js | 9 +++++---- app/components/property-field.js | 4 ++-- app/components/record-filter.js | 4 ++-- app/components/record-item.js | 6 ++++-- app/components/render-item.js | 10 +++++++--- app/components/resizable-column.js | 5 +++-- app/components/route-item.js | 5 +++-- app/components/send-to-console.js | 4 ++-- app/components/sidebar-toggle.js | 7 ++++--- app/components/view-item.js | 7 ++++--- app/components/x-app.js | 4 ++-- app/components/x-list-cell.js | 6 ++++-- app/components/x-list-content.js | 11 ++++++----- app/components/x-list.js | 13 ++++++------- app/computed/debounce.js | 4 ++-- app/controllers/application.js | 6 +++--- app/controllers/container-type.js | 6 +++--- app/controllers/container-types.js | 4 ++-- app/controllers/deprecations.js | 6 +++--- app/controllers/info.js | 3 +-- app/controllers/model-types.js | 8 ++++---- app/controllers/promise-tree.js | 10 +++++----- app/controllers/records.js | 14 +++++++------- app/controllers/render-tree.js | 10 +++++----- app/controllers/route-tree.js | 8 ++++---- app/controllers/view-tree.js | 7 ++++--- app/helpers/build-style.js | 5 +++-- app/helpers/escape-url.js | 3 +-- app/helpers/ms-to-time.js | 3 +-- app/helpers/one-way.js | 3 +-- app/helpers/schema-for.js | 5 +++-- app/libs/promise-assembler.js | 20 +++++++++++--------- app/libs/resizable-columns.js | 7 +++++-- app/mixins/row-events.js | 7 +++++-- app/models/promise.js | 13 ++++++++----- app/port.js | 6 +++--- app/router.js | 4 ++-- app/routes/app-detected.js | 5 +++-- app/routes/application.js | 12 +++++++----- app/routes/container-type.js | 5 ++--- app/routes/container-types.js | 4 ++-- app/routes/data/index.js | 6 +++--- app/routes/deprecations.js | 3 +-- app/routes/info.js | 6 ++---- app/routes/model-type.js | 9 +++++---- app/routes/model-types.js | 6 +++--- app/routes/promise-tree.js | 4 +--- app/routes/records.js | 4 +--- app/routes/render-tree.js | 4 +--- app/routes/route-tree.js | 3 +-- app/routes/tab.js | 4 ++-- app/routes/view-tree.js | 3 +-- app/services/layout.js | 5 +++-- app/services/storage/local.js | 5 +++-- app/services/storage/memory.js | 5 +++-- app/utils/search-match.js | 3 +-- package.json | 2 +- tests/acceptance/container-test.js | 12 ++++++++++-- tests/acceptance/data-test.js | 9 +++++---- tests/acceptance/deprecation-test.js | 4 ++-- tests/acceptance/info-test.js | 4 ++-- tests/acceptance/object-inspector-test.js | 13 ++++++++++--- tests/acceptance/promise-test.js | 4 ++-- tests/acceptance/render-tree-test.js | 12 +++++++++--- tests/acceptance/route-tree-test.js | 11 ++++++++--- tests/acceptance/view-tree-test.js | 14 ++++++++++---- tests/helpers/destroy-app.js | 4 ++-- tests/helpers/module-for-acceptance.js | 4 +--- tests/helpers/start-app.js | 10 +++++++--- tests/helpers/trigger-port.js | 4 ++-- yarn.lock | 2 +- 90 files changed, 312 insertions(+), 259 deletions(-) diff --git a/app/adapters/basic.js b/app/adapters/basic.js index 0d741da4c8..f5859a34cd 100644 --- a/app/adapters/basic.js +++ b/app/adapters/basic.js @@ -11,11 +11,11 @@ * }); * ``` */ -import Ember from "ember"; +import EmberObject, { computed } from '@ember/object'; + import config from 'ember-inspector/config/environment'; -const { computed } = Ember; -export default Ember.Object.extend({ +export default EmberObject.extend({ /** * Called when the adapter is created (when * the inspector app boots). diff --git a/app/adapters/bookmarklet.js b/app/adapters/bookmarklet.js index aacd226f41..08c28c1451 100644 --- a/app/adapters/bookmarklet.js +++ b/app/adapters/bookmarklet.js @@ -1,7 +1,7 @@ /* eslint no-useless-escape: 0 */ +import { computed } from '@ember/object'; + import BasicAdapter from "./basic"; -import Ember from 'ember'; -const { computed } = Ember; export default BasicAdapter.extend({ name: 'bookmarklet', diff --git a/app/adapters/web-extension.js b/app/adapters/web-extension.js index 923f06a8cd..64219e24d2 100644 --- a/app/adapters/web-extension.js +++ b/app/adapters/web-extension.js @@ -1,8 +1,8 @@ /* globals chrome */ +import { computed } from '@ember/object'; + import BasicAdapter from "./basic"; -import Ember from 'ember'; import config from 'ember-inspector/config/environment'; -const { computed } = Ember; let emberDebug = null; diff --git a/app/adapters/websocket.js b/app/adapters/websocket.js index 3dce8cb26b..ad032eca34 100644 --- a/app/adapters/websocket.js +++ b/app/adapters/websocket.js @@ -1,6 +1,6 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; +import { computed } from '@ember/object'; import BasicAdapter from "./basic"; -const { computed } = Ember; export default BasicAdapter.extend({ init() { @@ -17,7 +17,7 @@ export default BasicAdapter.extend({ _connect() { this.get('socket').on('emberInspectorMessage', message => { - Ember.run(() => { + run(() => { this._messageReceived(message); }); }); diff --git a/app/app.js b/app/app.js index 061e7593ec..1b26adf894 100644 --- a/app/app.js +++ b/app/app.js @@ -1,4 +1,5 @@ -import Ember from 'ember'; +import { typeOf } from '@ember/utils'; +import Application from '@ember/application'; import Resolver from './resolver'; import loadInitializers from 'ember-load-initializers'; import config from './config/environment'; @@ -7,7 +8,7 @@ import PromiseAssembler from "ember-inspector/libs/promise-assembler"; const version = '{{EMBER_INSPECTOR_VERSION}}'; -const App = Ember.Application.extend({ +const App = Application.extend({ modulePrefix: config.modulePrefix, podModulePrefix: config.podModulePrefix, Resolver @@ -39,7 +40,7 @@ App.initializer({ // register and inject adapter let Adapter; - if (Ember.typeOf(instance.adapter) === 'string') { + if (typeOf(instance.adapter) === 'string') { Adapter = instance.resolveRegistration(`adapter:${instance.adapter}`); } else { Adapter = instance.adapter; diff --git a/app/components/action-checkbox.js b/app/components/action-checkbox.js index 9705e98ed1..74b2a3b0af 100644 --- a/app/components/action-checkbox.js +++ b/app/components/action-checkbox.js @@ -1,5 +1,4 @@ -import Ember from 'ember'; -const { Component } = Ember; +import Component from '@ember/component'; export default Component.extend({ tagName: 'input', diff --git a/app/components/container-instance.js b/app/components/container-instance.js index bf025babd0..e6b594b6a0 100644 --- a/app/components/container-instance.js +++ b/app/components/container-instance.js @@ -7,9 +7,9 @@ * * Since it has no tag it has no effect on the DOM hierarchy. */ -import Ember from 'ember'; +import Component from '@ember/component'; + import RowEventsMixin from 'ember-inspector/mixins/row-events'; -const { Component } = Ember; export default Component.extend(RowEventsMixin, { /** * No tag diff --git a/app/components/date-property-field.js b/app/components/date-property-field.js index d88cf9988d..8c6afa1014 100644 --- a/app/components/date-property-field.js +++ b/app/components/date-property-field.js @@ -1,6 +1,6 @@ -import Ember from "ember"; +import { on } from '@ember/object/evented'; +import { once } from '@ember/runloop'; import DatePicker from "ember-inspector/components/pikaday-input"; -const { on, run: { once } } = Ember; const KEY_EVENTS = { escape: 27 }; diff --git a/app/components/deprecation-item-source.js b/app/components/deprecation-item-source.js index 964a4e1648..90b1c24e0b 100644 --- a/app/components/deprecation-item-source.js +++ b/app/components/deprecation-item-source.js @@ -1,6 +1,6 @@ -import Ember from 'ember'; -const { Component, computed } = Ember; -const { bool, readOnly, and } = computed; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { bool, readOnly, and } from '@ember/object/computed'; export default Component.extend({ /** diff --git a/app/components/deprecation-item.js b/app/components/deprecation-item.js index 481112b0f8..ecd66a0be5 100644 --- a/app/components/deprecation-item.js +++ b/app/components/deprecation-item.js @@ -1,6 +1,5 @@ -import Ember from "ember"; -const { Component, computed } = Ember; -const { notEmpty } = computed; +import Component from '@ember/component'; +import { notEmpty } from '@ember/object/computed'; export default Component.extend({ isExpanded: true, diff --git a/app/components/drag-handle.js b/app/components/drag-handle.js index b6718cbc59..8c25a2fbf9 100644 --- a/app/components/drag-handle.js +++ b/app/components/drag-handle.js @@ -1,15 +1,17 @@ -import Ember from "ember"; +import $ from 'jquery'; +import { equal } from '@ember/object/computed'; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; -const { computed, String: { htmlSafe } } = Ember; - -export default Ember.Component.extend({ +export default Component.extend({ classNames: ['drag-handle'], classNameBindings: ['isLeft:drag-handle--left', 'isRight:drag-handle--right', 'faded:drag-handle--faded'], attributeBindings: ['style'], position: 0, side: '', - isRight: Ember.computed.equal('side', 'right'), - isLeft: Ember.computed.equal('side', 'left'), + isRight: equal('side', 'right'), + isLeft: equal('side', 'left'), minWidth: 60, /** @@ -56,7 +58,7 @@ export default Ember.Component.extend({ this.sendAction('action', true); - Ember.$('body').on(`mousemove.${namespace}`, e => { + $('body').on(`mousemove.${namespace}`, e => { let position = this.get('isLeft') ? e.pageX - $containerOffsetLeft : $containerOffsetRight - e.pageX; @@ -74,7 +76,7 @@ export default Ember.Component.extend({ stopDragging() { this.sendAction('action', false); - Ember.$('body').off(`.drag-${this.get('elementId')}`); + $('body').off(`.drag-${this.get('elementId')}`); }, willDestroyElement() { diff --git a/app/components/draggable-column.js b/app/components/draggable-column.js index 373acb04fb..79e56a1c68 100644 --- a/app/components/draggable-column.js +++ b/app/components/draggable-column.js @@ -2,9 +2,8 @@ // =============== // A wrapper for a resizable-column and a drag-handle component -import Ember from "ember"; -const { Component, inject } = Ember; -const { service } = inject; +import Component from '@ember/component'; +import { inject as service } from '@ember/service'; export default Component.extend({ tagName: '', // Prevent wrapping in a div diff --git a/app/components/icon-button.js b/app/components/icon-button.js index ee42d074d5..b79170a963 100644 --- a/app/components/icon-button.js +++ b/app/components/icon-button.js @@ -1,5 +1,4 @@ -import Ember from "ember"; -const { Component } = Ember; +import Component from '@ember/component'; export default Component.extend({ attributeBindings: ['title'], diff --git a/app/components/iframe-picker.js b/app/components/iframe-picker.js index e186947979..043fe4f8eb 100644 --- a/app/components/iframe-picker.js +++ b/app/components/iframe-picker.js @@ -1,6 +1,8 @@ -import Ember from "ember"; -const { Component, computed, run, observer, getOwner } = Ember; -const { alias } = computed; +import Component from '@ember/component'; +import { run } from '@ember/runloop'; +import { observer, computed } from '@ember/object'; +import { getOwner } from '@ember/application'; +import { alias } from '@ember/object/computed'; export default Component.extend({ model: computed('port.detectedApplications.[]', function() { diff --git a/app/components/main-content.js b/app/components/main-content.js index 0bb4418efd..82ea6032e4 100644 --- a/app/components/main-content.js +++ b/app/components/main-content.js @@ -1,5 +1,7 @@ -import Ember from "ember"; -const { Component, run: { schedule }, $, inject: { service } } = Ember; +import Component from '@ember/component'; +import { schedule } from '@ember/runloop'; +import $ from 'jquery'; +import { inject as service } from '@ember/service'; import { task, timeout } from 'ember-concurrency'; // Currently used to determine the height of list-views diff --git a/app/components/mixin-detail.js b/app/components/mixin-detail.js index 4a2e0b4459..d0eb50c77f 100644 --- a/app/components/mixin-detail.js +++ b/app/components/mixin-detail.js @@ -1,6 +1,6 @@ -import Ember from "ember"; -const { computed, Component } = Ember; -const { readOnly, sort } = computed; +import { computed } from '@ember/object'; +import Component from '@ember/component'; +import { readOnly, sort } from '@ember/object/computed'; export default Component.extend({ /** diff --git a/app/components/mixin-details.js b/app/components/mixin-details.js index 6eee69fad5..4fdc753e98 100644 --- a/app/components/mixin-details.js +++ b/app/components/mixin-details.js @@ -1,5 +1,4 @@ -import Ember from "ember"; -const { Component } = Ember; +import Component from '@ember/component'; export default Component.extend({ actions: { traceErrors() { diff --git a/app/components/mixin-property.js b/app/components/mixin-property.js index 464dc60e3d..27954c2dc1 100644 --- a/app/components/mixin-property.js +++ b/app/components/mixin-property.js @@ -1,6 +1,6 @@ -import Ember from "ember"; -const { computed, Component } = Ember; -const { equal, alias } = computed; +import { computed } from '@ember/object'; +import Component from '@ember/component'; +import { equal, alias } from '@ember/object/computed'; export default Component.extend({ isEdit: false, diff --git a/app/components/object-inspector.js b/app/components/object-inspector.js index 6610877b63..9ae2d9dc12 100644 --- a/app/components/object-inspector.js +++ b/app/components/object-inspector.js @@ -1,6 +1,5 @@ -import Ember from "ember"; -const { Component, computed } = Ember; -const get = Ember.get; +import Component from '@ember/component'; +import { computed, get } from '@ember/object'; export default Component.extend({ tagName: '', diff --git a/app/components/promise-item.js b/app/components/promise-item.js index bdcf822906..c24a6e4253 100644 --- a/app/components/promise-item.js +++ b/app/components/promise-item.js @@ -1,7 +1,8 @@ -import Ember from "ember"; - -const { Component, computed, String: { htmlSafe }, isEmpty } = Ember; -const { notEmpty, gt, equal } = computed; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; +import { isEmpty } from '@ember/utils'; +import { notEmpty, gt, equal } from '@ember/object/computed'; const COLOR_MAP = { red: '#ff2717', diff --git a/app/components/property-field.js b/app/components/property-field.js index 8eaabc746f..0e117400f8 100644 --- a/app/components/property-field.js +++ b/app/components/property-field.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -export default Ember.TextField.extend({ +import TextField from '@ember/component/text-field'; +export default TextField.extend({ attributeBindings: ['label:data-label'], /** diff --git a/app/components/record-filter.js b/app/components/record-filter.js index fc26c61d68..437e73f245 100644 --- a/app/components/record-filter.js +++ b/app/components/record-filter.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -const { computed, Component } = Ember; +import { computed } from '@ember/object'; +import Component from '@ember/component'; export default Component.extend({ filterValue: null, checked: computed('filterValue', 'model.name', function() { diff --git a/app/components/record-item.js b/app/components/record-item.js index 93a57a6469..32314f717d 100644 --- a/app/components/record-item.js +++ b/app/components/record-item.js @@ -1,6 +1,8 @@ -import Ember from 'ember'; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; +import { isEmpty } from '@ember/utils'; import RowEventsMixin from 'ember-inspector/mixins/row-events'; -const { Component, computed, String: { htmlSafe }, isEmpty } = Ember; const COLOR_MAP = { red: '#ff2717', blue: '#174fff', diff --git a/app/components/render-item.js b/app/components/render-item.js index 715f92c7b1..aea5d32e6b 100644 --- a/app/components/render-item.js +++ b/app/components/render-item.js @@ -1,8 +1,12 @@ -import Ember from 'ember'; +import Component from '@ember/component'; +import { isNone, isEmpty } from '@ember/utils'; +import { run } from '@ember/runloop'; +import { on } from '@ember/object/evented'; +import { observer, computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; import escapeRegExp from "ember-inspector/utils/escape-reg-exp"; -const { Component, computed, isEmpty, isNone, run, on, observer, String: { htmlSafe } } = Ember; -const { gt } = computed; +import { gt } from '@ember/object/computed'; const { once } = run; export default Component.extend({ diff --git a/app/components/resizable-column.js b/app/components/resizable-column.js index 475103390f..6781862581 100644 --- a/app/components/resizable-column.js +++ b/app/components/resizable-column.js @@ -1,5 +1,6 @@ -import Ember from "ember"; -const { Component, computed, String: { htmlSafe } } = Ember; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; export default Component.extend({ width: null, diff --git a/app/components/route-item.js b/app/components/route-item.js index b9b2b60f7d..f9a7ce1a31 100644 --- a/app/components/route-item.js +++ b/app/components/route-item.js @@ -1,6 +1,7 @@ -import Ember from 'ember'; +import Component from '@ember/component'; +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; import checkCurrentRoute from "ember-inspector/utils/check-current-route"; -const { Component, computed, String: { htmlSafe } } = Ember; export default Component.extend({ // passed as an attribute to the component diff --git a/app/components/send-to-console.js b/app/components/send-to-console.js index 3256d0d24c..c07750f09b 100644 --- a/app/components/send-to-console.js +++ b/app/components/send-to-console.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -export default Ember.Component.extend({ +import Component from '@ember/component'; +export default Component.extend({ tagName: 'button', classNames: ['send-to-console', 'js-send-to-console-btn'], action: 'sendValueToConsole', diff --git a/app/components/sidebar-toggle.js b/app/components/sidebar-toggle.js index 770d5abf30..da4811a80b 100644 --- a/app/components/sidebar-toggle.js +++ b/app/components/sidebar-toggle.js @@ -1,5 +1,6 @@ -import Ember from "ember"; -export default Ember.Component.extend({ +import { equal } from '@ember/object/computed'; +import Component from '@ember/component'; +export default Component.extend({ tagName: 'button', @@ -7,7 +8,7 @@ export default Ember.Component.extend({ isExpanded: false, - isRight: Ember.computed.equal('side', 'right'), + isRight: equal('side', 'right'), classNames: 'sidebar-toggle', diff --git a/app/components/view-item.js b/app/components/view-item.js index 29f92c8a5c..2aa869709c 100644 --- a/app/components/view-item.js +++ b/app/components/view-item.js @@ -1,7 +1,8 @@ -import Ember from "ember"; +import { computed } from '@ember/object'; +import Component from '@ember/component'; +import { htmlSafe } from '@ember/string'; import RowEventsMixin from 'ember-inspector/mixins/row-events'; -const { computed, Component, String: { htmlSafe } } = Ember; -const { not, bool, equal } = computed; +import { not, bool, equal } from '@ember/object/computed'; export default Component.extend(RowEventsMixin, { /** diff --git a/app/components/x-app.js b/app/components/x-app.js index ff5c76c3fa..8247b2f846 100644 --- a/app/components/x-app.js +++ b/app/components/x-app.js @@ -1,5 +1,5 @@ -import Ember from 'ember'; -const { Component, computed: { not } } = Ember; +import Component from '@ember/component'; +import { not } from '@ember/object/computed'; export default Component.extend({ classNames: ['app'], diff --git a/app/components/x-list-cell.js b/app/components/x-list-cell.js index 7d38a1773d..d4d1072fdf 100644 --- a/app/components/x-list-cell.js +++ b/app/components/x-list-cell.js @@ -14,8 +14,10 @@ * {{/xlist}} * ``` */ -import Ember from 'ember'; -const { Component, computed, String: { htmlSafe } } = Ember; +import Component from '@ember/component'; + +import { computed } from '@ember/object'; +import { htmlSafe } from '@ember/string'; export default Component.extend({ /** * Defaults to a table cell. For headers diff --git a/app/components/x-list-content.js b/app/components/x-list-content.js index 74ca8954a9..efb0f8f057 100644 --- a/app/components/x-list-content.js +++ b/app/components/x-list-content.js @@ -1,8 +1,9 @@ -import Ember from 'ember'; - -const { Component, computed, String: { htmlSafe }, Evented, run, Object: EmberObject, inject } = Ember; -const { schedule } = run; -const { service } = inject; +import Component from '@ember/component'; +import { htmlSafe } from '@ember/string'; +import Evented from '@ember/object/evented'; +import EmberObject, { computed } from '@ember/object'; +import { run, schedule } from '@ember/runloop'; +import { inject as service } from '@ember/service'; /** * Base list view config diff --git a/app/components/x-list.js b/app/components/x-list.js index d90b611601..ec4fcd6466 100644 --- a/app/components/x-list.js +++ b/app/components/x-list.js @@ -1,12 +1,11 @@ -import Ember from 'ember'; +import Component from '@ember/component'; +import { run, scheduleOnce } from '@ember/runloop'; +import $ from 'jquery'; import { task, timeout } from 'ember-concurrency'; import ResizableColumns from 'ember-inspector/libs/resizable-columns'; import LocalStorageService from "ember-inspector/services/storage/local"; - -const { Component, run, computed, inject, $ } = Ember; -const { scheduleOnce } = run; -const { service } = inject; -const { readOnly, reads } = computed; +import { inject as service } from '@ember/service'; +import { readOnly, reads } from '@ember/object/computed'; const CHECK_HTML = '✓'; @@ -208,7 +207,7 @@ export default Component.extend({ * @method willDestroyElement */ willDestroyElement() { - Ember.$(window).off(`.${this.get('elementId')}`); + $(window).off(`.${this.get('elementId')}`); this.$('.list__header').contextMenu('destroy'); this.get('layout').off('resize', this.onResize); return this._super(...arguments); diff --git a/app/computed/debounce.js b/app/computed/debounce.js index 5d46d9faaa..30ecd9c4a6 100644 --- a/app/computed/debounce.js +++ b/app/computed/debounce.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -const { run, computed } = Ember; +import { run } from '@ember/runloop'; +import { computed } from '@ember/object'; const { debounce } = run; // Use this if you want a property to debounce diff --git a/app/controllers/application.js b/app/controllers/application.js index 0469c3f020..78d0273e9d 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -1,6 +1,6 @@ -import Ember from "ember"; - -const { Controller, computed, computed: { equal } } = Ember; +import Controller from '@ember/controller'; +import { computed } from '@ember/object'; +import { equal } from '@ember/object/computed'; export default Controller.extend({ isDragging: false, diff --git a/app/controllers/container-type.js b/app/controllers/container-type.js index 728358982f..bd7c1b96c0 100644 --- a/app/controllers/container-type.js +++ b/app/controllers/container-type.js @@ -1,8 +1,8 @@ -import Ember from "ember"; +import { get } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; import debounceComputed from "ember-inspector/computed/debounce"; import searchMatch from "ember-inspector/utils/search-match"; -const { Controller, computed, get, inject: { controller } } = Ember; -const { filter } = computed; +import { filter } from '@ember/object/computed'; export default Controller.extend({ application: controller(), diff --git a/app/controllers/container-types.js b/app/controllers/container-types.js index 72c3e591d6..078203ab4a 100644 --- a/app/controllers/container-types.js +++ b/app/controllers/container-types.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -const { Controller, computed: { sort } } = Ember; +import Controller from '@ember/controller'; +import { sort } from '@ember/object/computed'; export default Controller.extend({ sortProperties: ['name'], diff --git a/app/controllers/deprecations.js b/app/controllers/deprecations.js index 49df892e78..3294947180 100644 --- a/app/controllers/deprecations.js +++ b/app/controllers/deprecations.js @@ -1,8 +1,8 @@ -import Ember from "ember"; +import { get } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; import debounceComputed from "ember-inspector/computed/debounce"; import searchMatch from "ember-inspector/utils/search-match"; -const { Controller, computed, get, inject: { controller } } = Ember; -const { filter } = computed; +import { filter } from '@ember/object/computed'; export default Controller.extend({ /** diff --git a/app/controllers/info.js b/app/controllers/info.js index 04be86f88b..39983f6f09 100644 --- a/app/controllers/info.js +++ b/app/controllers/info.js @@ -1,5 +1,4 @@ -import Ember from 'ember'; -const { Controller, inject: { controller } } = Ember; +import Controller, { inject as controller } from '@ember/controller'; export default Controller.extend({ application: controller() diff --git a/app/controllers/model-types.js b/app/controllers/model-types.js index 706e31ab7e..dc385db98c 100644 --- a/app/controllers/model-types.js +++ b/app/controllers/model-types.js @@ -1,8 +1,8 @@ -import Ember from 'ember'; +import Controller, { inject as controller } from '@ember/controller'; +import { get, computed } from '@ember/object'; import LocalStorageService from 'ember-inspector/services/storage/local'; -const { Controller, computed, get, inject } = Ember; -const { sort } = computed; -const { controller, service } = inject; +import { sort } from '@ember/object/computed'; +import { inject as service } from '@ember/service'; export default Controller.extend({ application: controller(), diff --git a/app/controllers/promise-tree.js b/app/controllers/promise-tree.js index 18d7a30228..31a7f3921f 100644 --- a/app/controllers/promise-tree.js +++ b/app/controllers/promise-tree.js @@ -1,8 +1,8 @@ -import Ember from "ember"; - -const { Controller, computed, observer, run, inject: { controller }, isEmpty } = Ember; -const { equal, bool, and, not, filter } = computed; -const { next, once, debounce } = run; +import { observer } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; +import { isEmpty } from '@ember/utils'; +import { equal, bool, and, not, filter } from '@ember/object/computed'; +import { debounce, next, once } from '@ember/runloop'; export default Controller.extend({ application: controller(), diff --git a/app/controllers/records.js b/app/controllers/records.js index 98e2360841..55c87a5a37 100644 --- a/app/controllers/records.js +++ b/app/controllers/records.js @@ -1,9 +1,9 @@ -import Ember from "ember"; +import { isEmpty } from '@ember/utils'; +import { observer, computed, get } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; import escapeRegExp from "ember-inspector/utils/escape-reg-exp"; -const { Controller, computed, observer, inject: { controller }, String } = Ember; -const { none, readOnly } = computed; -const { dasherize } = String; -const get = Ember.get; +import { none, readOnly } from '@ember/object/computed'; +import { dasherize } from '@ember/string'; export default Controller.extend({ application: controller(), @@ -82,7 +82,7 @@ export default Controller.extend({ } // check search - if (!Ember.isEmpty(search)) { + if (!isEmpty(search)) { let searchString = this.recordToString(item); return !!searchString.match(new RegExp(`.*${escapeRegExp(search.toLowerCase())}.*`)); } @@ -110,7 +110,7 @@ export default Controller.extend({ * @property {Object} */ inspectModel(model) { - this.get('port').send('data:inspectModel', { objectId: Ember.get(model, 'objectId') }); + this.get('port').send('data:inspectModel', { objectId: get(model, 'objectId') }); } } }); diff --git a/app/controllers/render-tree.js b/app/controllers/render-tree.js index cc3e153aa1..bfcc43100d 100644 --- a/app/controllers/render-tree.js +++ b/app/controllers/render-tree.js @@ -1,11 +1,11 @@ -import Ember from "ember"; +import { computed, get } from '@ember/object'; +import { isEmpty } from '@ember/utils'; +import Controller, { inject as controller } from '@ember/controller'; +import { inject as service } from '@ember/service'; import escapeRegExp from "ember-inspector/utils/escape-reg-exp"; import debounceComputed from "ember-inspector/computed/debounce"; import LocalStorageService from "ember-inspector/services/storage/local"; - -const { computed, isEmpty, Controller, inject: { controller, service } } = Ember; -const { and, equal, filter } = computed; -const get = Ember.get; +import { and, equal, filter } from '@ember/object/computed'; export default Controller.extend({ application: controller(), diff --git a/app/controllers/route-tree.js b/app/controllers/route-tree.js index dfaabef7a3..a6619826c8 100644 --- a/app/controllers/route-tree.js +++ b/app/controllers/route-tree.js @@ -1,15 +1,15 @@ -import Ember from "ember"; +import { alias } from '@ember/object/computed'; +import { computed } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; import checkCurrentRoute from "ember-inspector/utils/check-current-route"; -const { Controller, computed, inject: { controller } } = Ember; - export default Controller.extend({ application: controller(), queryParams: ['hideRoutes'], currentRoute: null, - hideRoutes: computed.alias('options.hideRoutes'), + hideRoutes: alias('options.hideRoutes'), options: { hideRoutes: false diff --git a/app/controllers/view-tree.js b/app/controllers/view-tree.js index 61aa670651..1a7f4d747f 100644 --- a/app/controllers/view-tree.js +++ b/app/controllers/view-tree.js @@ -1,7 +1,8 @@ -import Ember from "ember"; +import { on } from '@ember/object/evented'; +import { observer, get } from '@ember/object'; +import Controller, { inject as controller } from '@ember/controller'; import searchMatch from "ember-inspector/utils/search-match"; -const { computed, Controller, get, on, observer, inject: { controller } } = Ember; -const { alias, filter } = computed; +import { alias, filter } from '@ember/object/computed'; export default Controller.extend({ application: controller(), diff --git a/app/helpers/build-style.js b/app/helpers/build-style.js index 67d3db45f9..9d60a5656b 100644 --- a/app/helpers/build-style.js +++ b/app/helpers/build-style.js @@ -8,8 +8,9 @@ * @param {Object} options The options that become styles * @return {String} The style sting. */ -import Ember from 'ember'; -const { Helper: { helper }, String: { htmlSafe } } = Ember; +import { helper } from '@ember/component/helper'; + +import { htmlSafe } from '@ember/string'; const { keys } = Object; export function buildStyle(_, options) { diff --git a/app/helpers/escape-url.js b/app/helpers/escape-url.js index 8713675c71..acd2952f8a 100644 --- a/app/helpers/escape-url.js +++ b/app/helpers/escape-url.js @@ -1,5 +1,4 @@ -import Ember from 'ember'; -const { Helper: { helper } } = Ember; +import { helper } from '@ember/component/helper'; /** * Escape a url component * diff --git a/app/helpers/ms-to-time.js b/app/helpers/ms-to-time.js index 659b50f217..8491ae402e 100644 --- a/app/helpers/ms-to-time.js +++ b/app/helpers/ms-to-time.js @@ -1,5 +1,4 @@ -import Ember from 'ember'; -const { Helper: { helper } } = Ember; +import { helper } from '@ember/component/helper'; export function msToTime([time]) { if (time && !isNaN(+time)) { diff --git a/app/helpers/one-way.js b/app/helpers/one-way.js index 6dfa5a21f7..515ce164c1 100644 --- a/app/helpers/one-way.js +++ b/app/helpers/one-way.js @@ -6,8 +6,7 @@ * @param {Array} [val] The array containing one value. * @return {Any} The value passed */ -import Ember from 'ember'; -const { Helper: { helper } } = Ember; +import { helper } from '@ember/component/helper'; export function oneWay([val]) { return val; diff --git a/app/helpers/schema-for.js b/app/helpers/schema-for.js index a6d6d59aeb..f4b8a1987f 100644 --- a/app/helpers/schema-for.js +++ b/app/helpers/schema-for.js @@ -7,8 +7,9 @@ * @param {Array} [name] First element is the name of the schema * @return {Object} The schema */ -import Ember from 'ember'; -const { Helper, getOwner } = Ember; +import Helper from '@ember/component/helper'; + +import { getOwner } from '@ember/application'; export default Helper.extend({ compute([name]) { return getOwner(this).resolveRegistration(`schema:${name}`); diff --git a/app/libs/promise-assembler.js b/app/libs/promise-assembler.js index 8b1fcd0e4e..6a500b3b00 100644 --- a/app/libs/promise-assembler.js +++ b/app/libs/promise-assembler.js @@ -1,17 +1,19 @@ -import Ember from "ember"; +import { assert } from '@ember/debug'; +import { copy } from '@ember/object/internals'; +import { later } from '@ember/runloop'; +import EmberObject, { computed } from '@ember/object'; +import EventedMixin from '@ember/object/evented'; import Promise from "ember-inspector/models/promise"; -let EventedMixin = Ember.Evented; - -let arrayComputed = Ember.computed(function() { +let arrayComputed = computed(function() { return []; }); -let objectComputed = Ember.computed(function() { +let objectComputed = computed(function() { return {}; }); -export default Ember.Object.extend(EventedMixin, { +export default EmberObject.extend(EventedMixin, { all: arrayComputed, topSort: arrayComputed, topSortMeta: objectComputed, @@ -43,7 +45,7 @@ export default Ember.Object.extend(EventedMixin, { // Lazily destroy promises // Allows for a smooth transition on deactivate, // and thus providing the illusion of better perf - Ember.run.later(this, function() { + later(this, function() { this.destroyPromises(all); }, 500); this.set('all', []); @@ -66,7 +68,7 @@ export default Ember.Object.extend(EventedMixin, { rebuildPromises(promises) { promises.forEach(props => { - props = Ember.copy(props); + props = copy(props); let childrenIds = props.children; let parentId = props.parent; delete props.children; @@ -161,7 +163,7 @@ export default Ember.Object.extend(EventedMixin, { findOrCreate(guid) { if (!guid) { - Ember.assert('You have tried to findOrCreate without a guid'); + assert('You have tried to findOrCreate without a guid'); } return this.find(guid) || this.createPromise({ guid }); } diff --git a/app/libs/resizable-columns.js b/app/libs/resizable-columns.js index 027c7f1668..ef611e0bab 100644 --- a/app/libs/resizable-columns.js +++ b/app/libs/resizable-columns.js @@ -4,9 +4,12 @@ * * Uses local storage to cache a user's preferred settings. */ -import Ember from 'ember'; +import { set } from '@ember/object'; + +import { isNone } from '@ember/utils'; +import { copy } from '@ember/object/internals'; +import { merge } from '@ember/polyfills'; import compareArrays from 'ember-inspector/utils/compare-arrays'; -const { set, isNone, copy, merge } = Ember; const { floor } = Math; const { keys } = Object; const THIRTY_DAYS_FROM_NOW = 1000 * 60 * 60 * 24 * 30; diff --git a/app/mixins/row-events.js b/app/mixins/row-events.js index 46561aa7a2..84b1610c0e 100644 --- a/app/mixins/row-events.js +++ b/app/mixins/row-events.js @@ -6,8 +6,11 @@ * the yielded `x-list` and index to it. Then you'll be able to listen * to events on `rowEvents`. */ -import Ember from 'ember'; -const { Mixin, assert, isNone, computed: { readOnly } } = Ember; +import Mixin from '@ember/object/mixin'; + +import { assert } from '@ember/debug'; +import { isNone } from '@ember/utils'; +import { readOnly } from '@ember/object/computed'; export default Mixin.create({ /** diff --git a/app/models/promise.js b/app/models/promise.js index 90fa5215e0..2377598b72 100644 --- a/app/models/promise.js +++ b/app/models/promise.js @@ -1,6 +1,9 @@ -import Ember from "ember"; +import { once } from '@ember/runloop'; +import $ from 'jquery'; +import { typeOf, isEmpty } from '@ember/utils'; +import EmberObject, { computed, observer } from '@ember/object'; +import { not, equal, or } from '@ember/object/computed'; import escapeRegExp from "ember-inspector/utils/escape-reg-exp"; -const { $, observer, typeOf, computed, computed: { or, equal, not } } = Ember; const dateComputed = function() { return computed({ @@ -18,7 +21,7 @@ const dateComputed = function() { }); }; -export default Ember.Object.extend({ +export default EmberObject.extend({ createdAt: dateComputed(), settledAt: dateComputed(), @@ -95,7 +98,7 @@ export default Ember.Object.extend({ }), addBranchLabel(label, replace) { - if (Ember.isEmpty(label)) { + if (isEmpty(label)) { return; } if (replace) { @@ -131,7 +134,7 @@ export default Ember.Object.extend({ stateOrParentChanged: observer('isPending', 'isFulfilled', 'isRejected', 'parent', function() { let parent = this.get('parent'); if (parent) { - Ember.run.once(parent, 'recalculateExpanded'); + once(parent, 'recalculateExpanded'); } }), diff --git a/app/port.js b/app/port.js index 1ef9886e93..057bf9b5dd 100644 --- a/app/port.js +++ b/app/port.js @@ -1,7 +1,7 @@ -import Ember from "ember"; -const { computed } = Ember; +import Evented from '@ember/object/evented'; +import EmberObject, { computed } from '@ember/object'; -export default Ember.Object.extend(Ember.Evented, { +export default EmberObject.extend(Evented, { applicationId: undefined, detectedApplications: computed(function() { diff --git a/app/router.js b/app/router.js index 1b4b4ff92e..e1b3e6c557 100644 --- a/app/router.js +++ b/app/router.js @@ -1,7 +1,7 @@ -import Ember from 'ember'; +import EmberRouter from '@ember/routing/router'; import config from './config/environment'; -const Router = Ember.Router.extend({ +const Router = EmberRouter.extend({ location: config.locationType, rootURL: config.rootURL }); diff --git a/app/routes/app-detected.js b/app/routes/app-detected.js index b1aa56281b..6fdaca43ba 100644 --- a/app/routes/app-detected.js +++ b/app/routes/app-detected.js @@ -1,5 +1,6 @@ -import Ember from 'ember'; -const { Route, RSVP: { Promise }, getOwner } = Ember; +import Route from '@ember/routing/route'; +import { Promise } from 'rsvp'; +import { getOwner } from '@ember/application'; export default Route.extend({ model() { diff --git a/app/routes/application.js b/app/routes/application.js index 5ef8c7b94b..af7d516b42 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -1,9 +1,11 @@ +import { set, get } from '@ember/object'; +import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; +import { schedule } from '@ember/runloop'; import Ember from "ember"; -const { Route, inject, run, NativeArray } = Ember; -const { service } = inject; -const { schedule } = run; -const set = Ember.set; -const get = Ember.get; +const { + NativeArray +} = Ember; export default Route.extend({ diff --git a/app/routes/container-type.js b/app/routes/container-type.js index c6d66412b7..970c6e87dc 100644 --- a/app/routes/container-type.js +++ b/app/routes/container-type.js @@ -1,7 +1,6 @@ -import Ember from "ember"; +import { Promise } from 'rsvp'; +import { get } from '@ember/object'; import TabRoute from "ember-inspector/routes/tab"; -const get = Ember.get; -const { RSVP: { Promise } } = Ember; export default TabRoute.extend({ setupController(controller) { diff --git a/app/routes/container-types.js b/app/routes/container-types.js index 03b25c71d7..9307c188d0 100644 --- a/app/routes/container-types.js +++ b/app/routes/container-types.js @@ -1,5 +1,5 @@ -import Ember from "ember"; -const { Route, RSVP: { Promise } } = Ember; +import Route from '@ember/routing/route'; +import { Promise } from 'rsvp'; export default Route.extend({ model() { diff --git a/app/routes/data/index.js b/app/routes/data/index.js index 0a8c3e0100..5e8516709b 100644 --- a/app/routes/data/index.js +++ b/app/routes/data/index.js @@ -1,7 +1,7 @@ -import Ember from "ember"; -const { RSVP: { Promise } } = Ember; +import Route from '@ember/routing/route'; +import { Promise } from 'rsvp'; -export default Ember.Route.extend({ +export default Route.extend({ model() { let route = this; return new Promise(function(resolve) { diff --git a/app/routes/deprecations.js b/app/routes/deprecations.js index 6d2072ef02..69136ae821 100644 --- a/app/routes/deprecations.js +++ b/app/routes/deprecations.js @@ -1,6 +1,5 @@ -import Ember from "ember"; +import { set } from '@ember/object'; import TabRoute from "ember-inspector/routes/tab"; -const set = Ember.set; export default TabRoute.extend({ setupController() { diff --git a/app/routes/info.js b/app/routes/info.js index 579a331957..5334acece5 100644 --- a/app/routes/info.js +++ b/app/routes/info.js @@ -1,8 +1,6 @@ -import Ember from "ember"; +import { Promise } from 'rsvp'; import TabRoute from "ember-inspector/routes/tab"; - -const { RSVP: { Promise }, computed } = Ember; -const { oneWay } = computed; +import { oneWay } from '@ember/object/computed'; export default TabRoute.extend({ version: oneWay('config.VERSION').readOnly(), diff --git a/app/routes/model-type.js b/app/routes/model-type.js index be259ac425..9ad03f6940 100644 --- a/app/routes/model-type.js +++ b/app/routes/model-type.js @@ -1,7 +1,8 @@ -import Ember from "ember"; -const { RSVP: { Promise } } = Ember; +import { get } from '@ember/object'; +import Route from '@ember/routing/route'; +import { Promise } from 'rsvp'; /*eslint camelcase: 0 */ -export default Ember.Route.extend({ +export default Route.extend({ setupController(controller, model) { this._super(controller, model); this.controllerFor('model-types').set('selected', model); @@ -23,6 +24,6 @@ export default Ember.Route.extend({ }, serialize(model) { - return { type_id: Ember.get(model, 'name') }; + return { type_id: get(model, 'name') }; } }); diff --git a/app/routes/model-types.js b/app/routes/model-types.js index 8afc73732d..0ee0a48d36 100644 --- a/app/routes/model-types.js +++ b/app/routes/model-types.js @@ -1,6 +1,6 @@ -import Ember from "ember"; +import { set } from '@ember/object'; +import { Promise } from 'rsvp'; import TabRoute from "ember-inspector/routes/tab"; -const { RSVP: { Promise } } = Ember; export default TabRoute.extend({ setupController(controller, model) { @@ -33,7 +33,7 @@ export default TabRoute.extend({ let route = this; message.modelTypes.forEach(function(modelType) { const currentType = route.get('currentModel').findBy('objectId', modelType.objectId); - Ember.set(currentType, 'count', modelType.count); + set(currentType, 'count', modelType.count); }); } }); diff --git a/app/routes/promise-tree.js b/app/routes/promise-tree.js index 97974d997b..5d8a961b10 100644 --- a/app/routes/promise-tree.js +++ b/app/routes/promise-tree.js @@ -1,8 +1,6 @@ -import Ember from "ember"; +import { Promise } from 'rsvp'; import TabRoute from "ember-inspector/routes/tab"; -const { RSVP: { Promise } } = Ember; - export default TabRoute.extend({ model() { // block rendering until first batch arrives diff --git a/app/routes/records.js b/app/routes/records.js index df69ec0061..57b1ac24b5 100644 --- a/app/routes/records.js +++ b/app/routes/records.js @@ -1,8 +1,6 @@ -import Ember from "ember"; +import { set } from '@ember/object'; import TabRoute from "ember-inspector/routes/tab"; -const set = Ember.set; - export default TabRoute.extend({ setupController(controller, model) { this._super(controller, model); diff --git a/app/routes/render-tree.js b/app/routes/render-tree.js index 5682e53b03..543595a5b8 100644 --- a/app/routes/render-tree.js +++ b/app/routes/render-tree.js @@ -1,8 +1,6 @@ -import Ember from "ember"; +import { Promise } from 'rsvp'; import TabRoute from "ember-inspector/routes/tab"; -const { RSVP: { Promise } } = Ember; - export default TabRoute.extend({ model() { const port = this.get('port'); diff --git a/app/routes/route-tree.js b/app/routes/route-tree.js index 146e4b769a..6fd7689224 100644 --- a/app/routes/route-tree.js +++ b/app/routes/route-tree.js @@ -1,6 +1,5 @@ -import Ember from "ember"; +import $ from 'jquery'; import TabRoute from "ember-inspector/routes/tab"; -const $ = Ember.$; export default TabRoute.extend({ setupController() { diff --git a/app/routes/tab.js b/app/routes/tab.js index 9ca53ed551..f9e915b955 100644 --- a/app/routes/tab.js +++ b/app/routes/tab.js @@ -1,6 +1,6 @@ /* eslint no-empty:0 */ -import Ember from "ember"; -export default Ember.Route.extend({ +import Route from '@ember/routing/route'; +export default Route.extend({ renderTemplate() { this.render(); try { diff --git a/app/routes/view-tree.js b/app/routes/view-tree.js index 9f07d255b5..d7319736c1 100644 --- a/app/routes/view-tree.js +++ b/app/routes/view-tree.js @@ -1,6 +1,5 @@ -import Ember from "ember"; +import $ from 'jquery'; import TabRoute from "ember-inspector/routes/tab"; -const $ = Ember.$; export default TabRoute.extend({ model() { diff --git a/app/services/layout.js b/app/services/layout.js index 70423d9768..a102d34d3c 100644 --- a/app/services/layout.js +++ b/app/services/layout.js @@ -10,8 +10,9 @@ * @class Layout * @extends Service */ -import Ember from 'ember'; -const { Service, Evented } = Ember; +import Service from '@ember/service'; + +import Evented from '@ember/object/evented'; export default Service.extend(Evented, { /** * Stores the app's content height. This property is kept up-to-date diff --git a/app/services/storage/local.js b/app/services/storage/local.js index 5aebd7e92a..3e8a13dab7 100644 --- a/app/services/storage/local.js +++ b/app/services/storage/local.js @@ -5,8 +5,9 @@ * @class Local * @extends Service */ -import Ember from 'ember'; -const { Service, isNone } = Ember; +import Service from '@ember/service'; + +import { isNone } from '@ember/utils'; const { parse, stringify } = JSON; let LOCAL_STORAGE_SUPPORTED; diff --git a/app/services/storage/memory.js b/app/services/storage/memory.js index 555f8675ee..53adb8440f 100644 --- a/app/services/storage/memory.js +++ b/app/services/storage/memory.js @@ -5,8 +5,9 @@ * @class Memory * @extends Service */ -import Ember from 'ember'; -const { Service, computed } = Ember; +import Service from '@ember/service'; + +import { computed } from '@ember/object'; const { keys } = Object; export default Service.extend({ diff --git a/app/utils/search-match.js b/app/utils/search-match.js index 2db8921fad..d6b40f7be4 100644 --- a/app/utils/search-match.js +++ b/app/utils/search-match.js @@ -1,6 +1,5 @@ -import Ember from "ember"; +import { isEmpty } from '@ember/utils'; import escapeRegExp from "ember-inspector/utils/escape-reg-exp"; -const { isEmpty } = Ember; export default function(text, searchQuery) { if (isEmpty(searchQuery)) { diff --git a/package.json b/package.json index 71869fdf32..2a508cde27 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "ember-async-image": "0.1.1", "ember-cli": "~2.13.3 ", "ember-cli-app-version": "^3.0.0", - "ember-cli-babel": "^6.4.0", + "ember-cli-babel": "^6.6.0", "ember-cli-dependency-checker": "^1.3.0", "ember-cli-deprecation-workflow": "^0.2.2", "ember-cli-eslint": "^3.0.0", diff --git a/tests/acceptance/container-test.js b/tests/acceptance/container-test.js index 363d62d0d8..461f94374e 100644 --- a/tests/acceptance/container-test.js +++ b/tests/acceptance/container-test.js @@ -1,8 +1,16 @@ +import { run } from '@ember/runloop'; import Ember from "ember"; import { module } from 'qunit'; import { test } from 'ember-qunit'; import startApp from '../helpers/start-app'; -import { visit, findAll, find, click, fillIn, currentURL } from 'ember-native-dom-helpers'; +import { + visit, + findAll, + find, + click, + fillIn, + currentURL +} from 'ember-native-dom-helpers'; let App; let port, message, name; @@ -17,7 +25,7 @@ module('Container Tab', { afterEach() { name = null; message = null; - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/data-test.js b/tests/acceptance/data-test.js index 15ff5dc953..e981d90594 100644 --- a/tests/acceptance/data-test.js +++ b/tests/acceptance/data-test.js @@ -1,10 +1,11 @@ -import Ember from "ember"; +import { guidFor } from '@ember/object/internals'; +import EmberObject from '@ember/object'; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; import { visit, findAll, click, fillIn } from 'ember-native-dom-helpers'; -const { run } = Ember; let App; let port, name; @@ -71,10 +72,10 @@ function recordFactory(attr, filterValues) { for (let i in attr) { searchKeywords.push(attr[i]); } - let object = Ember.Object.create(); + let object = EmberObject.create(); return { columnValues: attr, - objectId: attr.objectId || Ember.guidFor(object), + objectId: attr.objectId || guidFor(object), filterValues, searchKeywords }; diff --git a/tests/acceptance/deprecation-test.js b/tests/acceptance/deprecation-test.js index 4ef745b7f3..45e8407737 100644 --- a/tests/acceptance/deprecation-test.js +++ b/tests/acceptance/deprecation-test.js @@ -1,4 +1,4 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; @@ -46,7 +46,7 @@ module('Deprecation Tab', { afterEach() { name = null; message = null; - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/info-test.js b/tests/acceptance/info-test.js index 68d5e1a566..5d30d22fe5 100644 --- a/tests/acceptance/info-test.js +++ b/tests/acceptance/info-test.js @@ -1,4 +1,4 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; @@ -28,7 +28,7 @@ module('Info Tab', { }); }, afterEach() { - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/object-inspector-test.js b/tests/acceptance/object-inspector-test.js index 7789e19849..8f825235bc 100644 --- a/tests/acceptance/object-inspector-test.js +++ b/tests/acceptance/object-inspector-test.js @@ -1,8 +1,15 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; -import { visit, find, findAll, click, fillIn, keyEvent } from 'ember-native-dom-helpers'; +import { + visit, + find, + findAll, + click, + fillIn, + keyEvent +} from 'ember-native-dom-helpers'; let App; let port, message, name; @@ -24,7 +31,7 @@ module('Object Inspector', { afterEach() { name = null; message = null; - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/promise-test.js b/tests/acceptance/promise-test.js index 720272a2eb..50b1b106c9 100644 --- a/tests/acceptance/promise-test.js +++ b/tests/acceptance/promise-test.js @@ -1,4 +1,4 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; @@ -28,7 +28,7 @@ module('Promise Tab', { afterEach() { name = null; message = null; - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/render-tree-test.js b/tests/acceptance/render-tree-test.js index 1f69922b74..83fb832dc0 100644 --- a/tests/acceptance/render-tree-test.js +++ b/tests/acceptance/render-tree-test.js @@ -1,8 +1,14 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; -import { visit, find, findAll, click, fillIn } from 'ember-native-dom-helpers'; +import { + visit, + find, + findAll, + click, + fillIn +} from 'ember-native-dom-helpers'; let App; let port; @@ -18,7 +24,7 @@ module('Render Tree Tab', { }); }, afterEach() { - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/acceptance/route-tree-test.js b/tests/acceptance/route-tree-test.js index 501d5b1179..abdee5cc5f 100644 --- a/tests/acceptance/route-tree-test.js +++ b/tests/acceptance/route-tree-test.js @@ -1,11 +1,16 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; -import { visit, find, findAll, click, triggerEvent } from 'ember-native-dom-helpers'; +import { + visit, + find, + findAll, + click, + triggerEvent +} from 'ember-native-dom-helpers'; let App; -const { run } = Ember; let port; diff --git a/tests/acceptance/view-tree-test.js b/tests/acceptance/view-tree-test.js index 0eb30c2713..e80817e2c0 100644 --- a/tests/acceptance/view-tree-test.js +++ b/tests/acceptance/view-tree-test.js @@ -1,11 +1,17 @@ -import Ember from "ember"; +import { run } from '@ember/runloop'; import { test } from 'ember-qunit'; import { module } from 'qunit'; import startApp from '../helpers/start-app'; -import { visit, fillIn, find, findAll, click, triggerEvent } from 'ember-native-dom-helpers'; +import { + visit, + fillIn, + find, + findAll, + click, + triggerEvent +} from 'ember-native-dom-helpers'; let App; -const { run } = Ember; let port; @@ -17,7 +23,7 @@ module('View Tree Tab', { port = App.__container__.lookup('port:main'); }, afterEach() { - Ember.run(App, App.destroy); + run(App, App.destroy); } }); diff --git a/tests/helpers/destroy-app.js b/tests/helpers/destroy-app.js index c3d4d1abb5..e7f983bd14 100644 --- a/tests/helpers/destroy-app.js +++ b/tests/helpers/destroy-app.js @@ -1,5 +1,5 @@ -import Ember from 'ember'; +import { run } from '@ember/runloop'; export default function destroyApp(application) { - Ember.run(application, 'destroy'); + run(application, 'destroy'); } diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index 76996fd042..0daf9c9a7e 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -1,10 +1,8 @@ +import { Promise } from 'rsvp'; import { module } from 'qunit'; -import Ember from 'ember'; import startApp from '../helpers/start-app'; import destroyApp from '../helpers/destroy-app'; -const { RSVP: { Promise } } = Ember; - export default function(name, options = {}) { module(name, { beforeEach() { diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index a723e860d4..e9bed309ca 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -1,5 +1,9 @@ /* eslint no-unused-vars: 0 */ +import { run } from '@ember/runloop'; + +import { merge } from '@ember/polyfills'; + import Ember from 'ember'; import Application from '../../app'; import config from '../../config/environment'; @@ -8,8 +12,8 @@ const { generateGuid } = Ember; export default function startApp(attrs) { - let attributes = Ember.merge({}, config.APP); - attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; + let attributes = merge({}, config.APP); + attributes = merge(attributes, attrs); // use defaults, but you can override; Application.instanceInitializer({ name: `${generateGuid()}-detectEmberApplication`, @@ -20,7 +24,7 @@ export default function startApp(attrs) { } }); - return Ember.run(() => { + return run(() => { let application = Application.create(attributes); application.setupForTesting(); application.injectTestHelpers(); diff --git a/tests/helpers/trigger-port.js b/tests/helpers/trigger-port.js index b6a4d5fb1a..ab58dc9517 100644 --- a/tests/helpers/trigger-port.js +++ b/tests/helpers/trigger-port.js @@ -1,5 +1,5 @@ -import Ember from 'ember'; -const { run, Test: { registerHelper } } = Ember; +import { run } from '@ember/runloop'; +import { registerHelper } from '@ember/test'; export default registerHelper('triggerPort', async function t(app, ...args) { run(() => app.__container__.lookup('port:main').trigger(...args)); await wait(); diff --git a/yarn.lock b/yarn.lock index c567083938..5b7f44be1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2466,7 +2466,7 @@ ember-cli-babel@^5.0.0, ember-cli-babel@^5.1.5, ember-cli-babel@^5.1.6, ember-cl ember-cli-version-checker "^1.0.2" resolve "^1.1.2" -ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.1.0, ember-cli-babel@^6.10.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.4.0, ember-cli-babel@^6.8.0, ember-cli-babel@^6.8.1: +ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.0.0-beta.7, ember-cli-babel@^6.1.0, ember-cli-babel@^6.10.0, ember-cli-babel@^6.3.0, ember-cli-babel@^6.6.0, ember-cli-babel@^6.8.0, ember-cli-babel@^6.8.1: version "6.11.0" resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-6.11.0.tgz#79cb184bac3c05bfe181ddc306bac100ab1f9493" dependencies: