Cleanup upstreamed patches & fix angular #291
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Issues with angular: https://codesandbox.io/s/angular-material-tooltip-fhimx?file=/src/index.html
Tooltip location isn't properly updated as while it waits for ngzone's microtask queue to flush out, the microtask never existed due to us patching Node (as a fix for IE not having EventTarget) vs zone patching EventTarget or Node depending on browser support. Node is before EventTarget in prototype chain so even though zone patches addEventListener later, it will never get called as Node's addEventListener is found first.
Upstreamed version of the IE fix matches zone's patching = doesn't cause this issue, so fixing by removing our version of the fix.
After angular gets to use zone again there's an issue with passive event listener feature detection where
null
event listener doesn't work as a key in weakmap used in otel code (TypeError: Invalid value used as weak map key)Added a quick check for non-values to
addPatchedListener
.Otel doesn't have this issue as it uses zone for event listener tracing if possible. But it's still worth pr-ing a fix to otel, probably should also check other "fun" ways to make event listeners (I think you can pass a string as a listener too, calling the global function with that name? That's also not valid for weakmap)
Type of change
How has this been tested?