Commit 2b0bca0
committed
Include server component names in the componentStack in DEV (#28415)
I'm a bit ambivalent about this one because it's not the main strategy
that I plan on pursuing. I plan on replacing most DEV-only specific
stacks like `console.error` stacks with a new take on owner stacks and
native stacks. The future owner stacks may or may not be exposed to
error boundaries in DEV but if they are they'd be a new errorInfo
property since they're owner based and not available in prod.
The use case in `console.error` mostly goes away in the future so this
PR is mainly for error boundaries. It doesn't hurt to have it in there
while I'm working on the better stacks though.
The `componentStack` property exposed to error boundaries is more like
production behavior similar to `new Error().stack` (which even in DEV
won't ever expose owner stacks because `console.createTask` doesn't
affect these). I'm not sure it's worth adding server components in DEV
(this PR) because then you have forked behavior between dev and prod.
However, since even in the future there won't be any other place to get
the *parent* stack, maybe this can be useful information even if it's
only dev. We could expose a third property on errorInfo that's DEV only
and parent stack but including server components. That doesn't seem
worth it over just having the stack differ in dev and prod.
I don't plan on adding line/column number to these particular stacks.
A follow up could be to add this to Fizz prerender too but only in DEV.
DiffTrain build for commit 8fb0233.1 parent 86ff191 commit 2b0bca0
File tree
9 files changed
+80
-17
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
9 files changed
+80
-17
lines changedLines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
4112 | 4112 | | |
4113 | 4113 | | |
4114 | 4114 | | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
4115 | 4121 | | |
4116 | 4122 | | |
4117 | 4123 | | |
| |||
4190 | 4196 | | |
4191 | 4197 | | |
4192 | 4198 | | |
4193 | | - | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
4194 | 4215 | | |
4195 | 4216 | | |
4196 | 4217 | | |
| |||
25707 | 25728 | | |
25708 | 25729 | | |
25709 | 25730 | | |
25710 | | - | |
| 25731 | + | |
25711 | 25732 | | |
25712 | 25733 | | |
25713 | 25734 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9171 | 9171 | | |
9172 | 9172 | | |
9173 | 9173 | | |
9174 | | - | |
| 9174 | + | |
9175 | 9175 | | |
9176 | 9176 | | |
9177 | 9177 | | |
| |||
9202 | 9202 | | |
9203 | 9203 | | |
9204 | 9204 | | |
9205 | | - | |
| 9205 | + | |
9206 | 9206 | | |
9207 | 9207 | | |
9208 | 9208 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9599 | 9599 | | |
9600 | 9600 | | |
9601 | 9601 | | |
9602 | | - | |
| 9602 | + | |
9603 | 9603 | | |
9604 | 9604 | | |
9605 | 9605 | | |
| |||
9630 | 9630 | | |
9631 | 9631 | | |
9632 | 9632 | | |
9633 | | - | |
| 9633 | + | |
9634 | 9634 | | |
9635 | 9635 | | |
9636 | 9636 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
| 603 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
7757 | 7757 | | |
7758 | 7758 | | |
7759 | 7759 | | |
| 7760 | + | |
| 7761 | + | |
| 7762 | + | |
| 7763 | + | |
| 7764 | + | |
| 7765 | + | |
7760 | 7766 | | |
7761 | 7767 | | |
7762 | 7768 | | |
| |||
8088 | 8094 | | |
8089 | 8095 | | |
8090 | 8096 | | |
8091 | | - | |
| 8097 | + | |
| 8098 | + | |
| 8099 | + | |
| 8100 | + | |
| 8101 | + | |
| 8102 | + | |
| 8103 | + | |
| 8104 | + | |
| 8105 | + | |
| 8106 | + | |
| 8107 | + | |
| 8108 | + | |
| 8109 | + | |
| 8110 | + | |
| 8111 | + | |
| 8112 | + | |
8092 | 8113 | | |
8093 | 8114 | | |
8094 | 8115 | | |
| |||
28018 | 28039 | | |
28019 | 28040 | | |
28020 | 28041 | | |
28021 | | - | |
| 28042 | + | |
28022 | 28043 | | |
28023 | 28044 | | |
28024 | 28045 | | |
| |||
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
8028 | 8028 | | |
8029 | 8029 | | |
8030 | 8030 | | |
| 8031 | + | |
| 8032 | + | |
| 8033 | + | |
| 8034 | + | |
| 8035 | + | |
| 8036 | + | |
8031 | 8037 | | |
8032 | 8038 | | |
8033 | 8039 | | |
| |||
8359 | 8365 | | |
8360 | 8366 | | |
8361 | 8367 | | |
8362 | | - | |
| 8368 | + | |
| 8369 | + | |
| 8370 | + | |
| 8371 | + | |
| 8372 | + | |
| 8373 | + | |
| 8374 | + | |
| 8375 | + | |
| 8376 | + | |
| 8377 | + | |
| 8378 | + | |
| 8379 | + | |
| 8380 | + | |
| 8381 | + | |
| 8382 | + | |
| 8383 | + | |
8363 | 8384 | | |
8364 | 8385 | | |
8365 | 8386 | | |
| |||
28458 | 28479 | | |
28459 | 28480 | | |
28460 | 28481 | | |
28461 | | - | |
| 28482 | + | |
28462 | 28483 | | |
28463 | 28484 | | |
28464 | 28485 | | |
| |||
0 commit comments