Skip to content

Commit

Permalink
Update to 3.12 (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer authored Nov 23, 2019
1 parent a4297a5 commit 25f0a1f
Show file tree
Hide file tree
Showing 10 changed files with 1,227 additions and 723 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
Expand Down Expand Up @@ -37,8 +37,7 @@ module.exports = {
'tests/helpers/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
sourceType: 'script'
},
env: {
browser: false,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Compatibility
Installation
------------------------------------------------------------------------------

```
```sh
ember install ember-router-scroll
```

Expand All @@ -52,7 +52,7 @@ const Router = EmberRouter.extend(RouterScroll, {
**2.** Enable `historySupportMiddleware` in your app

Edit `config/environment.js` and add `historySupportMiddleware: true,` to get live-reload working in nested routes.
(See [Issue #21](https://github.com/dockyard/ember-router-scroll/issues/21))
(See [Issue #21](https://github.com/DockYard/ember-router-scroll/issues/21))

```javascript
historySupportMiddleware: true,
Expand Down Expand Up @@ -288,7 +288,7 @@ export default Component.extend({

* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
* `ember test --serve

License
------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions addon/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Mixin from '@ember/object/mixin';
import { get, getWithDefault, computed } from '@ember/object';
import { get, computed } from '@ember/object';
import { inject } from '@ember/service';
import { getOwner } from '@ember/application';
import { scheduleOnce } from '@ember/runloop';
Expand Down Expand Up @@ -108,7 +108,7 @@ let RouterScrollMixin = Mixin.create({

let preserveScrollPosition;
if (gte('3.6.0-beta.1')) {
preserveScrollPosition = getWithDefault(transition, 'router.currentRouteInfos', []).some((routeInfo) => get(routeInfo, 'route.controller.preserveScrollPosition'));
preserveScrollPosition = (get(transition, 'router.currentRouteInfos') || []).some((routeInfo) => get(routeInfo, 'route.controller.preserveScrollPosition'));
} else {
preserveScrollPosition = transition.some((t) => get(t, 'handler.controller.preserveScrollPosition'));
}
Expand Down
6 changes: 3 additions & 3 deletions addon/services/router-scroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Service from '@ember/service';
import { getWithDefault, computed, set, get } from '@ember/object';
import { computed, set, get } from '@ember/object';
import { typeOf } from '@ember/utils';
import { assert } from '@ember/debug';
import { getOwner } from '@ember/application';
Expand Down Expand Up @@ -116,9 +116,9 @@ Object.defineProperty(RouterScroll.prototype, 'position', {
const stateUuid = get(window, 'history.state.uuid');

set(this, 'key', stateUuid);
const key = getWithDefault(this, 'key', '-1');
const key = get(this, 'key') || '-1';

return getWithDefault(scrollMap, key, scrollMap.default);
return get(scrollMap, key) || scrollMap.default;
}
});

Expand Down
132 changes: 61 additions & 71 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,73 @@

const getChannelURL = require('ember-source-channel-url');

module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary')
]).then((urls) => {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'ember-source': '~2.18.0'
}
module.exports = async function() {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'ember-source': '~3.4.0'
}
},
{
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'ember-source': '~3.4.0'
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0]
}
}
},
{
name: 'ember-lts-3.8',
npm: {
devDependencies: {
'ember-source': '~3.8.0'
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1]
}
}
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release')
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2]
}
}
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta')
}
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
{
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
}
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
}
}
]
};
});
}
]
};
};
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@
},
"dependencies": {
"ember-app-scheduler": "^1.0.5",
"ember-cli-babel": "^7.1.2",
"ember-cli-babel": "^7.7.3",
"ember-compatibility-helpers": "^1.1.2"
},
"devDependencies": {
"@ember/optional-features": "^0.6.3",
"@ember/optional-features": "^0.7.0",
"broccoli-asset-rev": "^3.0.0",
"ember-cli": "~3.7.1",
"ember-cli": "~3.12.0",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-eslint": "^5.0.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-github-pages": "^0.2.0",
"ember-cli-htmlbars": "^3.0.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-shims": "^1.2.0",
Expand All @@ -75,18 +75,18 @@
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^2.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^3.4.1",
"ember-qunit": "^4.4.1",
"ember-resolver": "^5.0.1",
"ember-source": "~3.7.0",
"ember-source": "~3.12.0",
"ember-source-channel-url": "^1.1.0",
"ember-try": "^1.0.0",
"eslint-plugin-ember": "^6.1.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-node": "^9.0.1",
"loader.js": "^4.7.0",
"qunit-dom": "^0.8.0"
"qunit-dom": "^0.8.4"
},
"engines": {
"node": "6.* || 8.* || >= 10.*"
"node": "8.* || >= 10.*"
},
"ember-addon": {
"configPath": "tests/dummy/config",
Expand Down
1 change: 0 additions & 1 deletion testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
Expand Down
Loading

0 comments on commit 25f0a1f

Please sign in to comment.