Commit Graph
3 Commits
Author SHA1 Message Date
Rubén NorteandFacebook GitHub Bot 84a1211773 Strip all "bom" types that are actually not defined in RN (#49730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49730

Changelog: [internal]

This removes all the types from "bom" that are actually not implemented in RN. For now, we're just stripping whole interfaces and not looking into specific methods/properties in interfaces that we do implement but not 100%.

`Performance`, `PerformanceObserver`, `MutationObserver` and `IntersectionObserver` are implemented but not stable yet, so they aren't exposed as globals in the types.

Reviewed By: huntie

Differential Revision: D70329185

fbshipit-source-id: 63bac619e100ca66b41df071df80dfa73d0f9651
2025-02-28 05:58:45 -08:00
Luna WeiandFacebook GitHub Bot d19f5f97b8 Fix naming convention for new rootThreshold related APIs and add Fantom tests (#48071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48071

Changelog: [Internal]

- Write fantom test for rn_rootThreshold given current implementation of IntersectionObserver
- Rename `rn_rootThreshold` to `rnRootThreshold`
- Rename `rn_intersectionRootRatio` to `rnRootIntersectionRatio`
- Rename `rootThresholds` on observer to `rnRootThresholds`

Reviewed By: rubennorte

Differential Revision: D66464509

fbshipit-source-id: 8ed66afa54bab99a28625ebe6f227d59d0bd7389
2024-12-03 13:29:51 -08:00
Luna WeiandFacebook GitHub Bot a77d8d9d50 Support rn_rootThreshold on IntersectionObserver (viewAreaCoveragePercentThreshold) (#47908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47908

Changelog: [General][Added] - Add support for `rn_rootThreshold` in Intersection Observer

`rn_rootThreshold` is a custom IntersectionObserver option and not part of the IntersectionObserver spec. We are adding it because it covers a specific use-case for measuring viewability that is robust for `target`s that are larger than the viewport or specified `root`.

The threshold ratio is of the intersection area (of `root` and `target`) to the total area of the `root`.

 {F1960832959}
Source - EX314979

`rn_rootThreshold` is an optional threshold and can be combined with the `thresholds` option. An intersection will fire if any specified thresholds is met.

Note: If you use specify a `rn_rootThreshold`, the default `threshold` is no longer applied

The main use case of `rn_rootThreshold` is being able to specify a level of viewability independent of `target` size. For example, a `target` that is larger than the `root` (commonly the viewport) will not trigger the IntersectionObserver for a `threshold` of `1`. Setting `rn_rootThreshold` of `1`, will trigger once the item takes full size of the `root`.';

Reviewed By: yungsters

Differential Revision: D66031119

fbshipit-source-id: 7bdc871dc5b4e6c0edc7d6e17a0a0cfd51c4fe81
2024-11-22 11:50:36 -08:00