Skip to content

Commit 96c4299

Browse files
committed
[Flight] Support classes in renderDebugModel (facebook#33590)
This adds better support for serializing class instances as Debug values. It adds a new marker on the object `{ "": "$P...", ... }` which indicates which constructor's prototype to use for this object's prototype. It doesn't encode arbitrary prototypes and it doesn't encode any of the properties on the prototype. It might get some of the properties from the prototype by virtue of `toString` on a `class` constructor will include the whole class's body. This will ensure that the instance gets the right name in logs. Additionally, this now also invokes getters if they're enumerable on the prototype. This lets us reify values that can only be read from native classes. --------- Co-authored-by: Hendrik Liebau <[email protected]> DiffTrain build for [18ee505](facebook@18ee505)
1 parent ff1f53f commit 96c4299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+309628
-38830
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-274c980c53-20240708
1+
19.2.0-native-fb-18ee505e-20250622

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 408 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @generated SignedSource<<0cf9577293951b2a201886e9c0ee93fd>>
11+
*/
12+
13+
"use strict";
14+
var React = require("react");
15+
function formatProdErrorMessage(code) {
16+
var url = "https://react.dev/errors/" + code;
17+
if (1 < arguments.length) {
18+
url += "?args[]=" + encodeURIComponent(arguments[1]);
19+
for (var i = 2; i < arguments.length; i++)
20+
url += "&args[]=" + encodeURIComponent(arguments[i]);
21+
}
22+
return (
23+
"Minified React error #" +
24+
code +
25+
"; visit " +
26+
url +
27+
" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
28+
);
29+
}
30+
function noop() {}
31+
var Internals = {
32+
d: {
33+
f: noop,
34+
r: function () {
35+
throw Error(formatProdErrorMessage(522));
36+
},
37+
D: noop,
38+
C: noop,
39+
L: noop,
40+
m: noop,
41+
X: noop,
42+
S: noop,
43+
M: noop
44+
},
45+
p: 0,
46+
findDOMNode: null
47+
},
48+
REACT_PORTAL_TYPE = Symbol.for("react.portal");
49+
function createPortal$1(children, containerInfo, implementation) {
50+
var key =
51+
3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
52+
return {
53+
$$typeof: REACT_PORTAL_TYPE,
54+
key: null == key ? null : "" + key,
55+
children: children,
56+
containerInfo: containerInfo,
57+
implementation: implementation
58+
};
59+
}
60+
var ReactSharedInternals =
61+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
62+
function getCrossOriginStringAs(as, input) {
63+
if ("font" === as) return "";
64+
if ("string" === typeof input)
65+
return "use-credentials" === input ? input : "";
66+
}
67+
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
68+
Internals;
69+
exports.createPortal = function (children, container) {
70+
var key =
71+
2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
72+
if (
73+
!container ||
74+
(1 !== container.nodeType &&
75+
9 !== container.nodeType &&
76+
11 !== container.nodeType)
77+
)
78+
throw Error(formatProdErrorMessage(299));
79+
return createPortal$1(children, container, null, key);
80+
};
81+
exports.flushSync = function () {
82+
throw Error(
83+
"Expected this build of React to not support legacy mode but it does. This is a bug in React."
84+
);
85+
};
86+
exports.preconnect = function (href, options) {
87+
"string" === typeof href &&
88+
(options
89+
? ((options = options.crossOrigin),
90+
(options =
91+
"string" === typeof options
92+
? "use-credentials" === options
93+
? options
94+
: ""
95+
: void 0))
96+
: (options = null),
97+
Internals.d.C(href, options));
98+
};
99+
exports.prefetchDNS = function (href) {
100+
"string" === typeof href && Internals.d.D(href);
101+
};
102+
exports.preinit = function (href, options) {
103+
if ("string" === typeof href && options && "string" === typeof options.as) {
104+
var as = options.as,
105+
crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
106+
integrity =
107+
"string" === typeof options.integrity ? options.integrity : void 0,
108+
fetchPriority =
109+
"string" === typeof options.fetchPriority
110+
? options.fetchPriority
111+
: void 0;
112+
"style" === as
113+
? Internals.d.S(
114+
href,
115+
"string" === typeof options.precedence ? options.precedence : void 0,
116+
{
117+
crossOrigin: crossOrigin,
118+
integrity: integrity,
119+
fetchPriority: fetchPriority
120+
}
121+
)
122+
: "script" === as &&
123+
Internals.d.X(href, {
124+
crossOrigin: crossOrigin,
125+
integrity: integrity,
126+
fetchPriority: fetchPriority,
127+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
128+
});
129+
}
130+
};
131+
exports.preinitModule = function (href, options) {
132+
if ("string" === typeof href)
133+
if ("object" === typeof options && null !== options) {
134+
if (null == options.as || "script" === options.as) {
135+
var crossOrigin = getCrossOriginStringAs(
136+
options.as,
137+
options.crossOrigin
138+
);
139+
Internals.d.M(href, {
140+
crossOrigin: crossOrigin,
141+
integrity:
142+
"string" === typeof options.integrity ? options.integrity : void 0,
143+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
144+
});
145+
}
146+
} else null == options && Internals.d.M(href);
147+
};
148+
exports.preload = function (href, options) {
149+
if (
150+
"string" === typeof href &&
151+
"object" === typeof options &&
152+
null !== options &&
153+
"string" === typeof options.as
154+
) {
155+
var as = options.as,
156+
crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
157+
Internals.d.L(href, as, {
158+
crossOrigin: crossOrigin,
159+
integrity:
160+
"string" === typeof options.integrity ? options.integrity : void 0,
161+
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
162+
type: "string" === typeof options.type ? options.type : void 0,
163+
fetchPriority:
164+
"string" === typeof options.fetchPriority
165+
? options.fetchPriority
166+
: void 0,
167+
referrerPolicy:
168+
"string" === typeof options.referrerPolicy
169+
? options.referrerPolicy
170+
: void 0,
171+
imageSrcSet:
172+
"string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
173+
imageSizes:
174+
"string" === typeof options.imageSizes ? options.imageSizes : void 0,
175+
media: "string" === typeof options.media ? options.media : void 0
176+
});
177+
}
178+
};
179+
exports.preloadModule = function (href, options) {
180+
if ("string" === typeof href)
181+
if (options) {
182+
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
183+
Internals.d.m(href, {
184+
as:
185+
"string" === typeof options.as && "script" !== options.as
186+
? options.as
187+
: void 0,
188+
crossOrigin: crossOrigin,
189+
integrity:
190+
"string" === typeof options.integrity ? options.integrity : void 0
191+
});
192+
} else Internals.d.m(href);
193+
};
194+
exports.requestFormReset = function (form) {
195+
Internals.d.r(form);
196+
};
197+
exports.unstable_batchedUpdates = function (fn, a) {
198+
return fn(a);
199+
};
200+
exports.useFormState = function (action, initialState, permalink) {
201+
return ReactSharedInternals.H.useFormState(action, initialState, permalink);
202+
};
203+
exports.useFormStatus = function () {
204+
return ReactSharedInternals.H.useHostTransitionStatus();
205+
};
206+
exports.version = "19.2.0-native-fb-18ee505e-20250622";

0 commit comments

Comments
 (0)