Skip to content

chore: migrate app to Angular 8#3

Open
christophechevalier wants to merge 1 commit intomaxime1992:masterfrom
christophechevalier:upgrade-to-angular8
Open

chore: migrate app to Angular 8#3
christophechevalier wants to merge 1 commit intomaxime1992:masterfrom
christophechevalier:upgrade-to-angular8

Conversation

@christophechevalier
Copy link

  • 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

@christophechevalier
Copy link
Author

Hey @maxime1992 !
What is the news about my PR ?

Copy link
Owner

@maxime1992 maxime1992 left a 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",
Copy link
Owner

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"

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",
Copy link
Owner

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

Choose a reason for hiding this comment

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

Updated.

"dist": "ng build",
"prod": "ng build --prod",
"prod:src": "ng build --prod --sourcemaps"
},
Copy link
Owner

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?

Copy link
Author

@christophechevalier christophechevalier Jul 12, 2019

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.

Copy link
Owner

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

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.

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?

Copy link
Owner

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
"start": "ng serve",
"test": "ng test",
"lint": "ng lint",
"pree2e": "webdriver-manager update --standalone false --gecko false",
Copy link
Owner

Choose a reason for hiding this comment

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

Why is that needed?

Choose a reason for hiding this comment

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

Removed.

"material-design-icons-iconfont": "5.0.1",
"rxjs": "6.5.0",
"zone.js": "0.9.1"
},
Copy link
Owner

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

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[]) => {
Copy link
Owner

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

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[]) => {
Copy link
Owner

Choose a reason for hiding this comment

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

Merge the 3 taps in one please

Choose a reason for hiding this comment

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

Updated.

.do(grade =>
this.playersService.changeUserGrade(player.name, +grade)
);
filter(grade => grade),
Copy link
Owner

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

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.

this.isNewPlayerFormGroupVisible = true;
setTimeout(() => this.nameNewPlayer.focus(), 0);
setTimeout(
() => this.renderer.selectRootElement('#nameNewPlayer').focus(),
Copy link
Owner

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:

Choose a reason for hiding this comment

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

Removed.

}

trackByName(index, player: IPlayer) {
trackByName(player: IPlayer) {
Copy link
Owner

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants