Commit 5caa104
Hoist
Summary:
Changelog: [General][Fixed] Removed second argument for hook function passed to `AppRegistry.setComponentProviderInstrumentationHook` as it's not usable by apps.
## Context
The performance-logger primitives (`createPerformanceLogger`, `GlobalPerformanceLogger`, `IPerformanceLogger`, `PerformanceLoggerContext`) and the telemetry that lived inside the `react-native` package have always been Meta-internal. They were never exported from `index.js.flow` or `package.json#exports`, and the timespans/extras they emitted (`renderApplication_React_render`, `initializeCore_start`/`_end`, the `'GlobalPerformanceLogger'` callable native module, the per-app scoped `IPerformanceLogger`) only ever fed Meta's instrumentation.
Keeping them inside `react-native` adds dead weight to the OSS package and forces any future change to that surface to land through OSS sync. Hoisting them out keeps the OSS package focused on what external consumers actually use, while leaving Meta's instrumentation stack fully functional. This is non-breaking for OSS consumers — nothing that was importable from `react-native` becomes unavailable.
Technically, this could be considered a breaking change, because `AppRegistry.setComponentProviderInstrumentationHook` accepts a function that was receiving a performance logger as the second parameter, but because that performance logger wasn't later accessible anywhere, we should consider that it wasn't really used.
A quick search on Github yielded not results for the use of the API altogether: https://github.com/search?q=AppRegistry.setComponentProviderInstrumentationHook%28&type=code
## Changes
- Removed the perf-logger source files and their telemetry emission from `react-native`.
- `XMLHttpRequest` keeps its `setPerformanceLogger(...)` extension and the `network_XMLHttpRequest_<friendlyName>` start/stop timespan, but the parameter is now typed against a tiny local interface (`startTimespan(key)` / `stopTimespan(key)`) defined inside the module, so the file no longer depends on the moved primitives. The logger defaults to `null` (no global fallback); when no logger is set the timespan is not emitted. The unused `_startTime` field is dropped, and the XHR test for the custom-logger path is preserved with a hand-rolled spy.
- `InitializeCore.js` no longer emits `initializeCore_start` / `initializeCore_end` markPoints, and `setUpBatchedBridge.js` no longer registers the `'GlobalPerformanceLogger'` callable native module.
- `renderApplication.js` no longer wraps the rendered tree in `<PerformanceLoggerContext.Provider>`, no longer emits the `renderApplication_React_render` timespan, and no longer sets the `usedReactConcurrentRoot` / `usedReactFabric` / `usedReactProfiler` extras. Its previous 7th positional `scopedPerformanceLogger` parameter is preserved as a reserved `_unused?: void` slot so direct callers that still supply an extra value continue to type-check; the value is ignored.
- `AppRegistry.setComponentProviderInstrumentationHook` is preserved as part of the public API. The hook's previous second argument (the per-app `IPerformanceLogger`) is removed entirely; the hook signature is now `(component: ComponentProvider) => React.ComponentType<any>`. Embedders that need richer per-app context can attach it via their own mechanism.
- `ReactNativeApi.d.ts` is regenerated by `yarn build-types`. The generated public surface is identical except that `IPerformanceLogger` is gone and `ComponentProviderInstrumentationHook` no longer takes a second argument.
Differential Revision: D102166537PerformanceLogger primitives out of react-native
1 parent 53e6ce2 commit 5caa104
16 files changed
Lines changed: 50 additions & 960 deletions
File tree
- packages/react-native
- Libraries
- Core
- Network
- __tests__
- ReactNative
- Utilities
- __mocks__
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | 29 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
| |||
Lines changed: 29 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| |||
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
| |||
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
170 | | - | |
171 | | - | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
| |||
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
337 | | - | |
338 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| |||
521 | 530 | | |
522 | 531 | | |
523 | 532 | | |
524 | | - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
525 | 538 | | |
526 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
527 | 542 | | |
528 | 543 | | |
529 | 544 | | |
| |||
598 | 613 | | |
599 | 614 | | |
600 | 615 | | |
601 | | - | |
602 | | - | |
603 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
604 | 621 | | |
605 | 622 | | |
606 | 623 | | |
| |||
Lines changed: 4 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
21 | | - | |
22 | 17 | | |
23 | 18 | | |
24 | 19 | | |
| |||
246 | 241 | | |
247 | 242 | | |
248 | 243 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 244 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
273 | 249 | | |
274 | 250 | | |
275 | 251 | | |
| |||
279 | 255 | | |
280 | 256 | | |
281 | 257 | | |
282 | | - | |
283 | 258 | | |
284 | 259 | | |
285 | 260 | | |
| |||
291 | 266 | | |
292 | 267 | | |
293 | 268 | | |
294 | | - | |
295 | 269 | | |
296 | 270 | | |
297 | 271 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 86 | + | |
92 | 87 | | |
93 | 88 | | |
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
97 | | - | |
| 92 | + | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| |||
Lines changed: 12 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | 50 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
| |||
74 | 70 | | |
75 | 71 | | |
76 | 72 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
| |||
87 | 80 | | |
88 | 81 | | |
89 | 82 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 83 | | |
98 | 84 | | |
99 | 85 | | |
100 | 86 | | |
101 | 87 | | |
102 | 88 | | |
103 | | - | |
104 | 89 | | |
Lines changed: 0 additions & 24 deletions
This file was deleted.
0 commit comments