Use proper enums to communicate between JS and C++ in NativePerformanceObserver#36156
Closed
rshest wants to merge 5 commits into
Closed
Use proper enums to communicate between JS and C++ in NativePerformanceObserver#36156rshest wants to merge 5 commits into
rshest wants to merge 5 commits into
Conversation
…ok#36116) Summary: Pull Request resolved: facebook#36116 [Changelog][Internal] Add a minimal/reference JavaScript implementation for NativePerformanceObserver - the purpose is both unit testing (JS and native sides separately) and potentially shimming the part of functionality that is not dependent on native side. This is both a setup for adding general unit tests for the Performance* APIs, but also to be able to do non-trivial changes on JS side for WebPerformance (such as in (D43154319). Differential Revision: https://internalfb.com/D43167392 fbshipit-source-id: 19b75cbbf27be59bf86dbf1cda3acb863bf89b59
Summary: [Changelog][Internal] By [the W3C standard](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe), `PerformanceObserver.observer` can optionally take a `durationThreshold` option, so that only entries with duration larger than the threshold are reported. This diff adds support for this on the RN side. NOTE: The standard suggests that default value for this is 104s. I left it at 0 for now, as for the RN use cases t may be to too high (needs discussion). Differential Revision: https://internalfb.com/D43154319 fbshipit-source-id: a3ace67db01dbd9f414eff2f3028284cea3e615c
Summary: [Changelog][Internal] Implements EventCounts API (`Performance.eventCounts`) for Web Performance, according to the W3C standard: https://www.w3.org/TR/event-timing/#eventcounts Differential Revision: https://internalfb.com/D43285073 fbshipit-source-id: 5e923b7a4915968ecf210ba8ed3951c637d9c5e5
…degen Differential Revision: D43292254 fbshipit-source-id: 456902763d0b8232c6fca7a36dd442d200caa8d5
…ceObserver Summary: [Changelog][Internal] After D42884147 (facebook@ceb1d0d) (facebook#36030) had landed, we now can use enums as data types when bridging between JS and C++ TurboModules. This diff takes advantage of this and converts the API to use the proper enums instead of int types that it was forced to use earlier. NOTE: This also relies on additional change to codegen, D43292254, which is required in order for enums to work also as part of data structures. Differential Revision: D43292282 fbshipit-source-id: fd271704ab60aec2b3ae5b260e76665ad50e206e
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D43292282 |
|
|
||
| import NativePerformanceObserver from './NativePerformanceObserver'; | ||
| import {warnNoNativePerformanceObserver} from './PerformanceObserver'; | ||
| import {rawToPerformanceEntryType} from './RawPerformanceEntry'; |
There was a problem hiding this comment.
⚠️ Libraries/WebPerformance/EventCounts.js line 13 – 'rawToPerformanceEntryType' is defined but never used. (no-unused-vars)
|
Base commit: 11570e7 |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
[Changelog][Internal]
After D42884147 (ceb1d0d) (#36030) had landed, we now can use enums as data types when bridging between JS and C++ TurboModules.
This diff takes advantage of this and converts the API to use the proper enums instead of int types that it was forced to use earlier.
NOTE: This also relies on additional change to codegen, D43292254, which is required in order for enums to work also as part of data structures.
Differential Revision: D43292282