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

refactor(all): enable strictPropertyInitialization in TsConfig and fix the affected code #29

Conversation

christophercr
Copy link
Collaborator

@christophercr christophercr commented Oct 29, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[X] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The strictPropertyInitialization rule is disabled in our tsconfig, so this is not aligned to the compilation rules used in the other NBB packages i.e. Stark.

What is the new behavior?

The strictPropertyInitialization rule is now enabled and all the affected code has been adapted to comply with it.

Does this PR introduce a breaking change?

[ ] Yes
[X] No

@christophercr
Copy link
Collaborator Author

christophercr commented Oct 29, 2019

@nicanac once this PR is merged, I think you can release the next beta version 😉

Copy link
Contributor

@nicanac nicanac left a comment

Choose a reason for hiding this comment

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

LGTM, nice

@nicanac
Copy link
Contributor

nicanac commented Oct 29, 2019

@nicanac once this PR is merged, I think you can release the next beta version 😉

ok, nice, thanks

public ngOnInit(): void {
console.log(componentName + ": controller initialized");

public constructor(protected translateService: TranslateService) {
this.selectedLanguage = this.translateService.currentLang;

this.languageChangeSubscription = this.translateService.onLangChange.subscribe(
Copy link
Member

Choose a reason for hiding this comment

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

Small question, in the file "src/app/app.component.ts", you keep the subscriptions in the ngOnInit().
Here, you move them in the constructor. Why ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I thought it might be better to keep those subscriptions in the ngOnInit in the AppComponent because they are related to the BreakpointObserver... which is about the media queries stuff and maybe doing that in the constructor is too soon cause the component is not rendered yet...

But that is just a guess... I have no strong opinion about it... maybe I can simply move them to the constructor too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@SuperITMan I've updated the AppComponent to move the subscriptions to the constructor and it seems to work fine. So it is now consistent with the other components 😉

Copy link
Member

Choose a reason for hiding this comment

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

Okido 😊
I didn't think to the BreakpointObserver but if it works correctly in the constructor(), it's fine.
I think this library is ready to be released in "1.0.0" 😃

What do you think @nicanac @christophercr ? 😊

Copy link
Collaborator Author

@christophercr christophercr Oct 29, 2019

Choose a reason for hiding this comment

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

Mmm not sure if we should release "1.0.0"... maybe an RC? It is just because there are 2 tasks that we can still work on for the final release: issues 28 and 21

What do you guys think? Or... we could also release those in "1.1.0"...

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think we can do an RC.

Copy link
Member

Choose a reason for hiding this comment

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

Okido ! Let's go for the RC 😊

@christophercr christophercr force-pushed the feature/ts-strict-property-initialization branch from a14a7ee to 843d739 Compare October 29, 2019 11:51
@christophercr christophercr merged commit 215d9ee into NationalBankBelgium:master Oct 29, 2019
@christophercr christophercr deleted the feature/ts-strict-property-initialization branch October 29, 2019 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: all comp: qa Quality assurance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants