Skip to content

fix(zone.js): move MutationObserver/FileReader to different module#31657

Closed
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:module
Closed

fix(zone.js): move MutationObserver/FileReader to different module#31657
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:module

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Contributor

@JiaLiPassion JiaLiPassion commented Jul 19, 2019

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 new behavior?

Separate MutationObserver and FileReader to separated module, so they can be disabled separately.

Does this PR introduce a breaking change?

  • Yes
  • No

Close #36460

@JiaLiPassion JiaLiPassion requested a review from a team July 19, 2019 14:15
Copy link
Copy Markdown
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.

This looks to me as a breaking change, since now the application may stop working. @IgorMinar

@mhevery mhevery added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 22, 2019
@JiaLiPassion
Copy link
Copy Markdown
Contributor Author

@mhevery, yeah, you are right, if some developer disable EventTarget monkey patch, and before this PR, they will also disable MutationObserver and FileReader and now only EventTarget is disabled.

@mhevery mhevery added state: blocked area: zones Issues related to zone.js labels Jul 25, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Jul 25, 2019
@AndrewKushnir AndrewKushnir removed the action: merge The PR is ready for merge by the caretaker label Jan 28, 2020
@JiaLiPassion JiaLiPassion requested a review from mhevery June 15, 2020 03:55
@JiaLiPassion JiaLiPassion force-pushed the module branch 2 times, most recently from 1d11e99 to 8c7aa9f Compare June 15, 2020 06:55
@JiaLiPassion JiaLiPassion 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 26, 2020
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Jul 10, 2020

presubmit
deflake

Comment thread packages/zone.js/lib/browser/browser.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.

Since we are doing this, would it make sense to also separate IntersectionObserver? Or would that be too much granularity?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gkalpak , sure, I have separate the IntersectionObserver into another module, thanks.

@JiaLiPassion JiaLiPassion force-pushed the module branch 5 times, most recently from 276abb1 to 4dc1405 Compare July 13, 2020 14:40
Separate `EventTarget`, `FileReader`, `MutationObserver` and `IntersectionObserver` patches into different module.
So the user can disable those modules separately.
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Jul 16, 2020

@AndrewKushnir
Copy link
Copy Markdown
Contributor

AndrewKushnir commented Jul 17, 2020

Presubmit + Global Presubmit.

@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Jul 17, 2020
@AndrewKushnir AndrewKushnir modified the milestones: v10-candidates, v11-candidates Jul 17, 2020
@JiaLiPassion
Copy link
Copy Markdown
Contributor Author

@mhevery , I forget to add the information of the motivation of this PR, some use cases require to disable MutationObserver patch but still keep the EventTarget patch, such as in this issue #36460.

@AndrewKushnir
Copy link
Copy Markdown
Contributor

Quick update after running presubmit in Google's codebase:

  • there are no failing targets due to this change (which is great!)
  • I haven't found that the EventTarget patches were disabled for any apps, so this change should be pretty safe for Google's codebase

However since this is still a breaking change (for users who have the EventTarget patches disabled), this change should wait for the next major version (v11).

@mhevery please let us know if we should proceed with this change for v11.

Thank you.

@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Jul 17, 2020

@mhevery please let us know if we should proceed with this change for v11.

I have discussed this with @jelbourn and the conclusion is that we can land this in the next minor release (not patch, and no need to wait until major)

@AndrewKushnir AndrewKushnir added target: major This PR is targeted for the next major release and removed action: presubmit The PR is in need of a google3 presubmit target: patch This PR is targeted for the next patch release labels Jul 17, 2020
@AndrewKushnir
Copy link
Copy Markdown
Contributor

@JiaLiPassion just a small nit: it looks like this change is more a feature not a bugfix? May be change the commit message to feat(zone.js) ...?

@AndrewKushnir AndrewKushnir 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 Jul 20, 2020
@mhevery mhevery closed this in 253337d Jul 24, 2020
Splaktar pushed a commit to angular-hispano/angular that referenced this pull request Aug 8, 2020
…ngular#31657)

Separate `EventTarget`, `FileReader`, `MutationObserver` and `IntersectionObserver` patches into different module.
So the user can disable those modules separately.

PR Close angular#31657
@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 Aug 24, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…ngular#31657)

Separate `EventTarget`, `FileReader`, `MutationObserver` and `IntersectionObserver` patches into different module.
So the user can disable those modules separately.

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

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: zones Issues related to zone.js breaking changes 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.

Provide a way for zonejs to not patch MutationObserver

5 participants