Skip to content

Commit

Permalink
chore: update dependencies, including ember/ember-cli, bump minor ver…
Browse files Browse the repository at this point in the history
…sion

- updated "r" test/page to use keypress instead of input event
- removed unnecessary addon dependency: ember-promise-helpers
- updated github token for the concurrency test/demo
- removed usage of deprecated query-params helper in favor of hash
- added check in transition-to helper for objectLiteral queryParams
- fixed deprecation warnings (no implicit this) in tests
- bump version to 0.8.0
  • Loading branch information
tzellman committed Jun 17, 2021
1 parent f738bf4 commit 5eeb245
Show file tree
Hide file tree
Showing 16 changed files with 4,545 additions and 2,148 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ jobs:
uses: actions/[email protected]
with:
# test addons with the same minimum supported node version as Ember CLI
node-version: "10.x"
node-version: "12.x"
- name: Tests
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember }}
run: |
npm ci
npm run lint
npm run test:ember
npx ember try:one ${{ matrix.ember }}
7 changes: 6 additions & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

module.exports = {
extends: 'octane'
extends: 'octane',
rules: {
'no-implicit-this': {
allow: ['shhh-helper']
}
}
};
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.8.0

This is a minor release with no new features added, and some deprecations removed.

- Upgraded to ember/ember-cli 3.26
- updated "r" test/page (and docs) to use keypress instead of input event
- removed unnecessary addon dependency: ember-promise-helpers
- updated github token for the concurrency test/demo
- removed usage of deprecated query-params helper in favor of hash
- added check in transition-to helper for objectLiteral queryParams
- fixed deprecation warnings (no implicit this) in tests

## 0.7.0

This is a minor release with no new features added.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Linting

* `npm run lint`
* `npm run lint:js -- --fix`
* `npm run lint:fix`

## Running tests

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Reactive helpers are helpers that return functions. These functions can be bound
Returns a function for a given helper and curries arguments to it.

```hbs
<Input @value={{this.value}}
@input={{fn (pipe (r "dasherize" this.value) (fn (mut this.value)))}}
<Input
@value={{this.value}}
{{on "keyup" (pipe (r "dasherize" this.value) (fn (mut this.value)))}}
/>
```

Expand Down
27 changes: 24 additions & 3 deletions addon/helpers/transition-to.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';

const isObjectLiteral = (obj) => {
if (typeof obj !== 'object' || obj === null || obj === undefined) {
return false;
}

let objProto = obj;
// get obj's Object constructor's prototype
do {
objProto = Object.getPrototypeOf(objProto);
} while (objProto !== null && objProto !== undefined);
for (const prop in obj) {
if (!Object.prototype.hasOwnProperty.call(obj, prop) && !Object.prototype.hasOwnProperty.call(objProto, prop)) {
// inherited elsewhere
return false;
}
}
return Object.getPrototypeOf(obj) === objProto;
};

export default class TransitionToHelper extends Helper {
@service router;

compute(params) {
params = params.slice();

let queryParams = params[params.length - 1];
if (queryParams && queryParams.isQueryParams) {
params[params.length - 1] = { queryParams: queryParams.values };
if (params.length > 1) {
const lastParam = params[params.length - 1];
if (isObjectLiteral(lastParam)) {
params[params.length - 1] = { queryParams: lastParam };
}
}

const router = this.router;
Expand Down
Loading

0 comments on commit 5eeb245

Please sign in to comment.