Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/_canary-channel-api-warning.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:::important Canary 🧪

**This API is currently only available in React Native’s Canary and Experimental channels.**

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the experimental message has more details than the canary one. I'd suggest that we either provide details for both or none.

[Learn more about React Native’s release channels here.](releases/release-levels)

:::
9 changes: 9 additions & 0 deletions docs/_experimental-channel-api-warning.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:::important Experimental Feature 🧪

**This API is experimental and is not available in a stable version of React Native yet.**

Experimental APIs may contain bugs and are likely to change in a future version of React Native. Don't use them in production.

If you want to try it out, please [enable the Experimental Channel](releases/release-levels) in your app.

:::
10 changes: 10 additions & 0 deletions docs/global-EventCounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: global-EventCounts
title: EventCounts 🧪
Copy link
Collaborator

@Simek Simek Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the addition on PR preview, everything looks good! 👍

Just wonder if we should place the emoji before the sidebar/page title to match arrangement of already existing pages like "InteractionManager" or "DEV"?

I also looked if we can do something about not the greatest sidebar wrapping for few entries:

Screenshot 2025-10-02 201326

It's nothing blocking, but did not found any easy solution for that changing few styles in the DevTools, so it's just a note for me, for later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wonder if we should place the emoji before the sidebar/page title to match arrangement of already existing pages like "InteractionManager" or "DEV"?

I followed the same convention we have on react.dev, and it's also used by MDN. I can change the other cases to align with this instead.

---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`EventCounts`](https://developer.mozilla.org/en-US/docs/Web/API/EventCounts) class, as defined in Web specifications.
10 changes: 10 additions & 0 deletions docs/global-PerformanceEntry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: global-PerformanceEntry
title: PerformanceEntry 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceEntry`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry) class, as defined in Web specifications.
14 changes: 14 additions & 0 deletions docs/global-PerformanceEventTiming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: global-PerformanceEventTiming
title: PerformanceEventTiming 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceEventTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEventTiming) class, as defined in Web specifications.

:::info Partial support
The `cancelable` and `target` properties are not supported yet.
:::
14 changes: 14 additions & 0 deletions docs/global-PerformanceLongTaskTiming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: global-PerformanceLongTaskTiming
title: PerformanceLongTaskTiming 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceLongTaskTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceLongTaskTiming) class, as defined in Web specifications.

:::info Partial support
The value for the `attribution` property is always an empty array.
:::
10 changes: 10 additions & 0 deletions docs/global-PerformanceMark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: global-PerformanceMark
title: PerformanceMark 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceMark`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark) class, as defined in Web specifications.
10 changes: 10 additions & 0 deletions docs/global-PerformanceMeasure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: global-PerformanceMeasure
title: PerformanceMeasure 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceMeasure`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure) class, as defined in Web specifications.
62 changes: 62 additions & 0 deletions docs/global-PerformanceObserver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
id: global-PerformanceObserver
title: PerformanceObserver 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceObserver`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver) class, as defined in Web specifications.

## Example

```ts
const observer = new PerformanceObserver(
(list, observer, options) => {
for (const entry of list.getEntries()) {
console.log(
'Received entry with type',
entry.entryType,
'and name',
entry.name,
'that started at',
entry.startTime,
'and took',
entry.duration,
'ms',
);
}
},
);

observer.observe({entryTypes: ['mark', 'measure']});
```

---

# Reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is the only class with Reference and a more detailed documentation than just a link to the Web specification one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it has additional methods that are RN-specific.


## Constructor

### `PerformanceObserver()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/PerformanceObserver).

## Static properties

### `supportedEntryTypes`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/supportedEntryTypes).

Returns `['mark', 'measure', 'event', 'longtask']`.

## Instance methods

### `observe()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe).

### `disconnect()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/disconnect).
10 changes: 10 additions & 0 deletions docs/global-PerformanceObserverEntryList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: global-PerformanceObserverEntryList
title: PerformanceObserverEntryList 🧪
---

import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`PerformanceObserverEntryList`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserverEntryList) class, as defined in Web specifications.
89 changes: 85 additions & 4 deletions docs/global-performance.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,91 @@
---
id: global-performance
title: performance
title: performance 🧪
---

:::warning
🚧 This page is work in progress, so please refer to the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/performance) for more information.
import CanaryAPIWarning from './\_canary-channel-api-warning.mdx';

<CanaryAPIWarning />

The global [`performance`](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance) object, as defined in Web specifications.

---

# Reference

## Instance properties

### `eventCounts`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/eventCounts).

### `memory`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory).

### `rnStartupTiming` ⚠️
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### `rnStartupTiming` ⚠️
### `rnStartupTiming`

There is a warning block below, we can avoid the emoji here, imho.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is aligned with how MDN defines the docs. For non-standard methods, the warning is always shown next to the method name.


:::warning Non-standard
This is a React Native specific extension.
:::

Provides information about the startup time of the application.

```ts
get rnStartupTiming(): ReactNativeStartupTiming;
```

The `ReactNativeStartupTiming` interface provides the following fields:

| Name | Type | Description |
| ---------------------------------------- | -------------- | --------------------------------------------------------- |
| `startTime` | number \| void | When the application startup was started. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might need a bit of more information. In a greenfield react native app, does it takes into account the native startup time?
What does it mean for a brownfield application, where React Native might be initialized only when the user navigate to a specific tab or screen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I checked and in OSS this is always the time of RN runtime initialization. I fixed that.

| `initializeRuntimeStart` | number \| void | When the React Native runtime initialization was started. |
| `executeJavaScriptBundleEntryPointStart` | number \| void | When the execution of the application bundle was started. |
| `endTime` | number \| void | When the React Native runtime was fully initialized. |

### `timeOrigin`

:::info Partial support
Provides the number of milliseconds from the UNIX epoch until system boot, instead of the number of milliseconds from the UNIX epoch until app startup.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"until system boot" or "since system boot"? Isn't the system boot the starting point (the 0)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"until system boot". Since system boot is just performance.now().

:::

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin).

## Instance methods

### `clearMarks()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks).

### `clearMeasures()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures).

### `getEntries()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries).

### `getEntriesByName()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName).

### `getEntriesByType()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType).

### `mark()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark).

### `measure()`

See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure).

### `now()`

:::info Partial support
Provides the number of milliseconds from system boot, instead of the number of milliseconds from app startup.
:::

The global `performance` object, as defined in Web specifications.
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now).
8 changes: 8 additions & 0 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export default {
'global-clearInterval',
'global-clearTimeout',
'global-console',
'global-EventCounts',
'global-fetch',
'global-File',
'global-FileReader',
Expand All @@ -248,6 +249,13 @@ export default {
'global-Headers',
'global-navigator',
'global-performance',
'global-PerformanceEntry',
'global-PerformanceEventTiming',
'global-PerformanceLongTaskTiming',
'global-PerformanceMark',
'global-PerformanceMeasure',
'global-PerformanceObserver',
'global-PerformanceObserverEntryList',
'global-process',
'global-queueMicrotask',
'global-Request',
Expand Down