Skip to content

Commit fe4eb8d

Browse files
author
Chris Garrett
authored
[FEATURE] Adds the classicDecorator option (#132)
Adds the `@classic` decorator if the option is enabled to every class. The option is enabled by default. I also cleaned up some of the organization of the tests, and the way option defaults were setup. Now we have a single location where options are defined and enabled.
1 parent 2652490 commit fe4eb8d

35 files changed

Lines changed: 90 additions & 38 deletions

test/fixtures/output/app/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import classic from "ember-classic-decorator";
12
import Application from '@ember/application';
23
import Resolver from './resolver';
34
import loadInitializers from 'ember-load-initializers';
45
import config from './config/environment';
56

7+
@classic
68
class AppApplication extends Application {
79
modulePrefix = config.modulePrefix;
810
podModulePrefix = config.podModulePrefix;

test/fixtures/output/app/components/test-component.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import classic from "ember-classic-decorator";
12
import { computed } from "@ember/object";
23
import Component from "@ember/component";
34

@@ -7,6 +8,7 @@ function fullNameMacro() {
78
});
89
}
910

11+
@classic
1012
export default class TestComponentComponent extends Component {
1113
@fullNameMacro
1214
fullName;

test/fixtures/output/app/router.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import classic from "ember-classic-decorator";
12
import EmberRouter from '@ember/routing/router';
23
import config from './config/environment';
34

5+
@classic
46
class RouterRouter extends EmberRouter {
57
location = config.locationType;
68
rootURL = config.rootURL;
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import Component from '@ember/component';
1+
import classic from "ember-classic-decorator";
2+
import Component from "@ember/component";
23

3-
export default class FireSauceComponent extends Component {
4-
};
4+
@classic
5+
export default class FireSauceComponent extends Component {}

transforms/ember-object/__testfixtures__/action.invalid.input.js renamed to transforms/ember-object/__testfixtures__/action-invalid.input.js

File renamed without changes.

transforms/ember-object/__testfixtures__/action.invalid.output.js renamed to transforms/ember-object/__testfixtures__/action-invalid.output.js

File renamed without changes.

transforms/ember-object/__testfixtures__/basic.output.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import classic from "ember-classic-decorator";
2+
13
/**
24
* Program comments
35
*/
6+
@classic
47
class Foo extends Test.extend(MyMixin) {
58
/**
69
* Property comments
@@ -35,4 +38,5 @@ class Foo extends Test.extend(MyMixin) {
3538
}
3639
}
3740

41+
@classic
3842
class Foo extends EmberObject.extend(MixinA, MixinB) {}

transforms/ember-object/__testfixtures__/class-fields.valid.input.js renamed to transforms/ember-object/__testfixtures__/class-fields.input.js

File renamed without changes.

transforms/ember-object/__testfixtures__/class-fields.valid.output.js renamed to transforms/ember-object/__testfixtures__/class-fields.output.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import classic from "ember-classic-decorator";
2+
13
/**
24
* Program comments
35
*/
6+
@classic
47
class Foo extends Test {
58
/**
69
* Method comments

transforms/ember-object/__testfixtures__/class-fields.valid.options.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)