Skip to content

fix(router): fragment can be null#37336

Closed
MatthiasKunnen wants to merge 1 commit intoangular:masterfrom
MatthiasKunnen:issue-23894-fragment-nullable
Closed

fix(router): fragment can be null#37336
MatthiasKunnen wants to merge 1 commit intoangular:masterfrom
MatthiasKunnen:issue-23894-fragment-nullable

Conversation

@MatthiasKunnen
Copy link
Copy Markdown
Contributor

@MatthiasKunnen MatthiasKunnen commented May 28, 2020

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)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

ActivatedRoute.fragment is typed as Observable<string> but can emit both null and undefined due to incorrect non-null assertions.

Issue Number: #23894, #34197.

What is the new behavior?

The non-null assertions have been removed and fragment has been retyped to string | null. undefined fragments will no longer occur.

Does this PR introduce a breaking change?

  • Yes
  • No

BREAKING CHANGE:
Strict null checks will report on fragment potentially being null.
Migration path: add null check.

Other information

Fixes #23894, fixes #34197, fixes #29391.
Supersedes #37334, #29819.

@MatthiasKunnen MatthiasKunnen force-pushed the issue-23894-fragment-nullable branch from 2c7b47f to deb0a53 Compare May 28, 2020 20:43
@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

@atscott, this is the superseding PR.

@pullapprove pullapprove bot requested a review from atscott May 29, 2020 01:36
@MatthiasKunnen MatthiasKunnen force-pushed the issue-23894-fragment-nullable branch from deb0a53 to 69c309d Compare May 29, 2020 12:08
@pullapprove pullapprove bot requested a review from IgorMinar May 29, 2020 12:08
@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

I just updated the golden file, forgot that yesterday.

@atscott atscott added area: router target: major This PR is targeted for the next major release labels May 29, 2020
@ngbot ngbot bot added this to the needsTriage milestone May 29, 2020
Copy link
Copy Markdown
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this and putting the breaking change footer in! LGTM with some small change requests.

As this is a breaking change, we'll need to wait until v11

@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

Made changes as requested

@atscott
Copy link
Copy Markdown
Contributor

atscott commented May 29, 2020

Ah, looks like your second commit doesn't have a commit message body that satisfies the 100 character requirement. Maybe squash your commits into one and just use the first?

@atscott
Copy link
Copy Markdown
Contributor

atscott commented May 29, 2020

Adding blocked flag, as we'll need a migration plan and have to wait for v11.

@MatthiasKunnen MatthiasKunnen force-pushed the issue-23894-fragment-nullable branch from 532e76c to 799ba4a Compare May 29, 2020 16:00
@atscott atscott modified the milestones: needsTriage, v11-candidates May 29, 2020
Copy link
Copy Markdown
Contributor

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: public-api

@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

Is there a reason this was not part of the Angular 11 release?

@atscott atscott modified the milestones: v11-candidates, v12-candidates Nov 20, 2020
@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

Resolved conflicts

@crisbeto
Copy link
Copy Markdown
Member

crisbeto commented Mar 5, 2021

Migration PR: #41092.

crisbeto added a commit to crisbeto/angular that referenced this pull request Mar 15, 2021
Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable.

Also moves some code from the `AbstractControl.parent` migration so that it can be reused.

Relates to angular#37336.
@atscott
Copy link
Copy Markdown
Contributor

atscott commented Mar 15, 2021

global presubmit (not triggered, will need to run manually after hours)

@atscott
Copy link
Copy Markdown
Contributor

atscott commented Mar 19, 2021

global presubmit

@atscott atscott added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews state: blocked labels Mar 19, 2021
@atscott
Copy link
Copy Markdown
Contributor

atscott commented Mar 19, 2021

caretaker note: please merge and sync this one on its own. g3 cleanup has been performed but things may have changed since then.

Copy link
Copy Markdown
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@MatthiasKunnen
Copy link
Copy Markdown
Contributor Author

If you need me to do anything; rebase, ... let me know

@mhevery mhevery closed this in b555160 Mar 22, 2021
josephperrott pushed a commit that referenced this pull request Mar 23, 2021
Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable.

Also moves some code from the `AbstractControl.parent` migration so that it can be reused.

Relates to #37336.

PR Close #41092
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Apr 5, 2021
ActivatedRoute.fragment was typed as Observable<string> but could emit
both null and undefined due to incorrect non-null assertion. These
non-null assertions have been removed and fragment has been retyped to
string | null.

BREAKING CHANGE:
Strict null checks will report on fragment potentially being null.
Migration path: add null check.

Fixes angular#23894, fixes angular#34197.

PR Close angular#37336
TeriGlover pushed a commit to TeriGlover/angular that referenced this pull request Apr 5, 2021
…lar#41092)

Adds a migration that casts the value of `ActivatedRouteSnapshot.fragment` to be non-nullable.

Also moves some code from the `AbstractControl.parent` migration so that it can be reused.

Relates to angular#37336.

PR Close angular#41092
@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 Apr 22, 2021
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: router breaking changes cla: yes cross-cutting: types merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release

Projects

None yet

7 participants