Skip to content

Commit a0b3863

Browse files
authored
Ember upgrade 2.14.0 -> 2.18.2 (#657)
* Fix livereload connection issue * Ember v2.14.0...v2.18.2 * Set port back to 4300 * Bring back test-helper.js resolver business * Update ember-social-share for ember-cli-babel update * Turn off some lint rules to prevent test failures * Use brace expansion per linter rules * Resolve unused constants and missing ones * Fix no function prototype extension https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-function-prototype-extensions.md * Disable no side effects rule for now * Update active-model-adapter for ember-cli-bable deprecation * Fix deprecation warning in tests DEPRECATION: `setResolver` should be imported from `@ember/test-helpers`, but was imported from `ember-qunit` [deprecation id: ember-qunit.deprecated-reexports.setResolver] * Update ember-cli-bourbon for babel deprecation fix * Update emter-time-field to 0.3 for babel deprecation * Update ember-power-select to 1.10 for babel and bunch other fixes This is the last version before the next major release which has some breaking changes that we may need to address * Update ember-i18n for babel deprecation fix Last release before it was archived. Look into migrating to ember-intl * Update ember-simple-auth for bump in deps and misc fixes * Make engine match what node-sass supports node-sass complains a lot when being built against 12.22.6. https://github.com/sass/node-sass shows that the supported version for node-sass 7 is at least node 14 so we'll add it to the list of engines * Use node 14 for development * Update actions to ue matrix for new node version * Add CI for next Node versions for fun * Fix running tests in Node 14 and phantomJS * Update bower to latest release * Update node-sass to 7.0.3 * Update ember-ajax * Add some script helpers * Update ember-cli-sass for latest version prior to move to dartsass
1 parent 42c2220 commit a0b3863

30 files changed

+16722
-22578
lines changed

.github/workflows/frontend.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
- main
1111
- master
1212

13-
env:
14-
NODE_VERSION: 12.22.6
15-
1613
jobs:
1714
changes:
1815
runs-on: ubuntu-latest
@@ -33,21 +30,51 @@ jobs:
3330
- 'frontend/**'
3431
- '.github/workflows/**'
3532
36-
test-app:
33+
npm-test:
34+
strategy:
35+
matrix:
36+
node_version: ['12.22.6', '14.21']
37+
needs: changes
38+
if: ${{ needs.changes.outputs.frontend == 'true' }}
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 7
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: actions/setup-node@v2
44+
with:
45+
node-version: ${{ matrix.node_version }}
46+
cache: npm
47+
cache-dependency-path: frontend/package-lock.json
48+
- run: npm install -g npm@7.0.0
49+
- run: npm install
50+
working-directory: ./frontend
51+
- run: npm run test
52+
working-directory: ./frontend
53+
54+
node-next-test:
55+
strategy:
56+
matrix:
57+
node_version: ['16', '18', '20']
3758
needs: changes
3859
if: ${{ needs.changes.outputs.frontend == 'true' }}
39-
name: Test app
4060
runs-on: ubuntu-latest
4161
timeout-minutes: 7
4262
steps:
4363
- uses: actions/checkout@v2
4464
- uses: actions/setup-node@v2
4565
with:
46-
node-version: ${{ env.NODE_VERSION }}
66+
node-version: ${{ matrix.node_version }}
4767
cache: npm
4868
cache-dependency-path: frontend/package-lock.json
4969
- run: npm install -g npm@7.0.0
5070
- run: npm install
5171
working-directory: ./frontend
5272
- run: npm run test
5373
working-directory: ./frontend
74+
75+
test-app:
76+
name: Test app
77+
needs: [ npm-test ]
78+
runs-on: ubuntu-latest
79+
steps:
80+
- run: echo "done"

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ services:
4747
- backend
4848
ports:
4949
- 4300:4300
50+
- 65535:65535
5051
volumes:
5152
- ./frontend:/app
52-
command: sh -c "cd /app && rm -rfd ./dist && ./node_modules/.bin/ember serve --port 4300 --proxy http://backend:3000"
53+
command: sh -c "cd /app && rm -rfd ./dist && ./node_modules/.bin/ember serve --port 4300 --proxy http://backend:3000 --live-reload-host frontend --live-reload-port 65535"
5354
profiles:
5455
- dev
5556
app-setup:

frontend/.eslintrc.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,54 @@ module.exports = {
44
ecmaVersion: 2017,
55
sourceType: 'module'
66
},
7-
extends: 'eslint:recommended',
7+
plugins: [
8+
'ember'
9+
],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:ember/recommended'
13+
],
814
env: {
915
browser: true
1016
},
1117
rules: {
18+
'ember/new-module-imports': 'off',
19+
'ember/avoid-leaking-state-in-ember-objects': 'off',
20+
'ember/no-on-calls-in-components': 'off',
21+
'ember/closure-actions': 'off',
22+
'ember/no-side-effects': 'off',
1223
},
1324
globals: {
1425
d3: true,
1526
moment: true,
1627
'Pusher': true
17-
}
28+
},
29+
overrides: [
30+
// node files
31+
{
32+
files: [
33+
'testem.js',
34+
'ember-cli-build.js',
35+
'config/**/*.js',
36+
'lib/*/index.js'
37+
],
38+
parserOptions: {
39+
sourceType: 'script',
40+
ecmaVersion: 2015
41+
},
42+
env: {
43+
browser: false,
44+
node: true
45+
}
46+
},
47+
48+
// test files
49+
{
50+
files: ['tests/**/*.js'],
51+
excludedFiles: ['tests/dummy/**/*.js'],
52+
env: {
53+
embertest: true
54+
}
55+
}
56+
]
1857
};

