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

docs: fix #19989, add zone flags(blacklist/module) in guide #21701

Closed
wants to merge 1 commit into from

Conversation

JiaLiPassion
Copy link
Contributor

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
[x] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #19989

What is the new behavior?

add document for zone.js flags.

  • // __Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
  • // __Zone_disable_blocking = true; // disable patch (alert/prompt/confirm)
  • // __Zone_disable_XHR = true; // disable patch XMLHttpRequest
  • // __Zone_disable_geolocation = true; // disable patch geolocation
  • // __Zone_disable_PromiseRejectionEvent = true; // disable trigger promise rejection event
  • // __zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@mary-poppins
Copy link

You can preview f7afee2 at https://pr21701-f7afee2.ngbuilds.io/.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

I asked @mhevery to review the other recommendations

@@ -610,16 +610,23 @@ computed with the <a href="http://closure-compiler.appspot.com/home">closure com
{@a non-cli}
## Polyfills for non-CLI users

If you aren't using the CLI, you should add your polyfill scripts directly to the host web page (`index.html`), perhaps like this.
If you aren't using the CLI, you should add your polyfill scripts directly to the host web page (`index.html`), perhaps like this. Before loading zone.js, you can also configure some flags which can disable zone interception for some asynchronous activities to improve performance.
Copy link
Contributor

Choose a reason for hiding this comment

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

this reads kind of poorly. could you move this sentence into a comment that would be part of the snippet below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IgorMinar , got it, I will move it.

@mary-poppins
Copy link

You can preview 71fa7f4 at https://pr21701-71fa7f4.ngbuilds.io/.

&lt;script>
/**
* you can configure some zone flags which can disable zone interception for some
* asynchronous activities to improve performance.
Copy link
Contributor

Choose a reason for hiding this comment

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

... improve startup performance - use these options only if you know what you are doing as it could result in hard to trace down bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IgorMinar , got it, I will update it, thank you.

// __Zone_disable_XHR = true; // disable patch XMLHttpRequest
// __Zone_disable_geolocation = true; // disable patch geolocation
// __Zone_disable_PromiseRejectionEvent = true; // disable trigger promise rejection event
// __zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
Copy link
Contributor

Choose a reason for hiding this comment

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

I talked to @mhevery and we think that reducing the list only to "on" events, request animation frame, and BLACK_LISTED_EVENTS would be generally more useful. the other settings don't make a big difference in practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@IgorMinar , got it, I will update it.

@mary-poppins
Copy link

You can preview 6ce315c at https://pr21701-6ce315c.ngbuilds.io/.

@IgorMinar
Copy link
Contributor

thanks!!

@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jan 23, 2018
@mhevery mhevery closed this in e82812b Jan 23, 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
@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 aio: preview cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants