spaniel
spaniel copied to clipboard
LinkedIn's JavaScript viewport tracking library and IntersectionObserver polyfill
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9. Changelog Sourced from hosted-git-info's changelog. 2.8.9 (2021-04-07) Bug Fixes backport regex fix from #76 (29adfe5), closes #84 2.8.8 (2020-02-29) Bug Fixes #61 & #65...
Hi, this library appears to be the cause of ridiculously high CPU usage by an idle LinkedIn homepage: The main thread is spammed by the scheduled calls to `Element.getBoundingClientRect()` and...
Bumps [merge](https://github.com/yeikos/js.merge) from 1.2.0 to 1.2.1. Commits - [`b31e67f`](https://github.com/yeikos/js.merge/commit/b31e67fe6592390c967c991aa604c06ed2ae8c4f) link broken - [`6ad6035`](https://github.com/yeikos/js.merge/commit/6ad6035b901b3d680beac82de39ca83a93885246) Fix prototype pollution - See full diff in [compare view](https://github.com/yeikos/js.merge/compare/v1.2.0...v1.2.1) [](https://help.github.com/articles/configuring-automated-security-fixes) Dependabot will resolve any...
Spaniel's polyfill for `IntersectionObserver` uses `Date.now()` for setting `entry.time`, which is relative to epoch. The native implementation defines `entry.time` as being relative to the creation of the document (ref: https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry/time).
https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-isintersecting
Use something like puppeteer or chrome-debugging-client to get a "closer to reality" setup for testing
- [x] Add a short gap (< 50ms) between `requestAnimationFrame` polls - [x] Only polyfill `IntersectionObserver` when necessary - [ ] Via a [host interface](https://github.com/linkedin/spaniel/issues/35), provide a higher-order function that...
The test are very dependent on `nightmare.wait()`. The asynchronous nature of the implementation makes things hard to test, but there are some tests that are flaky on local machines. A...
`SpanielObserver` uses a [new timer per watched item](https://github.com/linkedin/spaniel/blob/516d34e1aa422dd29cd8da248422d23e5233abaa/src/spaniel-observer.ts#L193) in the viewport. Using multiple timers is bad for performance, since we could use a single timer + offsets. Thanks @stefanpenner for...