-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[angular] Reduce event manager importance and usage #13111
Conversation
As there is not possible to apply strict type checking if using event manager then this usage should not be encouraged. So moved this to util subfolder instead of separate folder and put model to the same file where is service to reduce event manager visibility and importance. Added also strict types instead of any to event manager. Now consumers must do type cast - so if they use event manager they take a conscious risk. Added block "unreleased files and folders cleanup for v7 developers" to cleanup to delete files if developers regenerate with newer version in v7 development cycle.
@kaidohallik no problem, will close the other PR. |
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.
LGTM
import { <%_ if (pagination !== 'no') { _%>HttpHeaders, <% } %>HttpResponse } from '@angular/common/http'; | ||
<%_ if (pagination === 'pagination') { _%> | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { combineLatest } from 'rxjs'; |
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.
this import seems unused
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.
Looks right. Wondering why eslint didn’t complained.
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.
This is used in pagination-template
, so this import is needed and is under right condition.
This is migrated from deleted row below.
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.
indeed ;)
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.
LGTM
This is follow up to #13096 - after thinking deeper about event manager and using ideas from #13073.
As there is not possible to apply strict type checking if using event manager then this usage should not be encouraged. So moved this to
util
subfolder instead of separate folder and put model to the same file where is service to reduce event manager visibility and importance.Added also strict types instead of
any
to event manager. Now consumers must do type cast - so if they use event manager they take a conscious risk.Added block "unreleased files and folders cleanup for v7 developers" to cleanup to delete files if developers regenerate with newer version in v7 development cycle.
This PR has 3 commits:
@DanielFran : last commit in this PR is related to your PR #13073 - it basically implements suggestion from #13073 (comment), if you disagree with last commit and want to do changes yourself then I can drop last commit and let this to you.
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.