diff --git a/addon/src/-private/ember-internals.ts b/addon/src/-private/ember-internals.ts index bb1ab78fc..7ede09dd3 100644 --- a/addon/src/-private/ember-internals.ts +++ b/addon/src/-private/ember-internals.ts @@ -8,11 +8,14 @@ */ import { get } from '@ember/object'; import { guidFor } from '@ember/object/internals'; -import Ember from 'ember'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: private API, no public types +import { getViewBounds as _getViewBounds } from '@ember/-internals/views'; import type Component from '@ember/component'; -const { getViewBounds } = Ember.ViewUtils as unknown as { - getViewBounds(view: Component): { firstNode: Node; lastNode: Node }; +const getViewBounds = _getViewBounds as unknown as (view: Component) => { + firstNode: Node; + lastNode: Node; }; export function componentNodes(view: Component) { diff --git a/addon/src/-private/ember-scheduler.ts b/addon/src/-private/ember-scheduler.ts index 6a3c46e03..5c4ade5ce 100644 --- a/addon/src/-private/ember-scheduler.ts +++ b/addon/src/-private/ember-scheduler.ts @@ -1,7 +1,9 @@ import { join, scheduleOnce } from '@ember/runloop'; import { addObserver } from '@ember/object/observers'; import { computed, set } from '@ember/object'; -import Ember from 'ember'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore: private API, no public types +import { setClassicDecorator } from '@ember/-internals/metal'; import { DEBUG } from '@glimmer/env'; import { spawn, current, stop, logErrors } from './scheduler.ts'; import { microwait } from './concurrency-helpers.ts'; @@ -30,7 +32,7 @@ function _computed(fn: (this: HostObject, propertyName: string) => Task) { // eslint-disable-next-line prefer-rest-params return (computed(fn) as any)(...arguments); }; - (Ember as any)._setClassicDecorator(cp); + setClassicDecorator(cp); return cp; } diff --git a/addon/src/-private/sprite.ts b/addon/src/-private/sprite.ts index 9cfceabf3..44192b843 100644 --- a/addon/src/-private/sprite.ts +++ b/addon/src/-private/sprite.ts @@ -1,5 +1,5 @@ import { warn } from '@ember/debug'; -import Ember from 'ember'; +import { macroCondition, isTesting } from '@embroider/macros'; import Transform, { ownTransform, cumulativeTransform } from './transform.ts'; import { continueMotions } from './motion-bridge.ts'; import { collapsedChildren } from './margin-collapse.ts'; @@ -142,7 +142,7 @@ export default class Sprite { } } - if (Ember.testing) { + if (macroCondition(isTesting())) { Object.seal(this); } } diff --git a/test-app/app/components/item-list-example.js b/test-app/app/components/item-list-example.js index 197c763aa..ffa13da5d 100644 --- a/test-app/app/components/item-list-example.js +++ b/test-app/app/components/item-list-example.js @@ -1,4 +1,4 @@ -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { task } from 'ember-animated/-private/ember-scheduler'; diff --git a/test-app/app/routes/demos/hero/detail.js b/test-app/app/routes/demos/hero/detail.js index c4873a4b3..9cf29e264 100644 --- a/test-app/app/routes/demos/hero/detail.js +++ b/test-app/app/routes/demos/hero/detail.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default class extends Route { @service store; diff --git a/test-app/app/routes/demos/hero/index.js b/test-app/app/routes/demos/hero/index.js index 7be1abc7a..c3f270c14 100644 --- a/test-app/app/routes/demos/hero/index.js +++ b/test-app/app/routes/demos/hero/index.js @@ -1,5 +1,5 @@ import Route from '@ember/routing/route'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; export default class extends Route { @service store; diff --git a/test-app/tests/integration/components/animated-container-test.js b/test-app/tests/integration/components/animated-container-test.js index 5a481ef99..56c6a304a 100644 --- a/test-app/tests/integration/components/animated-container-test.js +++ b/test-app/tests/integration/components/animated-container-test.js @@ -2,7 +2,7 @@ import { Promise as EmberPromise } from 'rsvp'; import { run } from '@ember/runloop'; import { alias } from '@ember/object/computed'; -import { inject as service } from '@ember/service'; +import { service } from '@ember/service'; import Component from '@ember/component'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit';