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

Upgrade ember to v4 #373

Merged
merged 14 commits into from
Jan 3, 2022
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
26 changes: 10 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**',
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
Expand All @@ -57,7 +51,7 @@ module.exports = {
extends: ['plugin:node/recommended'],
},
{
// Test files:
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Run Tests
run: yarn test:ember

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.24
- ember-lts-3.28
- ember-release
- ember-beta
- ember-canary
- ember-classic
- ember-default-with-jquery
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
/.prettierignore
/.prettierrc.js
Expand All @@ -32,4 +34,7 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,33 +500,33 @@ This addon is minimal and does not currently ship with a stylesheet. You can sty
We're grateful to these wonderful contributors who've contributed to `ember-cli-flash`:

[//]: contributor-faces
<a href="https://github.com/poteto"><img src="https://avatars0.githubusercontent.com/u/1390709?v=4" title="poteto" width="80" height="80"></a>
<a href="https://github.com/Dhaulagiri"><img src="https://avatars1.githubusercontent.com/u/1672302?v=4" title="Dhaulagiri" width="80" height="80"></a>
<a href="https://github.com/sbatson5"><img src="https://avatars3.githubusercontent.com/u/881981?v=4" title="sbatson5" width="80" height="80"></a>
<a href="https://github.com/johno"><img src="https://avatars2.githubusercontent.com/u/1424573?v=4" title="johno" width="80" height="80"></a>
<a href="https://github.com/rwjblue"><img src="https://avatars0.githubusercontent.com/u/12637?v=4" title="rwjblue" width="80" height="80"></a>
<a href="https://github.com/mike-north"><img src="https://avatars1.githubusercontent.com/u/558005?v=4" title="mike-north" width="80" height="80"></a>
<a href="https://github.com/jrjohnson"><img src="https://avatars2.githubusercontent.com/u/349624?v=4" title="jrjohnson" width="80" height="80"></a>
<a href="https://github.com/martndemus"><img src="https://avatars2.githubusercontent.com/u/903637?v=4" title="martndemus" width="80" height="80"></a>
<a href="https://github.com/bgentry"><img src="https://avatars2.githubusercontent.com/u/114033?v=4" title="bgentry" width="80" height="80"></a>
<a href="https://github.com/cowboyd"><img src="https://avatars2.githubusercontent.com/u/4205?v=4" title="cowboyd" width="80" height="80"></a>
<a href="https://github.com/kmiyashiro"><img src="https://avatars1.githubusercontent.com/u/71852?v=4" title="kmiyashiro" width="80" height="80"></a>
<a href="https://github.com/st-h"><img src="https://avatars1.githubusercontent.com/u/5768353?v=4" title="st-h" width="80" height="80"></a>
<a href="https://github.com/abhilashlr"><img src="https://avatars0.githubusercontent.com/u/5667722?v=4" title="abhilashlr" width="80" height="80"></a>
<a href="https://github.com/jrowlingson"><img src="https://avatars0.githubusercontent.com/u/3051781?v=4" title="jrowlingson" width="80" height="80"></a>
<a href="https://github.com/charlatan154"><img src="https://avatars2.githubusercontent.com/u/1842448?v=4" title="charlatan154" width="80" height="80"></a>
<a href="https://github.com/lxcodes"><img src="https://avatars3.githubusercontent.com/u/62131?v=4" title="lxcodes" width="80" height="80"></a>
<a href="https://github.com/blimmer"><img src="https://avatars1.githubusercontent.com/u/630449?v=4" title="blimmer" width="80" height="80"></a>
<a href="https://github.com/benmurden"><img src="https://avatars3.githubusercontent.com/u/213062?v=4" title="benmurden" width="80" height="80"></a>
<a href="https://github.com/bsclifton"><img src="https://avatars3.githubusercontent.com/u/4733304?v=4" title="bsclifton" width="80" height="80"></a>
<a href="https://github.com/caseywatts"><img src="https://avatars1.githubusercontent.com/u/273653?v=4" title="caseywatts" width="80" height="80"></a>
<a href="https://github.com/cythrawll"><img src="https://avatars2.githubusercontent.com/u/99422?v=4" title="cythrawll" width="80" height="80"></a>
<a href="https://github.com/makepanic"><img src="https://avatars3.githubusercontent.com/u/1205444?v=4" title="makepanic" width="80" height="80"></a>
<a href="https://github.com/cigoe"><img src="https://avatars3.githubusercontent.com/u/518239?v=4" title="cigoe" width="80" height="80"></a>
<a href="https://github.com/cmcclure"><img src="https://avatars2.githubusercontent.com/u/4295108?v=4" title="cmcclure" width="80" height="80"></a>
<a href="https://github.com/dcyriller"><img src="https://avatars2.githubusercontent.com/u/6677373?v=4" title="dcyriller" width="80" height="80"></a>
<a href="https://github.com/dfreeman"><img src="https://avatars2.githubusercontent.com/u/108688?v=4" title="dfreeman" width="80" height="80"></a>
<a href="https://github.com/Darshan-Chauhan"><img src="https://avatars2.githubusercontent.com/u/18572215?v=4" title="Darshan-Chauhan" width="80" height="80"></a>
<a href="https://github.com/dustinspecker"><img src="https://avatars3.githubusercontent.com/u/2449282?v=4" title="dustinspecker" width="80" height="80"></a>
<a href="https://github.com/poteto"><img src="https://avatars.githubusercontent.com/u/1390709?v=4" title="poteto" width="80" height="80"></a>
<a href="https://github.com/sbatson5"><img src="https://avatars.githubusercontent.com/u/881981?v=4" title="sbatson5" width="80" height="80"></a>
<a href="https://github.com/Dhaulagiri"><img src="https://avatars.githubusercontent.com/u/1672302?v=4" title="Dhaulagiri" width="80" height="80"></a>
<a href="https://github.com/johno"><img src="https://avatars.githubusercontent.com/u/1424573?v=4" title="johno" width="80" height="80"></a>
<a href="https://github.com/rwjblue"><img src="https://avatars.githubusercontent.com/u/12637?v=4" title="rwjblue" width="80" height="80"></a>
<a href="https://github.com/mike-north"><img src="https://avatars.githubusercontent.com/u/558005?v=4" title="mike-north" width="80" height="80"></a>
<a href="https://github.com/makepanic"><img src="https://avatars.githubusercontent.com/u/1205444?v=4" title="makepanic" width="80" height="80"></a>
<a href="https://github.com/jrjohnson"><img src="https://avatars.githubusercontent.com/u/349624?v=4" title="jrjohnson" width="80" height="80"></a>
<a href="https://github.com/XiphiasUvella"><img src="https://avatars.githubusercontent.com/u/95925015?v=4" title="XiphiasUvella" width="80" height="80"></a>
<a href="https://github.com/st-h"><img src="https://avatars.githubusercontent.com/u/5768353?v=4" title="st-h" width="80" height="80"></a>
<a href="https://github.com/Techn1x"><img src="https://avatars.githubusercontent.com/u/1049837?v=4" title="Techn1x" width="80" height="80"></a>
<a href="https://github.com/bgentry"><img src="https://avatars.githubusercontent.com/u/114033?v=4" title="bgentry" width="80" height="80"></a>
<a href="https://github.com/cowboyd"><img src="https://avatars.githubusercontent.com/u/4205?v=4" title="cowboyd" width="80" height="80"></a>
<a href="https://github.com/kmiyashiro"><img src="https://avatars.githubusercontent.com/u/71852?v=4" title="kmiyashiro" width="80" height="80"></a>
<a href="https://github.com/MrChocolatine"><img src="https://avatars.githubusercontent.com/u/47531779?v=4" title="MrChocolatine" width="80" height="80"></a>
<a href="https://github.com/wagenet"><img src="https://avatars.githubusercontent.com/u/9835?v=4" title="wagenet" width="80" height="80"></a>
<a href="https://github.com/abhilashlr"><img src="https://avatars.githubusercontent.com/u/5667722?v=4" title="abhilashlr" width="80" height="80"></a>
<a href="https://github.com/jrowlingson"><img src="https://avatars.githubusercontent.com/u/3051781?v=4" title="jrowlingson" width="80" height="80"></a>
<a href="https://github.com/jwlawrence"><img src="https://avatars.githubusercontent.com/u/488888?v=4" title="jwlawrence" width="80" height="80"></a>
<a href="https://github.com/sandydoo"><img src="https://avatars.githubusercontent.com/u/7572407?v=4" title="sandydoo" width="80" height="80"></a>
<a href="https://github.com/akisvolanis"><img src="https://avatars.githubusercontent.com/u/1842448?v=4" title="akisvolanis" width="80" height="80"></a>
<a href="https://github.com/lxcodes"><img src="https://avatars.githubusercontent.com/u/62131?v=4" title="lxcodes" width="80" height="80"></a>
<a href="https://github.com/aoumiri"><img src="https://avatars.githubusercontent.com/u/14907937?v=4" title="aoumiri" width="80" height="80"></a>
<a href="https://github.com/stukalin"><img src="https://avatars.githubusercontent.com/u/9863365?v=4" title="stukalin" width="80" height="80"></a>
<a href="https://github.com/benmurden"><img src="https://avatars.githubusercontent.com/u/213062?v=4" title="benmurden" width="80" height="80"></a>
<a href="https://github.com/bsclifton"><img src="https://avatars.githubusercontent.com/u/4733304?v=4" title="bsclifton" width="80" height="80"></a>
<a href="https://github.com/caseywatts"><img src="https://avatars.githubusercontent.com/u/273653?v=4" title="caseywatts" width="80" height="80"></a>
<a href="https://github.com/cythrawll"><img src="https://avatars.githubusercontent.com/u/99422?v=4" title="cythrawll" width="80" height="80"></a>

[//]: contributor-faces
4 changes: 1 addition & 3 deletions addon/components/flash-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import Component from '@ember/component';
import { classify } from '@ember/string';
import { htmlSafe } from '@ember/template';
import { isPresent } from '@ember/utils';
import { run } from '@ember/runloop';
import { next, cancel } from '@ember/runloop';
import { action, computed, set } from '@ember/object';
import { and, readOnly, not } from '@ember/object/computed';
import layout from '../templates/components/flash-message';

const { next, cancel } = run;

export default class FlashMessage extends Component {
tagName = '';
layout = layout;
Expand Down
26 changes: 0 additions & 26 deletions addon/utils/computed.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
import { typeOf } from '@ember/utils';
import { computed, get } from '@ember/object';
import { guidFor as emberGuidFor } from '@ember/object/internals';
import { A as emberArray } from '@ember/array';
import { isNone } from '@ember/utils';

export function add(...dependentKeys) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This computed wasn't used anymore

const computedFunc = computed({
get() {
const values = dependentKeys.map((dependentKey) => {
const value = get(this, dependentKey);

if (typeOf(value) !== 'number') {
return;
}

return value;
});

return emberArray(values)
.compact()
.reduce((prev, curr) => {
return prev + curr;
});
},
});

return computedFunc.property.apply(computedFunc, dependentKeys);
}

export function guidFor(dependentKey) {
return computed(dependentKey, {
get() {
Expand Down
22 changes: 21 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ module.exports = async function () {
},
},
},
{
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '~3.24.3',
},
},
},
{
name: 'ember-lts-3.28',
npm: {
devDependencies: {
'ember-source': '~3.28.0',
},
},
},
{
name: 'ember-release',
npm: {
Expand Down Expand Up @@ -67,7 +83,8 @@ module.exports = async function () {
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'@ember/jquery': '^1.1.0',
'ember-source': '~3.28.0',
},
},
},
Expand All @@ -81,6 +98,9 @@ module.exports = async function () {
}),
},
npm: {
devDependencies: {
'ember-source': '~3.28.0',
},
ember: {
edition: 'classic',
},
Expand Down
8 changes: 7 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@ module.exports = function (defaults) {
*/

const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
};
Loading