Skip to content

refactor(core): handle #24571 todos. - #49221

Closed
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:chore/coore-24571
Closed

JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:chore/coore-24571

Conversation

@JeanMeche

@JeanMeche JeanMeche commented Feb 26, 2023 •

Copy link
Copy Markdown
Member

This commit removes the remaining TODO(issue/24571) in core code base.

In the core code base most TODOs were on spec files where it is acceptable to have non-null assertions.

See also the PRs about #24571 :

*#48241

@JeanMeche JeanMeche Feb 26, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Using @ts-expect-error instead of a type assertion improves the code navigation.

@JeanMeche JeanMeche Jun 6, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Few month have passed, I actually want to push for using the Writable type, cf #49754

@JeanMeche
JeanMeche force-pushed the chore/coore-24571 branch 2 times, most recently from fbc23b6 to 6f4f4ca Compare February 26, 2023 23:37
Comment thread packages/core/src/render/api.ts Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe it could removed in separate PR with a move of DefaultIterableDiffer to the private space.

@pkozlowski-opensource pkozlowski-opensource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@JeanMeche thnx for the PR and sorry that it took so much time to process.

I've went through 1/2 of it and I would love to discus the usage of ! for @Input fields.

Generally my thinking is that inputs (and other non-query fields) would be better off with a default value or adding undefined to the type.

My reasoning is that queries are assigned by the framework and the author of the component has full control over assign timing / usage. With @Inputs (and other fields) there are no guarantees.

It doesn't matter the whole lot but people often look at Angular tests for examples / "inspiration" so we should decide on the pattern here.

WDYT?

Comment thread packages/core/test/linker/ng_module_integration_spec.ts Outdated
Comment thread packages/core/test/linker/query_integration_spec.ts Outdated
Comment thread packages/core/test/linker/query_integration_spec.ts Outdated
Comment thread packages/core/test/linker/integration_spec.ts Outdated
Comment thread packages/core/test/linker/integration_spec.ts Outdated
Comment thread packages/core/test/linker/integration_spec.ts Outdated
Comment thread packages/core/test/linker/integration_spec.ts Outdated
Comment thread packages/core/test/linker/integration_spec.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

boolean|undefined? or inp = false?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally my thinking is that inputs (and other non-query fields) would be better off with a default value or adding undefined to the type.

My reasoning is that queries are assigned by the framework and the author of the component has full control over assign timing / usage. With @Inputs (and other fields) there are no guarantees.

It doesn't matter the whole lot in this particular case but people often look at Angular tests for examples / "inspiration" so we should decide on the pattern here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You last argument nails it for me. Every bit a code that is accessible to the devs should be of the highest standards !
I will update the PR.

@pkozlowski-opensource pkozlowski-opensource added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 6, 2023
@JeanMeche
JeanMeche force-pushed the chore/coore-24571 branch 3 times, most recently from cc9d18f to a18c887 Compare June 7, 2023 08:00

@pkozlowski-opensource pkozlowski-opensource left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: fw-core
Reviewed-for: fw-security

@pkozlowski-opensource pkozlowski-opensource added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jun 7, 2023
@dylhunn
dylhunn self-requested a review June 10, 2023 01:02

@dylhunn dylhunn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs one more fw-security approval. Perhaps @josephperrott can provide the stamp? It's basically a no-op in that regard.

@alxhub alxhub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed-for: fw-security

@alxhub alxhub removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 12, 2023
@pkozlowski-opensource pkozlowski-opensource added the action: merge The PR is ready for merge by the caretaker label Jun 13, 2023
@pkozlowski-opensource

Copy link
Copy Markdown
Member

@JeanMeche it looks like this PR will need a rebase after the recent merges of your other PR :-)

@pkozlowski-opensource pkozlowski-opensource added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jun 14, 2023
This commit removes the remaining TODO(issue/24571) in core code base.
@JeanMeche
JeanMeche force-pushed the chore/coore-24571 branch from a18c887 to 9a770e6 Compare June 14, 2023 09:08
@JeanMeche

Copy link
Copy Markdown
Member Author

@pkozlowski-opensource There you go ! You can merge it now =)

@pkozlowski-opensource pkozlowski-opensource removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jun 14, 2023
@pkozlowski-opensource

Copy link
Copy Markdown
Member

Thnx @JeanMeche !

@pkozlowski-opensource pkozlowski-opensource added action: presubmit The PR is in need of a google3 presubmit and removed action: presubmit The PR is in need of a google3 presubmit labels Jun 14, 2023
@pkozlowski-opensource

Copy link
Copy Markdown
Member

This PR was merged into the repository by commit 8d42747.

pkozlowski-opensource pushed a commit that referenced this pull request Jun 14, 2023
This commit removes the remaining TODO(issue/24571) in core code base.

PR Close #49221
@JeanMeche
JeanMeche deleted the chore/coore-24571 branch June 27, 2023 21:26
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 28, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
This commit removes the remaining TODO(issue/24571) in core code base.

PR Close angular#49221
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants