-
Notifications
You must be signed in to change notification settings - Fork 3
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
chore: migrate app to Angular 8 #3
base: master
Are you sure you want to change the base?
chore: migrate app to Angular 8 #3
Conversation
christophechevalier
commented
Jun 18, 2019
- upgrade all dependencies
- update typescript files to use new rxjs 6 syntax
- update and reorganize all imports modules
- update the names of the classes used in all templates
- remove some scripts in package.json like prettier temporarly (need fix)
- fix: auto focus input with using custom renderer to bypass Angular's templating and make custom UI changes
- cleaning some parts of the code
Hey @maxime1992 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for the PR that's great :) !
A few things to modify though but nothing really difficult
package.json
Outdated
"description": "Angular app to help you generate optimized teams for a sport (ex football).", | ||
"keywords": [ | ||
"angular", | ||
"angular 8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove that one "angular 8"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
package.json
Outdated
"keywords": [ | ||
"angular", | ||
"angular 8", | ||
"ngx-webstorage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that ngx-webstorage
is relevant in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
"prepush": "yarn run lint:check" | ||
"dist": "ng build", | ||
"prod": "ng build --prod", | ||
"prod:src": "ng build --prod --sourcemaps" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine removing lint-staged and the pre-commit hook.
But why have you removed prettier? The linting commands too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxime1992 Updated but as I say, team.component.scss
and need-10-players.component.ts
seems cause problem with Prettier
. And I can't push without validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that you haven't been able to push those files or that it will fail on CI?
Push them using --no-verify (from memory) and I'll take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed with --no-verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxime1992 Did you take a look for prettier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really and to be honest I don't have much time for this project.
I think you should just work on your own fork =) !
package.json
Outdated
"license": "MIT", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"test": "ng test", | ||
"lint": "ng lint", | ||
"pree2e": "webdriver-manager update --standalone false --gecko false", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
"js-combinatorics": "0.5.4", | ||
"material-design-icons-iconfont": "5.0.1", | ||
"rxjs": "6.5.0", | ||
"zone.js": "0.9.1" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngx-webstorage
is a dependency, not a dev one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
.pipe( | ||
takeUntil(this.onDestroy$), | ||
tap((players: IPlayer[]) => this.updateFormControl(players)), | ||
tap((players: IPlayer[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge both tap
in one please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
.pipe( | ||
takeUntil(this.onDestroy$), | ||
tap((players: IPlayer[]) => this.updateFormControl(players)), | ||
tap((players: IPlayer[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge the 3 tap
s in one please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
src/app/players/players.component.ts
Outdated
.do(grade => | ||
this.playersService.changeUserGrade(player.name, +grade) | ||
); | ||
filter(grade => grade), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write that one as
filter(grade => !!grade)
that'll be clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I can do that.
src/app/players/players.component.ts
Outdated
@@ -143,7 +149,10 @@ export class PlayersComponent implements OnInit, OnDestroy { | |||
|
|||
openNewPlayerForm() { | |||
this.isNewPlayerFormGroupVisible = true; | |||
setTimeout(() => this.nameNewPlayer.focus(), 0); | |||
setTimeout( | |||
() => this.renderer.selectRootElement('#nameNewPlayer').focus(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not convinced that's needed :think:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
src/app/players/players.component.ts
Outdated
@@ -160,7 +169,7 @@ export class PlayersComponent implements OnInit, OnDestroy { | |||
this.playersService.removePlayer(player.name); | |||
} | |||
|
|||
trackByName(index, player: IPlayer) { | |||
trackByName(player: IPlayer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using trackBy, the first argument is the index so that's a regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
- upgrade all dependencies - update typescript files to use new rxjs 6 syntax - update and reorganize all imports modules - update the names of the classes used in all templates - remove some scripts in package.json like prettier temporarly (need fix) - fix: auto focus input with using custom renderer to bypass Angular's templating and make custom UI changes - cleaning some parts of the code
40d4793
to
22b5c1b
Compare