Permalink
Browse files

Updates import syntax for v 2.16

Previous versions of ember imported it via just importing the Ember
object:
`import Ember from 'ember'`

The favored syntax is now:
`import { PieceOfEmber }` from '@ember/PieceOfEmberThing'

This was done using `ember-modules-codemod` command
Close #37
  • Loading branch information...
tvlangley committed Jan 30, 2018
1 parent 641348c commit 62bc70a070ab165edc53fe6f1d04392b751e8c27
Showing with 27 additions and 11 deletions.
  1. +14 −0 MODULE_REPORT.md
  2. +2 −1 app/app.js
  3. +2 −2 app/router.js
  4. +2 −2 app/services/auth.js
  5. +2 −2 tests/helpers/destroy-app.js
  6. +5 −4 tests/helpers/start-app.js
@@ -0,0 +1,14 @@
## Module Report
### Unknown Global

**Global**: `Ember.MODEL_FACTORY_INJECTIONS`

**Location**: `app/app.js` at line 8

```js
let App;
Ember.MODEL_FACTORY_INJECTIONS = true;
App = Ember.Application.extend({
```
@@ -1,3 +1,4 @@
import Application from '@ember/application';
import Ember from 'ember';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
@@ -7,7 +8,7 @@ let App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
@@ -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
});
@@ -1,4 +1,4 @@
import Ember from 'ember';
import Service from '@ember/service';

export default Ember.Service.extend({
export default Service.extend({
});
@@ -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');
}
@@ -1,14 +1,15 @@
import Ember from 'ember';
import { run } from '@ember/runloop';
import { merge } from '@ember/polyfills';
import Application from '../../app';
import config from '../../config/environment';

export default function startApp(attrs) {
let application;

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;

Ember.run(() => {
run(() => {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();

0 comments on commit 62bc70a

Please sign in to comment.