Skip to content

feat(router): add migration for ActivatedRouteSnapshot.fragment#41092

Closed
crisbeto wants to merge 1 commit intoangular:masterfrom
crisbeto:router-fragment-migration
Closed

feat(router): add migration for ActivatedRouteSnapshot.fragment#41092
crisbeto wants to merge 1 commit intoangular:masterfrom
crisbeto:router-fragment-migration

Conversation

@crisbeto
Copy link
Copy Markdown
Member

@crisbeto crisbeto commented Mar 5, 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.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release area: migrations Issues related to `ng update`/`ng generate` migrations labels Mar 5, 2021
@crisbeto crisbeto requested a review from atscott March 5, 2021 16:16
@ngbot ngbot bot modified the milestone: Backlog Mar 5, 2021
@google-cla google-cla bot added the cla: yes label Mar 5, 2021
@pullapprove pullapprove bot requested a review from IgorMinar March 5, 2021 16:16
@crisbeto crisbeto mentioned this pull request Mar 5, 2021
14 tasks
@crisbeto crisbeto force-pushed the router-fragment-migration branch 4 times, most recently from 2a3f2c3 to 2f6e2af Compare March 5, 2021 18:05
@crisbeto crisbeto force-pushed the router-fragment-migration branch from 2f6e2af to 8bf0d97 Compare March 9, 2021 20:27
@atscott
Copy link
Copy Markdown
Contributor

atscott commented Mar 10, 2021

Hi @crisbeto, first and foremost, thanks again for taking this on! I ran this migration in g3 and it was very helpful to identify that places that needed updates. I noticed a couple things:

  • There were quite a few false positives with our strategy for the observable. A lot of the subscriptions either didn't even uses the fragment or were checking the truthy/falsey-ness of it.
  • I've noticed with this one and with other migrations that if there is a leading comment on the node we're modifying, we end up copying the comment into the migrated node, resulting in a duplicated comment
  • I'm going to send out the CLs for the remaining changes (I quickly checked each by hand and reverted a bunch). Based on the feedback from that, it might be that we should use this as a g3-only migration and let external users migrate their uses by hand. I think this should be a relatively small amount of work for those who are upgrading and the experience might be better than if we incorrectly migrate something (as noted in the first bullet point).

@crisbeto crisbeto force-pushed the router-fragment-migration branch from 8bf0d97 to 871f78a Compare March 15, 2021 16:58
@crisbeto crisbeto changed the title feat(router): add migration for ActivatedRoute.fragment and ActivatedRouteSnapshot.fragment feat(router): add migration for ActivatedRouteSnapshot.fragment 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.
@crisbeto crisbeto force-pushed the router-fragment-migration branch from 871f78a to 4420dae Compare March 15, 2021 17:17
@crisbeto
Copy link
Copy Markdown
Member Author

@atscott I've reworked the migration so that it only applies to ActivatedRouteSnapshot.fragment.

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 15, 2021
@crisbeto crisbeto added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Mar 23, 2021
Copy link
Copy Markdown
Member

@josephperrott josephperrott 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: dev-infra

@josephperrott josephperrott removed the request for review from IgorMinar March 23, 2021 16:49
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 23, 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: migrations Issues related to `ng update`/`ng generate` migrations cla: yes 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

Development

Successfully merging this pull request may close these issues.

3 participants