Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Ember 3.27, drop support for Ember <3.20 #251

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
26 changes: 18 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ module.exports = {
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {
'ember/no-jquery': 'error',
},
rules: {},
overrides: [
// node files
{
Expand All @@ -32,7 +34,12 @@ module.exports = {
'config/**/*.js',
'tests/dummy/config/**/*.js',
],
excludedFiles: ['addon/**', 'addon-test-support/**', 'app/**', 'tests/dummy/app/**'],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**',
],
parserOptions: {
sourceType: 'script',
},
Expand All @@ -41,9 +48,12 @@ module.exports = {
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
}),
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
strategy:
matrix:
scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-release
- ember-beta
- ember-canary
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand All @@ -23,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
1 change: 0 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

module.exports = {
singleQuote: true,
printWidth: 120,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'octane',
extends: 'recommended',
};
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ but without its caveats.
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.16 or above
* Ember CLI v2.13 or above
* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v10 or above


Expand Down
5 changes: 4 additions & 1 deletion addon/components/portal-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default class PortalTargetComponent extends Component {
@action
register(element) {
assert('PortalTargets needs a name', this.args.name);
const options = { multiple: this.args.multiple, onChange: this.args.onChange };
const options = {
multiple: this.args.multiple,
onChange: this.args.onChange,
};
this.portalService.registerTarget(this.args.name, element, options);
}

Expand Down
5 changes: 4 additions & 1 deletion addon/components/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export default class PortalComponent extends Component {
}

get renderInPlace() {
return this.args.renderInPlace === true || (!this.target && this.args.fallback === 'inplace');
return (
this.args.renderInPlace === true ||
(!this.target && this.args.fallback === 'inplace')
);
}

willDestroy() {
Expand Down
10 changes: 8 additions & 2 deletions addon/services/-portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export default class PortalService extends Service {
}

registerTarget(name, element, options) {
assert(`Portal target with name ${name} already exists`, !this.#targets.has(name));
assert(
`Portal target with name ${name} already exists`,
!this.#targets.has(name)
);
this.#targets.set(name, new TargetTracker(name, element, options));
}

Expand All @@ -48,7 +51,10 @@ export default class PortalService extends Service {

unregisterPortal(name) {
let count = this.#portalCount.get(name) ?? 0;
assert(`Trying to unregister a portal that hasn't been registered before`, count > 0);
assert(
`Trying to unregister a portal that hasn't been registered before`,
count > 0
);
count--;
this.#portalCount.set(name, count);
const target = this.getTarget(name);
Expand Down
27 changes: 14 additions & 13 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.16',
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.16.0',
'ember-source': '~3.20.5',
},
},
},
{
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.24.3',
},
},
},
Expand Down Expand Up @@ -38,16 +47,6 @@ module.exports = async function () {
},
},
},
// 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: {
Expand All @@ -57,7 +56,7 @@ module.exports = async function () {
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'@ember/jquery': '^1.1.0',
},
},
},
Expand All @@ -76,6 +75,8 @@ module.exports = async function () {
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};
3 changes: 2 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
26 changes: 17 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
Expand All @@ -32,35 +35,40 @@
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.5",
"@embroider/macros": "^0.35.1",
"@embroider/test-setup": "^0.41.0",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.11.3",
"ember-cli": "~3.18.0",
"ember-cli": "~3.27.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^3.0.0",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-page-title": "^6.2.2",
"ember-qunit": "^5.1.4",
"ember-resolver": "^8.0.2",
"ember-sinon-qunit": "^5.0.0",
"ember-source": "~3.18.0",
"ember-source": "~3.27.2",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.21.0",
"ember-template-lint": "^3.4.2",
"ember-try": "^1.4.0",
"eslint": "^7.30.0",
"eslint-config-prettier": "^7.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-qunit": "^6.1.1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.2",
"qunit": "^2.15.0",
"qunit-dom": "^1.6.0",
"release-it": "^14.10.0",
"release-it-lerna-changelog": "^3.1.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'dummy/config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import config from 'dummy/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
Expand Down
2 changes: 2 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{page-title "Dummy"}}

<h2 id="title">Welcome to Ember</h2>

{{outlet}}
21 changes: 21 additions & 0 deletions tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"schemaVersion": "1.0.0",
"packages": [
{
"name": "ember-cli",
"version": "3.27.0",
"blueprints": [
{
"name": "addon",
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
"codemodsSource": "ember-addon-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--yarn",
"--no-welcome"
]
}
]
}
]
}
Loading