angular: when use zone.js & ant design, the page will Endless loop
š bug report
Affected Package
The issue is caused by package @angular/zone.jsIs this a regression?
0.11
Description
when use select tooltip popover, th page will in Endless loop https://github.com/ant-design/ant-design/issues/28537
š¬ Minimal Reproduction
https://codesandbox.io/s/sanchonghongfafangshi-antd494-forked-92z1j?file=/index.js
š„ Exception or Error
š Your Environment
angular: 11 ant-desing>= 4.7
Anything else relevant?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 21 (3 by maintainers)
Commits related to this issue
- fix(zone.js): should not drain microtask queue too early. Always `drainMicrotaskQueue` in `Promise.then`. Consider the following case. ``` const listener = () => { Promise.resolve().then(() => co... — committed to JiaLiPassion/angular by JiaLiPassion 2 years ago
- fix(zone.js): always run microtasks in Promise.then to avoid drain microtasks too early always `drainMicrotaskQueue` in `Promise.then`. Consider the following case. ``` const listener = () => { P... — committed to JiaLiPassion/angular by JiaLiPassion 2 years ago
- fix(zone.js): always run microtasks in Promise.then to avoid drain microtasks too early Always `drainMicrotaskQueue` in `Promise.then`. Consider the following case. ``` const listener = () => { P... — committed to JiaLiPassion/angular by JiaLiPassion 2 years ago
@JiaLiPassion when use micro-frontends(angular&vue&react), itās a big side effects, hope can be resolved quickly
@nuonuoge , I can reproduce now, it is an edge case, I will try to figure out how to make a workable solutionā¦
Temporary solution:
patch for
rc-trigger
:You can apply it via yarn patch or patch-package
After quite some debugging, I made a pure JS reproduction without any React thing https://stackblitz.com/edit/angular-41506 . This reproduction kinda simulates Reactās scheduler and invoke guard, and obviously
zone-patch-message-port
fixes the issue.For the two React reproductions above in this thread, adding
import 'zone.js/plugins/zone-patch-message-port';
BEFOREimport ... from 'react-dom'
also does the fix.ā> https://stackblitz.com/edit/react-hisbdi?file=src%2Findex.js fixed
ā> https://stackblitz.com/edit/react-zyezvq?file=src%2Findex.js fixed
Unfortunately for old versionās antd Select,
zone-patch-message-port
is not enough. There seems some other issues about ResizeObserver or maybe https://github.com/angular/angular/issues/44446. But the latest antd(4.17.3) seems compatible as I tried.the same issues when use micro-frontends
has the same issues too +1
@JiaLiPassion https://stackblitz.com/edit/react-mfqbxp you can use this repo, sometimes itās work, you can reopen it times, when click this page will endless loop delete zone.jsļ¼itās work
@kbakba thanksļ¼it works for me