Visitar URL original
feat(router): add migration for ActivatedRouteSnapshot.fragment by crisbeto · Pull Request #41092 · angular/angular · GitHub
The Wayback Machine - https://web.archive.org/web/20211020111956/https://github.com/angular/angular/pull/41092
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

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

Closed
wants to merge 1 commit into from

Conversation

@crisbeto
Copy link
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 requested a review from atscott Mar 5, 2021
@ngbot ngbot bot added this to the Backlog milestone Mar 5, 2021
@ngbot ngbot bot added this to the Backlog milestone Mar 5, 2021
@ngbot ngbot bot added this to the Backlog milestone Mar 5, 2021
@google-cla google-cla bot added the cla: yes label Mar 5, 2021
@pullapprove pullapprove bot requested a review from IgorMinar Mar 5, 2021
@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 Mar 5, 2021
@crisbeto crisbeto force-pushed the router-fragment-migration branch from 2f6e2af to 8bf0d97 Mar 9, 2021
@atscott
Copy link
Contributor

@atscott 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 Mar 15, 2021
@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 Mar 15, 2021
@crisbeto
Copy link
Member Author

@crisbeto crisbeto commented Mar 15, 2021

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

Copy link
Member

@josephperrott josephperrott left a comment

LGTM

Reviewed-for: dev-infra

@josephperrott josephperrott removed the request for review from IgorMinar Mar 23, 2021
TeriGlover added a commit to TeriGlover/angular that referenced this issue 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

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Apr 23, 2021

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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants