Skip to content

Commit 11f641b

Browse files
committed
Initial docs for experimental Web Performance APIs
1 parent a20fdbe commit 11f641b

10 files changed

+233
-4
lines changed

docs/global-EventCounts.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: global-EventCounts
3+
title: EventCounts 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`EventCounts`](https://developer.mozilla.org/en-US/docs/Web/API/EventCounts) class, as defined in Web specifications.

docs/global-PerformanceEntry.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: global-PerformanceEntry
3+
title: PerformanceEntry 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceEntry`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry) class, as defined in Web specifications.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
id: global-PerformanceEventTiming
3+
title: PerformanceEventTiming 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceEventTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEventTiming) class, as defined in Web specifications.
11+
12+
:::info Partial support
13+
The `cancelable` and `target` properties are not supported yet.
14+
:::
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
id: global-PerformanceLongTaskTiming
3+
title: PerformanceLongTaskTiming 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceLongTaskTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceLongTaskTiming) class, as defined in Web specifications.
11+
12+
:::info Partial support
13+
The value for the `attribution` property is always an empty array.
14+
:::

docs/global-PerformanceMark.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: global-PerformanceMark
3+
title: PerformanceMark 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceMark`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark) class, as defined in Web specifications.

docs/global-PerformanceMeasure.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: global-PerformanceMeasure
3+
title: PerformanceMeasure 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceMeasure`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure) class, as defined in Web specifications.

docs/global-PerformanceObserver.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
id: global-PerformanceObserver
3+
title: PerformanceObserver 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceObserver`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver) class, as defined in Web specifications.
11+
12+
## Example
13+
14+
```ts
15+
const observer = new PerformanceObserver(
16+
(list, observer, options) => {
17+
for (const entry of list.getEntries()) {
18+
console.log(
19+
'Received entry with type',
20+
entry.entryType,
21+
'and name',
22+
entry.name,
23+
'that started at',
24+
entry.startTime,
25+
'and took',
26+
entry.duration,
27+
'ms',
28+
);
29+
}
30+
},
31+
);
32+
33+
observer.observe({entryTypes: ['mark', 'measure']});
34+
```
35+
36+
---
37+
38+
# Reference
39+
40+
## Constructor
41+
42+
### `PerformanceObserver()`
43+
44+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/PerformanceObserver).
45+
46+
## Static properties
47+
48+
### `supportedEntryTypes`
49+
50+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/supportedEntryTypes).
51+
52+
Returns `['mark', 'measure', 'event', 'longtask']`.
53+
54+
## Instance methods
55+
56+
### `observe()`
57+
58+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe).
59+
60+
### `disconnect()`
61+
62+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/disconnect).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: global-PerformanceObserverEntryList
3+
title: PerformanceObserverEntryList 🧪
4+
---
5+
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`PerformanceObserverEntryList`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserverEntryList) class, as defined in Web specifications.

docs/global-performance.md

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,91 @@
11
---
22
id: global-performance
3-
title: performance
3+
title: performance 🧪
44
---
55

6-
:::warning
7-
🚧 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.
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
9+
10+
The global [`performance`](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance) object, as defined in Web specifications.
11+
12+
---
13+
14+
# Reference
15+
16+
## Instance properties
17+
18+
### `eventCounts`
19+
20+
See [documentation in MDN]((https://developer.mozilla.org/en-US/docs/Web/API/Performance/eventCounts)).
21+
22+
### `memory`
23+
24+
See [documentation in MDN]((https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory)).
25+
26+
### `rnStartupTiming` ⚠️
27+
28+
:::warning Non-standard
29+
This is a React Native specific extension.
30+
:::
31+
32+
Provides information about the startup time of the application.
33+
34+
```ts
35+
get rnStartupTiming(): ReactNativeStartupTiming;
36+
```
37+
38+
The `ReactNativeStartupTiming` interface provides the following fields:
39+
40+
| Name | Type | Description |
41+
| --- | --- | --- |
42+
| `startTime` | number \| void | When the application startup was started. |
43+
| `initializeRuntimeStart` | number \| void | When the React Native runtime initialization was started. |
44+
| `executeJavaScriptBundleEntryPointStart` | number \| void | When the execution of the application bundle was started. |
45+
| `endTime` | number \| void | When the React Native runtime was fully initialized. |
46+
47+
### `timeOrigin`
48+
49+
:::info Partial support
50+
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.
51+
:::
52+
53+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin).
54+
55+
## Instance methods
56+
57+
### `clearMarks()`
58+
59+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks).
60+
61+
### `clearMeasures()`
62+
63+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures).
64+
65+
### `getEntries()`
66+
67+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries).
68+
69+
### `getEntriesByName()`
70+
71+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName).
72+
73+
### `getEntriesByType()`
74+
75+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType).
76+
77+
### `mark()`
78+
79+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark).
80+
81+
### `measure()`
82+
83+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure).
84+
85+
### `now()`
86+
87+
:::info Partial support
88+
Provides the number of milliseconds from system boot, instead of the number of milliseconds from app startup.
889
:::
990

10-
The global `performance` object, as defined in Web specifications.
91+
See [documentation in MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now).

website/sidebars.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ export default {
236236
'global-clearInterval',
237237
'global-clearTimeout',
238238
'global-console',
239+
'global-EventCounts',
239240
'global-fetch',
240241
'global-File',
241242
'global-FileReader',
@@ -244,6 +245,13 @@ export default {
244245
'global-Headers',
245246
'global-navigator',
246247
'global-performance',
248+
'global-PerformanceEntry',
249+
'global-PerformanceEventTiming',
250+
'global-PerformanceLongTaskTiming',
251+
'global-PerformanceMark',
252+
'global-PerformanceMeasure',
253+
'global-PerformanceObserver',
254+
'global-PerformanceObserverEntryList',
247255
'global-process',
248256
'global-queueMicrotask',
249257
'global-Request',

0 commit comments

Comments
 (0)