Uh oh!
There was an error while loading. Please reload this page.
Commit 3025aa3
authored
[Flight] Don't serialize toJSON in Debug path and omit wide arrays (#34759)
There's a couple of issues with serializing Buffer in the debug renders.
For one, the Node.js Buffer has a `toJSON` on it which turns the binary
data into a JSON array which is very inefficient to serialize compared
to the real buffer. For debug info we never really want to resolve these
and unlike the regular render we can't error. So this uses the trick
where we read the original value. It's still unfortunate that this
intermediate gets created at all but at least now we're not serializing
it.
Second, we have a limit on depth of objects but we didn't have a limit
on width like large arrays or typed arrays. This omits large arrays from
the payload when possible and make them deferred when there's a debug
channel.1 parent a4eb2df commit 3025aa3
3 files changed
Lines changed: 529 additions & 291 deletions
File tree
- packages/react-server/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
852 | 895 | | |
853 | 896 | | |
854 | 897 | | |
| |||
906 | 949 | | |
907 | 950 | | |
908 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
909 | 963 | | |
910 | 964 | | |
911 | 965 | | |
| |||
3066 | 3120 | | |
3067 | 3121 | | |
3068 | 3122 | | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
3069 | 3127 | | |
3070 | 3128 | | |
3071 | 3129 | | |
| |||
4820 | 4878 | | |
4821 | 4879 | | |
4822 | 4880 | | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
4823 | 4886 | | |
4824 | 4887 | | |
4825 | 4888 | | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
4826 | 4892 | | |
4827 | 4893 | | |
4828 | 4894 | | |
| |||
4930 | 4996 | | |
4931 | 4997 | | |
4932 | 4998 | | |
4933 | | - | |
4934 | | - | |
4935 | | - | |
4936 | | - | |
4937 | | - | |
4938 | | - | |
4939 | | - | |
4940 | | - | |
4941 | | - | |
4942 | 4999 | | |
4943 | 5000 | | |
4944 | 5001 | | |
| |||
5036 | 5093 | | |
5037 | 5094 | | |
5038 | 5095 | | |
5039 | | - | |
5040 | | - | |
5041 | | - | |
5042 | | - | |
5043 | 5096 | | |
5044 | 5097 | | |
5045 | 5098 | | |
| |||
5058 | 5111 | | |
5059 | 5112 | | |
5060 | 5113 | | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
5061 | 5117 | | |
5062 | 5118 | | |
5063 | 5119 | | |
5064 | 5120 | | |
5065 | 5121 | | |
5066 | | - | |
| 5122 | + | |
5067 | 5123 | | |
5068 | 5124 | | |
5069 | 5125 | | |
| |||
5114 | 5170 | | |
5115 | 5171 | | |
5116 | 5172 | | |
| 5173 | + | |
| 5174 | + | |
| 5175 | + | |
5117 | 5176 | | |
5118 | 5177 | | |
5119 | 5178 | | |
5120 | 5179 | | |
5121 | 5180 | | |
5122 | | - | |
| 5181 | + | |
5123 | 5182 | | |
5124 | 5183 | | |
5125 | 5184 | | |
| |||
0 commit comments