fix(core): Angular web detection and other minor changes #11491
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 of changes
In the latest version of Angular, it is protecting its updates to window from being visible in code outside of Angular. Maybe this is zones? Either way, I've added a fallback approach that leverages the dom. From what I'm reading using both of these together should cover all recent versions of Angular.
Also expanded variable names per a comment from Chris earlier and added tsignore in a bunch of places. Angular was happy with no warnings until I started importing internal pieces. When it is compiling the detection code for itself, it warns on these without the annotations. Should have been fine, but resolved on the off chance that a different strict build environment is rebuilding this code.
Description of how you validated changes
Retested with angular using linking (earlier verification was done by injecting the angular code into an app, which is within the zone, so the old approach worked.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.