Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Aug 20, 2019
1 parent 1fc0d23 commit 38cb697
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 20 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## v1.1.0 (2019-08-20)

#### :rocket: Enhancement
* [#177](https://github.com/ember-codemods/ember-native-class-codemod/pull/177) Fixup class naming logic and make it work with pods ([@pzuraq](https://github.com/pzuraq))
* [#176](https://github.com/ember-codemods/ember-native-class-codemod/pull/176) Removes `@className` and `@attribute` in favor of `@classNameBindings` and `@attributeBindings` ([@pzuraq](https://github.com/pzuraq))

#### :bug: Bug Fix
* [#179](https://github.com/ember-codemods/ember-native-class-codemod/pull/179) Ignore chained class definitions ([@pzuraq](https://github.com/pzuraq))
* [#152](https://github.com/ember-codemods/ember-native-class-codemod/pull/152) Remove remaining traces of wrapComputed. ([@rwjblue](https://github.com/rwjblue))
* [#150](https://github.com/ember-codemods/ember-native-class-codemod/pull/150) Do nothing for non-JS files. ([@rwjblue](https://github.com/rwjblue))

#### :memo: Documentation
* [#184](https://github.com/ember-codemods/ember-native-class-codemod/pull/184) Improve markup in codemod options table in the README.md. ([@chriskrycho](https://github.com/chriskrycho))
* [#164](https://github.com/ember-codemods/ember-native-class-codemod/pull/164) Fix typo in the readme ([@lolmaus](https://github.com/lolmaus))
* [#155](https://github.com/ember-codemods/ember-native-class-codemod/pull/155) Fix helpers link in README ([@rajasegar](https://github.com/rajasegar))

#### :house: Internal
* [#180](https://github.com/ember-codemods/ember-native-class-codemod/pull/180) Adds tests for reopening classes ([@pzuraq](https://github.com/pzuraq))
* [#173](https://github.com/ember-codemods/ember-native-class-codemod/pull/173) Swap out the telemetry helpers for the `ember-codemods-telemetry-helpers` package ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
* [#143](https://github.com/ember-codemods/ember-native-class-codemod/pull/143) Add test for using ember-concurrency tasks in converted objects. ([@rwjblue](https://github.com/rwjblue))
* [#151](https://github.com/ember-codemods/ember-native-class-codemod/pull/151) Fixup typo in method name closet -> closest. ([@rwjblue](https://github.com/rwjblue))

#### Committers: 7
- Andrey Mikhaylov (lolmaus) ([@lolmaus](https://github.com/lolmaus))
- Chris Garrett ([@pzuraq](https://github.com/pzuraq))
- Chris Krycho ([@chriskrycho](https://github.com/chriskrycho))
- L. Preston Sego III ([@NullVoxPopuli](https://github.com/NullVoxPopuli))
- Rajasegar Chandran ([@rajasegar](https://github.com/rajasegar))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)

## v1.0.1 (2019-06-23)

#### :bug: Bug Fix
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ transformation of

<!--TRANSFORMS_START-->
* [ember-object](transforms/ember-object/README.md)
* [helpers](transforms/helpers)
* [helpers](transforms/helpers/README.md)
<!--TRANSFORMS_END-->

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-native-class-codemod",
"version": "1.0.1",
"version": "1.1.0",
"description": "Codemods for transforming ember app code to native class syntax with decorators.",
"keywords": [
"codemod-cli"
Expand Down
178 changes: 160 additions & 18 deletions transforms/ember-object/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ ember-native-class-codemod ember-object path/of/files/ or/some**/*glob.js
<!--FIXTURES_TOC_START-->
* [action-invalid](#action-invalid)
* [basic](#basic)
* [chained-class-definition](#chained-class-definition)
* [class-fields](#class-fields)
* [class-reopen](#class-reopen)
* [decorators-invalid](#decorators-invalid)
* [decorators](#decorators)
* [default-export](#default-export)
* [double-quotes](#double-quotes)
* [ember-concurrency](#ember-concurrency)
* [import](#import)
* [injecting-service](#injecting-service)
* [runtime](#runtime)
<!--FIXTURES_TOC_END-->

Expand Down Expand Up @@ -217,6 +221,24 @@ class Foo extends Test.extend(MyMixin) {
@classic
class Foo extends EmberObject.extend(MixinA, MixinB) {}

```
---
<a id="chained-class-definition">**chained-class-definition**</a>

**Input** (<small>[chained-class-definition.input.js](transforms/ember-object/__testfixtures__/chained-class-definition.input.js)</small>):
```js
import EmberObject from '@ember/object';

export default EmberObject.extend({}).reopenClass({});

```

**Output** (<small>[chained-class-definition.output.js](transforms/ember-object/__testfixtures__/chained-class-definition.output.js)</small>):
```js
import EmberObject from '@ember/object';

export default EmberObject.extend({}).reopenClass({});

```
---
<a id="class-fields">**class-fields**</a>
Expand Down Expand Up @@ -282,6 +304,34 @@ class Foo extends Test {
}
}

```
---
<a id="class-reopen">**class-reopen**</a>

**Input** (<small>[class-reopen.input.js](transforms/ember-object/__testfixtures__/class-reopen.input.js)</small>):
```js
import EmberObject from '@ember/object';

const Foo = EmberObject.extend({});

Foo.reopenClass({});

export default Foo;

```

**Output** (<small>[class-reopen.output.js](transforms/ember-object/__testfixtures__/class-reopen.output.js)</small>):
```js
import classic from 'ember-classic-decorator';
import EmberObject from '@ember/object';

@classic
class Foo extends EmberObject {}

Foo.reopenClass({});

export default Foo;

```
---
<a id="decorators-invalid">**decorators-invalid**</a>
Expand Down Expand Up @@ -566,7 +616,15 @@ const Foo = EmberObject.extend({
**Output** (<small>[decorators.output.js](transforms/ember-object/__testfixtures__/decorators.output.js)</small>):
```js
import classic from 'ember-classic-decorator';
import { attribute, className, classNames, tagName, layout as templateLayout } from '@ember-decorators/component';

import {
classNames,
attributeBindings,
classNameBindings,
tagName,
layout as templateLayout,
} from '@ember-decorators/component';

import { observes as watcher, on } from '@ember-decorators/object';
import { inject as controller } from '@ember/controller';
import { inject as service } from '@ember/service';
Expand Down Expand Up @@ -647,20 +705,16 @@ class Foo extends EmberObject {
}

@classic
class Comp extends EmberObject {
@classNameBindings('isEnabled:enabled:disabled', 'a:b:c', 'c:d')
@attributeBindings('customHref:href')
class comp extends EmberObject {
@computed('a', 'c')
@className('enabled', 'disabled')
get isEnabled() {
return false;
}

@className('b', 'c')
a = true;

@className('d')
c = '';

@attribute('href')
customHref = 'http://emberjs.com';
}

Expand Down Expand Up @@ -784,7 +838,7 @@ export default EmberObject.extend({});
```js
import classic from 'ember-classic-decorator';
@classic
export default class DefaultExportInput extends EmberObject {}
export default class DefaultExport extends EmberObject {}

```
---
Expand Down Expand Up @@ -877,6 +931,43 @@ class Foo extends Test.extend(MyMixin) {
@classic
class Foo extends EmberObject.extend(MixinA, MixinB) {}

```
---
<a id="ember-concurrency">**ember-concurrency**</a>

**Input** (<small>[ember-concurrency.input.js](transforms/ember-object/__testfixtures__/ember-concurrency.input.js)</small>):
```js
import Component from '@ember/component';
import { task } from 'ember-concurrency';

export default Component.extend({
fetchAlerts: task(function*() {
let alerts = yield this.store.query('alert', {
filter: { id: this.get('alert.id') }
});
return alerts.sortBy('createdAt').reverse();
}).drop(),
});

```

**Output** (<small>[ember-concurrency.output.js](transforms/ember-object/__testfixtures__/ember-concurrency.output.js)</small>):
```js
import classic from 'ember-classic-decorator';
import Component from '@ember/component';
import { task } from 'ember-concurrency';

@classic
export default class EmberConcurrency extends Component {
@(task(function*() {
let alerts = yield this.store.query('alert', {
filter: { id: this.get('alert.id') }
});
return alerts.sortBy('createdAt').reverse();
}).drop())
fetchAlerts;
}

```
---
<a id="import">**import**</a>
Expand Down Expand Up @@ -908,35 +999,65 @@ import Controller from '@ember/controller';
import Evented from '@ember/object/evented';

@classic
class Ser extends Service {}
class ser extends Service {}

@classic
class Ctrl extends Controller {}
class ctrl extends Controller {}

@classic
class Evt extends Service.extend(Evented) {
class evt extends Service.extend(Evented) {
@on('click')
e() {
return 'e';
}
}

export { Ser, Ctrl, Evt };
export { ser, ctrl, evt };

```
---
<a id="injecting-service">**injecting-service**</a>

**Input** (<small>[injecting-service.input.js](transforms/ember-object/__testfixtures__/injecting-service.input.js)</small>):
```js
import Service, { service as injectService } from '@ember/service';

export default Service.extend({
something: injectService(),
otherThing: injectService('some-thing'),
});

```

**Output** (<small>[injecting-service.output.js](transforms/ember-object/__testfixtures__/injecting-service.output.js)</small>):
```js
import classic from 'ember-classic-decorator';
import Service, { service as injectService } from '@ember/service';

@classic
export default class InjectingServiceService extends Service {
@injectService()
something;

@injectService('some-thing')
otherThing;
}

```
---
<a id="runtime">**runtime**</a>

**Input** (<small>[runtime.input.js](transforms/ember-object/__testfixtures__/runtime.input.js)</small>):
```js
import RuntimeInput from 'common/runtime/input';
import Runtime from 'common/runtime';
import { alias } from '@ember/object/computed';
import { computed } from '@ember/object';
import { service } from '@ember/service';

/**
* Program comments
*/
export default RuntimeInput.extend(MyMixin, {
export default Runtime.extend(MyMixin, {
/**
* Property comments
*/
Expand All @@ -946,6 +1067,9 @@ export default RuntimeInput.extend(MyMixin, {
[MY_VAL]: 'val',
queryParams: {},

error: service(),
errorService: service('error'),

unobservedProp: null,
offProp: null,

Expand All @@ -957,6 +1081,11 @@ export default RuntimeInput.extend(MyMixin, {

computedMacro: customMacro(),

anotherMacro: customMacroWithInput({
foo: 123,
bar: 'baz'
}),

/**
* Method comments
*/
Expand Down Expand Up @@ -1001,13 +1130,14 @@ import classic from 'ember-classic-decorator';
import { off, unobserves } from '@ember-decorators/object';
import { action, computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import RuntimeInput from 'common/runtime/input';
import Runtime from 'common/runtime';
import { service } from '@ember/service';

/**
* Program comments
*/
@classic
export default class RuntimeInputEmberObject extends RuntimeInput.extend(MyMixin) {
export default class _Runtime extends Runtime.extend(MyMixin) {
/**
* Property comments
*/
Expand All @@ -1018,6 +1148,12 @@ export default class RuntimeInputEmberObject extends RuntimeInput.extend(MyMixin
[MY_VAL] = 'val';
queryParams = {};

@service
error;

@service('error')
errorService;

@unobserves('prop3', 'prop4')
unobservedProp;

Expand All @@ -1032,9 +1168,15 @@ export default class RuntimeInputEmberObject extends RuntimeInput.extend(MyMixin
@alias('numPlusOne')
numPlusPlus;

@customMacro
@customMacro()
computedMacro;

@customMacroWithInput({
foo: 123,
bar: 'baz'
})
anotherMacro;

/**
* Method comments
*/
Expand Down

0 comments on commit 38cb697

Please sign in to comment.