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

fix(core): fix #20582, don't need to wrap zone in location change listener #20640

Closed
wants to merge 1 commit into from

Conversation

JiaLiPassion
Copy link
Contributor

@JiaLiPassion JiaLiPassion commented Nov 27, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] 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?

Issue Number: 20582

What is the new behavior?

remove Zone.current.wrap in router.ts when setUpLocationChangeListener, because
zone.js already patch onPopState, so location change listener will always run in ngZone.
https://github.com/angular/angular/blob/master/packages/common/src/location/location.ts#L55

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@mhevery mhevery self-requested a review November 27, 2017 21:01
@mhevery mhevery added the area: core Issues related to the framework runtime label Nov 27, 2017
Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

I would much rather remove the reference to Zone 25e5b2f#diff-7f0963cbc503a361ded7d2bfec5f01b9R386 rather than trying to create a mock. Could we do that instead?

@JiaLiPassion
Copy link
Contributor Author

@mhevery , sure, I will try to rewrite it.
And I will also check the other code, such as animation_renderer to make sure all Zone.current be handled correctly under NoopNgZone.

@JiaLiPassion JiaLiPassion changed the title WIP(core): make a NoopZone implementation for NoopNgZone fix(core): fix #20582, don't need to wrap zone in location change listener Nov 28, 2017
@JiaLiPassion
Copy link
Contributor Author

@mhevery , I have checked the source, and I think because zone.js already patch popstate, so we don't need to use Zone.current.wrap in router any longer,
here is the issue that why use Zone.current.wrap, #10096, I have created a sample application to test, without Zone.current.wrap, in safari/IE11, the back button will work as normal, and the code of ngOnit() will be called in ngZone.

Please review. thank you.

@jasonaden jasonaden added area: router action: review The PR is still awaiting reviews from at least one requested reviewer and removed area: core Issues related to the framework runtime labels Nov 30, 2017
@jasonaden jasonaden self-requested a review November 30, 2017 23:31
@mohammedzamakhan
Copy link

Any updates on this PR??

@ngbot
Copy link

ngbot bot commented Jan 30, 2018

Hi @JiaLiPassion! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

1 similar comment
@ngbot
Copy link

ngbot bot commented Jan 30, 2018

Hi @JiaLiPassion! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@mhevery mhevery added target: patch This PR is targeted for the next patch release and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 30, 2018
@mhevery mhevery self-assigned this Jan 30, 2018
@mhevery
Copy link
Contributor

mhevery commented Jan 30, 2018

@JiaLiPassion could you rebase this on master so that we can get this in.

@JiaLiPassion
Copy link
Contributor Author

@mhevery , I have rebased the PR, please review, thank you!

@mhevery mhevery added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Jan 31, 2018
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Feb 1, 2018
@alxhub alxhub added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Feb 2, 2018
@alxhub alxhub assigned jasonaden and unassigned mhevery Feb 2, 2018
@alxhub
Copy link
Member

alxhub commented Feb 2, 2018

Greetings from your friendly neighborhood Angular caretaker, @jasonaden @JiaLiPassion,

This is targeted to both master and the patch branch, but doesn't cleanly apply on the patch branch. Can you please split the PR into two, one against master and the other against the patch branch?

Thanks,
Alex

@JiaLiPassion
Copy link
Contributor Author

@alxhub , thank you for review, I am not sure how to do to split the PR to different branch, could you tell me more?

@alxhub
Copy link
Member

alxhub commented Feb 2, 2018

@JiaLiPassion sure thing! When you create a branch locally, you typically start on master. To create one for the patch branch, you'll want to start on 5.2.x instead, then in Github when you make the PR, that becomes your target branch.

@mhevery mhevery added target: major This PR is targeted for the next major release action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: patch This PR is targeted for the next patch release labels Feb 2, 2018
@mhevery
Copy link
Contributor

mhevery commented Feb 2, 2018

I have changed the target to master only. @JiaLiPassion Please create an we PR and rebase it on top of 5.2.x branch and resubmit.

@JiaLiPassion
Copy link
Contributor Author

@mhevery , @alxhub, thank you! I have created a PR which target 5.2.x, #22007. please review.

@alxhub alxhub closed this in f791e9f Feb 5, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
jmleoni pushed a commit to jmleoni/angular that referenced this pull request Oct 6, 2018
@angular-automatic-lock-bot
Copy link

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 Sep 13, 2019
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 cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants