Commit 5ecb5ec
Re-apply "Require the NativePerformance module and drop the legacy performance fallback" (#57609)
Summary:
Pull Request resolved: #57609
This re-applies a previously landed change that was reverted. It requires the NativePerformance module and removes the legacy `performance` fallback path.
`setUpPerformance` previously branched between the modern Performance API setup and a barebones `performance` stub depending on whether the native Performance module was available. The native module is now always present in supported runtimes, so this consolidates everything on the modern setup and removes the dead fallback path.
- `NativePerformance` is now resolved via `getEnforcing` instead of a nullable `get`, and its `timeOrigin` method is no longer optional (the native module always implements it).
- Removed the legacy `performance` stub and the `global.nativePerformanceNow` fallbacks, along with the now-redundant null checks and the `getCurrentTimeStamp` indirection (native `now`/`timeOrigin` are cached directly).
- `setUpPerformance` is kept as a thin alias of the internal setup module so external callers keep working.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D1125660451 parent e640278 commit 5ecb5ec
9 files changed
Lines changed: 33 additions & 90 deletions
File tree
- packages/react-native
- Libraries/Core
- src/private
- setup
- webapis/performance
- internals
- specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 15 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
Lines changed: 15 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 57 | + | |
| 58 | + | |
66 | 59 | | |
67 | 60 | | |
68 | 61 | | |
| |||
78 | 71 | | |
79 | 72 | | |
80 | 73 | | |
81 | | - | |
| 74 | + | |
82 | 75 | | |
83 | 76 | | |
84 | 77 | | |
| |||
147 | 140 | | |
148 | 141 | | |
149 | 142 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
| 143 | + | |
156 | 144 | | |
157 | 145 | | |
158 | 146 | | |
| |||
202 | 190 | | |
203 | 191 | | |
204 | 192 | | |
205 | | - | |
| 193 | + | |
206 | 194 | | |
207 | 195 | | |
208 | 196 | | |
| |||
219 | 207 | | |
220 | 208 | | |
221 | 209 | | |
222 | | - | |
| 210 | + | |
223 | 211 | | |
224 | 212 | | |
225 | 213 | | |
226 | 214 | | |
227 | 215 | | |
228 | | - | |
| 216 | + | |
229 | 217 | | |
230 | 218 | | |
231 | 219 | | |
| |||
347 | 335 | | |
348 | 336 | | |
349 | 337 | | |
350 | | - | |
| 338 | + | |
351 | 339 | | |
352 | 340 | | |
353 | 341 | | |
| |||
364 | 352 | | |
365 | 353 | | |
366 | 354 | | |
367 | | - | |
| 355 | + | |
368 | 356 | | |
369 | 357 | | |
370 | 358 | | |
| |||
375 | 363 | | |
376 | 364 | | |
377 | 365 | | |
378 | | - | |
| 366 | + | |
379 | 367 | | |
380 | 368 | | |
381 | 369 | | |
| |||
385 | 373 | | |
386 | 374 | | |
387 | 375 | | |
388 | | - | |
| 376 | + | |
389 | 377 | | |
390 | 378 | | |
391 | 379 | | |
| |||
400 | 388 | | |
401 | 389 | | |
402 | 390 | | |
403 | | - | |
| 391 | + | |
404 | 392 | | |
405 | 393 | | |
406 | 394 | | |
| |||
411 | 399 | | |
412 | 400 | | |
413 | 401 | | |
414 | | - | |
| 402 | + | |
415 | 403 | | |
416 | 404 | | |
417 | 405 | | |
418 | 406 | | |
419 | 407 | | |
420 | 408 | | |
421 | | - | |
| 409 | + | |
422 | 410 | | |
423 | 411 | | |
424 | 412 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
0 commit comments