frontend/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 node:12.22.6
1+
FROM --platform=linux/amd64 node:14.21
22

33
# Force npm version 7
44
RUN npm i -g npm@7
@@ -9,6 +9,9 @@ COPY package*.json bower.json .bowerrc .npmrc ./
99

1010
RUN npm install
1111

12+
# May no be needed in future version of node
13+
ENV OPENSSL_CONF=/dev/null
14+
1215
COPY . .
1316

1417
CMD ["npm", "start"]

frontend/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ You will need the following things properly installed on your computer.
1212
* [Bower](http://bower.io/)
1313
* [Ember CLI](http://ember-cli.com/)
1414
* [PhantomJS](http://phantomjs.org/)
15+
* [Google Chrome](https://google.com/chrome/)
1516

1617
## Installation
1718

@@ -23,7 +24,9 @@ You will need the following things properly installed on your computer.
2324
## Running / Development
2425

2526
* `ember serve`
27+
2628
* Visit your app at [http://localhost:4300](http://localhost:4300).
29+
* Visit your tests at [http://localhost:4300/tests](http://localhost:4300/tests).
2730

2831
## Running / Development via Fastboot server
2932

@@ -49,8 +52,9 @@ Specify what it takes to deploy your app.
4952

5053
## Further Reading / Useful Links
5154

52-
* [ember.js](http://emberjs.com/)
53-
* [ember-cli](http://ember-cli.com/)
55+
* [ember.js](https://emberjs.com/)
56+
* [ember-cli](https://ember-cli.com/)
57+
5458
* Development Browser Extensions
5559
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
5660
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)

frontend/app/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import Ember from 'ember';
1+
import Application from '@ember/application';
22
import Resolver from './resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from './config/environment';
55

6-
let App;
7-
8-
App = Ember.Application.extend({
6+
const App = Application.extend({
97
modulePrefix: config.modulePrefix,
108
podModulePrefix: config.podModulePrefix,
119
Resolver

frontend/app/components/checkin/trackables-step.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default Component.extend(TrackablesFromType, {
3333
return moment(this.get('checkin.date')).isSame(new Date(), 'day');
3434
}),
3535

36-
sortedTrackeds: computed('trackeds.[]', 'trackeds.@each.position', function() {
36+
sortedTrackeds: computed('trackeds.{[],@each.position}', function() {
3737
return this.get('trackeds').toArray().sortBy('position');
3838
}),
3939

frontend/app/components/data-export-initiator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default Component.extend({
77
tagName: '',
88
apiHost: ENV.apiHost,
99

10-
authHeader: computed('session.data.authenticated.token', 'session.currentUser.email', function() {
10+
authHeader: computed('session.{data.authenticated.token,currentUser.email}', function() {
1111
return `Token token="${get(this, 'session.data.authenticated.token')}", ` +
1212
`email="${get(this, 'session.currentUser.email')}"`;
1313
}),

frontend/app/components/form-field.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ export default Ember.Component.extend({
77

88
model: Ember.computed.alias('parentView.for'),
99

10-
shouldAlwaysBeWithinAFormForComponent: function() {
10+
didInsertElement() {
1111
Ember.run.scheduleOnce('afterRender', () => {
1212
var parentView = this.get('parentView');
1313
var elementId = this.get('elementId');
1414
Ember.assert("FormFieldComponent (element ID: " + elementId + ") must have a parent view in order to yield.", parentView);
1515
Ember.assert("FormFieldComponent (element ID: " + elementId + ") should be inside a FormForComponent.", FormForComponent.detectInstance(parentView));
1616
});
17-
}.on('didInsertElement'),
17+
},
1818

1919

20-
hasError: function() {
20+
hasError: Ember.computed('model.errors.[]', function() {
2121
var ref;
2222
if ((ref = this.get('model.errors')) != null) {
2323
return ref.has(this.get('for'));
2424
} else {
2525
return false;
2626
}
27-
}.property('model.errors.[]'),
27+
}),
2828

2929
errorClass: Ember.computed('hasError', function() {
3030
if (this.get('hasError')) {
@@ -34,9 +34,9 @@ export default Ember.Component.extend({
3434
}
3535
}),
3636

37-
errors: function() {
37+
errors: Ember.computed('model.errors.[]', function() {
3838
var errors = this.get('model.errors');
3939
return errors.errorsFor(this.get('for')).mapBy('message').join(', ');
40-
}.property('model.errors.[]')
40+
})
4141

4242
});

frontend/app/components/posts/activity-notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default Component.extend({
3131
return get(this, 'notification.kind') === 'comment' ? 'responded' : 'reacted';
3232
}),
3333

34-
fullResponse: computed('people', 'notification.kind', 'notification.notifier_username', function() {
34+
fullResponse: computed('people', 'notification.{kind,notifier_username}', function() {
3535
if(get(this, 'notification.kind') === 'mention') {
3636

3737
return (`<b>${get(this, 'notification.notifier_username')}</b> mentioned you in a comment` ).htmlSafe();

0 commit comments

Comments
 (0)