Skip to content

Commit

Permalink
Create module to set up PerformanceObserver (#37807)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #37807

We implemented `PerformanceObserver` but didn't create a `setUp*` module for it like we did for the rest of globals in RN.

This creates the module but doesn't enable it by default (until stable in OSS). We'll require this in a case by case basis for testing.

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D46597766

fbshipit-source-id: 661d009754f4310c6b83483188ed020fc1d4d63b
  • Loading branch information
rubennorte authored and facebook-github-bot committed Jun 12, 2023
1 parent ef5d92f commit 33b9c8e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/react-native/Libraries/Core/setUpPerformanceObserver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/

import {polyfillGlobal} from '../Utilities/PolyfillFunctions';

polyfillGlobal(
'PerformanceObserver',
() => require('../WebPerformance/PerformanceObserver').default,
);

0 comments on commit 33b9c8e

Please sign in to comment.