Skip to content

Commit 464dae9

Browse files
atscottAndrewKushnir
authored andcommitted
docs: small updates to zoneless docs (angular#55636)
PR Close angular#55636
1 parent 8f273ce commit 464dae9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adev/src/content/guide/zoneless.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The main advantages to removing ZoneJS as a dependency are:
77
- **Improved performance**: ZoneJS uses DOM events and async tasks as indicators of when application state _might_ have updated and subsequently triggers application synchronization to run change detection on the application's views. ZoneJS does not have any insight into whether application state actually changed and so this synchronization is triggered more frequently than necessary.
88
- **Improved Core Web Vitals**: ZoneJS brings a fair amount of overhead, both in payload size and in startup time cost.
99
- **Improved debugging experience**: ZoneJS makes debugging code more difficult. Stack traces are harder to understand with ZoneJS. It's also difficult to understand when code breaks as a result of being outside the Angular Zone.
10-
- **Better ecosystem compatibility**: (new browser APIs, native async await, patching can conflict with libraries and other frameworks, maintainability, etc)
10+
- **Better ecosystem compatibility**: ZoneJS works by patching browser APIs but does not automatically have patches for every new browser API. Some APIs simply cannot be patched effectively, such as `async`/`await`, and have to be downleveled to work with ZoneJS. Sometimes libraries in the ecosystem are also incompatible with the way ZoneJS patches the native APIs. Removing ZoneJS as a dependency ensures better long-term compatibility by removing a source of complexity, monkey patching, and ongoing maintenance.
1111

1212
## Enabling Zoneless in an application
1313

@@ -83,9 +83,11 @@ familiar and have similar timing to what was needed. More straightforward or dir
8383
such as `MutationObserver` when code needs to wait for certain DOM state (rather than waiting for it indirectly
8484
through Angular's render hooks).
8585

86+
<docs-callout title="NgZone.run and NgZone.runOutsideAngular are compatible with Zoneless">
8687
`NgZone.run` and `NgZone.runOutsideAngular` do not need to be removed in order for code to be compatible with
8788
Zoneless applications. In fact, removing these calls can lead to performance regressions for libraries that
8889
are used in applications that still rely on ZoneJS.
90+
</docs-callout>
8991

9092
### `ExperimentalPendingTasks` for Server Side Rendering (SSR)
9193

0 commit comments

Comments
 (0)