react-native 0.83.5 → 0.83.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/Utilities/HMRClient.js +28 -1
  3. package/React/Base/RCTVersion.m +1 -1
  4. package/React/CoreModules/RCTDevLoadingView.mm +17 -0
  5. package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
  6. package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
  7. package/React/CoreModules/RCTRedBox+Internal.h +42 -0
  8. package/React/CoreModules/RCTRedBox.mm +30 -450
  9. package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
  10. package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
  11. package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
  12. package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
  13. package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
  14. package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
  15. package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
  16. package/React/CoreModules/RCTRedBoxController.mm +447 -0
  17. package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
  18. package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
  19. package/React/CoreModules/React-CoreModules.podspec +1 -0
  20. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +16 -0
  21. package/ReactAndroid/gradle.properties +1 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
  24. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
  25. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +5 -1
  26. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  29. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
  30. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
  31. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  32. package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +44 -2
  33. package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
  34. package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
  35. package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
  36. package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
  37. package/ReactCommon/react/debug/CMakeLists.txt +2 -1
  38. package/ReactCommon/react/debug/React-debug.podspec +7 -1
  39. package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
  40. package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
  41. package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
  42. package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
  43. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
  44. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
  45. package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
  46. package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
  47. package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
  48. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
  49. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
  50. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +58 -22
  51. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
  52. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +9 -1
  53. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
  54. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
  55. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
  56. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
  57. package/package.json +10 -10
  58. package/src/private/featureflags/ReactNativeFeatureFlags.js +11 -1
  59. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
@@ -0,0 +1,173 @@
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
+
8
+ #include <gtest/gtest.h>
9
+ #include <react/debug/redbox/JscSafeUrl.h>
10
+
11
+ using namespace facebook::react::unstable_redbox;
12
+
13
+ // --- toNormalUrl ---
14
+
15
+ // Rewrites urls treating //& in paths as ?
16
+ TEST(JscSafeUrlTest, ToNormalUrl_RewritesMarkerInAbsolutePath) {
17
+ EXPECT_EQ(
18
+ toNormalUrl("/path1/path2//&foo=bar?bar=baz#frag?"),
19
+ "/path1/path2?foo=bar&bar=baz#frag?");
20
+ // Idempotent
21
+ EXPECT_EQ(
22
+ toNormalUrl("/path1/path2?foo=bar&bar=baz#frag?"),
23
+ "/path1/path2?foo=bar&bar=baz#frag?");
24
+ }
25
+
26
+ TEST(JscSafeUrlTest, ToNormalUrl_RewritesMarkerInRelativePathWithEncoding) {
27
+ EXPECT_EQ(
28
+ toNormalUrl("relative/path/with%3B%26/encoded//&foo=bar?bar=baz#frag?"),
29
+ "relative/path/with%3B%26/encoded?foo=bar&bar=baz#frag?");
30
+ EXPECT_EQ(
31
+ toNormalUrl("relative/path/with%3B%26/encoded?foo=bar&bar=baz#frag?"),
32
+ "relative/path/with%3B%26/encoded?foo=bar&bar=baz#frag?");
33
+ }
34
+
35
+ TEST(JscSafeUrlTest, ToNormalUrl_RewritesMarkerInFullUrl) {
36
+ EXPECT_EQ(
37
+ toNormalUrl(
38
+ "https://user:password@mydomain.com:8080/path1/path2//&foo=bar?bar=baz#frag?"),
39
+ "https://user:password@mydomain.com:8080/path1/path2?foo=bar&bar=baz#frag?");
40
+ EXPECT_EQ(
41
+ toNormalUrl(
42
+ "https://user:password@mydomain.com:8080/path1/path2?foo=bar&bar=baz#frag?"),
43
+ "https://user:password@mydomain.com:8080/path1/path2?foo=bar&bar=baz#frag?");
44
+ }
45
+
46
+ TEST(JscSafeUrlTest, ToNormalUrl_RewritesMarkerWithoutFragment) {
47
+ EXPECT_EQ(
48
+ toNormalUrl("http://127.0.0.1/path1/path2//&foo=bar&bar=baz"),
49
+ "http://127.0.0.1/path1/path2?foo=bar&bar=baz");
50
+ EXPECT_EQ(
51
+ toNormalUrl("http://127.0.0.1/path1/path2?foo=bar&bar=baz"),
52
+ "http://127.0.0.1/path1/path2?foo=bar&bar=baz");
53
+ }
54
+
55
+ // Returns other strings exactly as given
56
+ TEST(JscSafeUrlTest, ToNormalUrl_PassthroughForQueryWithMarkerAfter) {
57
+ auto url = "http://user:password/@mydomain.com/foo?bar=zoo?baz=quux//&";
58
+ EXPECT_EQ(toNormalUrl(url), url);
59
+ }
60
+
61
+ TEST(JscSafeUrlTest, ToNormalUrl_PassthroughForSimpleQuery) {
62
+ auto url = "/foo?bar=zoo?baz=quux";
63
+ EXPECT_EQ(toNormalUrl(url), url);
64
+ }
65
+
66
+ TEST(JscSafeUrlTest, ToNormalUrl_PassthroughForOpaqueUri) {
67
+ auto url = "proto:arbitrary_bad_url";
68
+ EXPECT_EQ(toNormalUrl(url), url);
69
+ }
70
+
71
+ TEST(JscSafeUrlTest, ToNormalUrl_PassthroughForStar) {
72
+ EXPECT_EQ(toNormalUrl("*"), "*");
73
+ }
74
+
75
+ TEST(JscSafeUrlTest, ToNormalUrl_PassthroughForRelativePath) {
76
+ auto url = "relative/path";
77
+ EXPECT_EQ(toNormalUrl(url), url);
78
+ }
79
+
80
+ // --- toJscSafeUrl ---
81
+
82
+ // Replaces the first ? with a JSC-friendly delimiter, url-encodes subsequent
83
+ // ?, and is idempotent
84
+ TEST(JscSafeUrlTest, ToJscSafeUrl_FullUrlWithEncodedQuestionMark) {
85
+ auto input =
86
+ "https://user:password@mydomain.com:8080/path1/path2?foo=bar&bar=question?#frag?";
87
+ auto output =
88
+ "https://user:password@mydomain.com:8080/path1/path2//&foo=bar&bar=question%3F#frag?";
89
+ EXPECT_EQ(toJscSafeUrl(input), output);
90
+ EXPECT_EQ(toJscSafeUrl(output), output);
91
+ }
92
+
93
+ TEST(JscSafeUrlTest, ToJscSafeUrl_SimpleUrl) {
94
+ auto input = "http://127.0.0.1/path1/path2?foo=bar";
95
+ auto output = "http://127.0.0.1/path1/path2//&foo=bar";
96
+ EXPECT_EQ(toJscSafeUrl(input), output);
97
+ EXPECT_EQ(toJscSafeUrl(output), output);
98
+ }
99
+
100
+ TEST(JscSafeUrlTest, ToJscSafeUrl_PassthroughForStar) {
101
+ EXPECT_EQ(toJscSafeUrl("*"), "*");
102
+ EXPECT_EQ(toJscSafeUrl("*"), "*");
103
+ }
104
+
105
+ TEST(JscSafeUrlTest, ToJscSafeUrl_PassthroughForAbsolutePath) {
106
+ EXPECT_EQ(toJscSafeUrl("/absolute/path"), "/absolute/path");
107
+ EXPECT_EQ(toJscSafeUrl("/absolute/path"), "/absolute/path");
108
+ }
109
+
110
+ TEST(JscSafeUrlTest, ToJscSafeUrl_PassthroughForRelativePath) {
111
+ EXPECT_EQ(toJscSafeUrl("relative/path"), "relative/path");
112
+ EXPECT_EQ(toJscSafeUrl("relative/path"), "relative/path");
113
+ }
114
+
115
+ TEST(JscSafeUrlTest, ToJscSafeUrl_EmptyQueryDropped) {
116
+ EXPECT_EQ(toJscSafeUrl("/?"), "/");
117
+ EXPECT_EQ(toJscSafeUrl("/"), "/");
118
+ }
119
+
120
+ TEST(JscSafeUrlTest, ToJscSafeUrl_PassthroughForUrlWithoutQuery) {
121
+ auto url = "http://127.0.0.1/path1/path";
122
+ EXPECT_EQ(toJscSafeUrl(url), url);
123
+ EXPECT_EQ(toJscSafeUrl(url), url);
124
+ }
125
+
126
+ TEST(JscSafeUrlTest, ToJscSafeUrl_AbsolutePathWithEncodedQuestionMark) {
127
+ auto input = "/path1/path2?foo=bar&bar=question?#frag?";
128
+ auto output = "/path1/path2//&foo=bar&bar=question%3F#frag?";
129
+ EXPECT_EQ(toJscSafeUrl(input), output);
130
+ EXPECT_EQ(toJscSafeUrl(output), output);
131
+ }
132
+
133
+ TEST(JscSafeUrlTest, ToJscSafeUrl_RelativePathWithEncodedQuestionMark) {
134
+ auto input = "relative/path?foo=bar&bar=question?#frag?";
135
+ auto output = "relative/path//&foo=bar&bar=question%3F#frag?";
136
+ EXPECT_EQ(toJscSafeUrl(input), output);
137
+ EXPECT_EQ(toJscSafeUrl(output), output);
138
+ }
139
+
140
+ TEST(JscSafeUrlTest, ToJscSafeUrl_AlreadySafeWithExtraQuery) {
141
+ auto input = "/path1/path2//&foo=bar&bar=question%3F?extra=query#frag?";
142
+ auto output = "/path1/path2//&foo=bar&bar=question%3F&extra=query#frag?";
143
+ EXPECT_EQ(toJscSafeUrl(input), output);
144
+ EXPECT_EQ(toJscSafeUrl(output), output);
145
+ }
146
+
147
+ // Throws on a URL with an empty path and a query string
148
+ TEST(JscSafeUrlTest, ToJscSafeUrl_ThrowsForEmptyPathWithQuery) {
149
+ EXPECT_THROW(toJscSafeUrl("http://127.0.0.1?foo=bar"), std::invalid_argument);
150
+ EXPECT_THROW(toJscSafeUrl("http://127.0.0.1?q#hash"), std::invalid_argument);
151
+ EXPECT_THROW(toJscSafeUrl("?foo=bar"), std::invalid_argument);
152
+ EXPECT_THROW(toJscSafeUrl("?foo=/bar#hash"), std::invalid_argument);
153
+ EXPECT_THROW(toJscSafeUrl("/?bar=baz/"), std::invalid_argument);
154
+ }
155
+
156
+ // --- isJscSafeUrl ---
157
+
158
+ TEST(JscSafeUrlTest, IsJscSafeUrl_TrueForSafeUrls) {
159
+ EXPECT_TRUE(isJscSafeUrl("http://example.com//&foo=bar//#frag=//"));
160
+ EXPECT_TRUE(isJscSafeUrl("http://example.com/with/path//&foo=bar//#frag=//"));
161
+ EXPECT_TRUE(isJscSafeUrl("//&foo=bar//#frag=//"));
162
+ EXPECT_TRUE(isJscSafeUrl("relative/path///&foo=bar//&#frag=//&"));
163
+ EXPECT_TRUE(isJscSafeUrl("/absolute/path//&foo=bar//&#frag=//&"));
164
+ }
165
+
166
+ TEST(JscSafeUrlTest, IsJscSafeUrl_FalseForNormalUrls) {
167
+ EXPECT_FALSE(isJscSafeUrl("http://example.com?foo=bar//&#frag=//"));
168
+ EXPECT_FALSE(
169
+ isJscSafeUrl("http://example.com/with/path/?foo=bar//&#frag=//"));
170
+ EXPECT_FALSE(isJscSafeUrl("?foo=bar//&#frag=//&"));
171
+ EXPECT_FALSE(isJscSafeUrl("relative/path/?foo=bar//#frag=//"));
172
+ EXPECT_FALSE(isJscSafeUrl("/absolute/path/?foo=bar//&#frag=//"));
173
+ }
@@ -0,0 +1,107 @@
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
+
8
+ #include <gtest/gtest.h>
9
+ #include <react/debug/redbox/RedBoxErrorParser.h>
10
+
11
+ using namespace facebook::react::unstable_redbox;
12
+
13
+ TEST(RedBoxErrorParserTest, ParsesBabelTransformError) {
14
+ auto result = parseErrorMessage(
15
+ "SyntaxError: /path/to/file.js: Unexpected token (10:5)\n\n"
16
+ "> 10 | const x = {\n"
17
+ " | ^");
18
+
19
+ EXPECT_EQ(result.title, "Syntax Error");
20
+ EXPECT_EQ(result.message, "Unexpected token");
21
+ ASSERT_TRUE(result.codeFrame.has_value());
22
+ EXPECT_EQ(result.codeFrame->fileName, "/path/to/file.js");
23
+ EXPECT_EQ(result.codeFrame->row, 10);
24
+ EXPECT_EQ(result.codeFrame->column, 5);
25
+ EXPECT_TRUE(result.isCompileError);
26
+ EXPECT_TRUE(result.isRetryable);
27
+ }
28
+
29
+ TEST(RedBoxErrorParserTest, ParsesMetroError) {
30
+ auto result = parseErrorMessage(
31
+ "InternalError Metro has encountered an error: "
32
+ "BundleError: Unable to resolve module (1:0)\n\n"
33
+ "code frame here");
34
+
35
+ EXPECT_EQ(result.title, "BundleError");
36
+ EXPECT_EQ(result.message, "Unable to resolve module");
37
+ ASSERT_TRUE(result.codeFrame.has_value());
38
+ EXPECT_EQ(result.codeFrame->row, 1);
39
+ EXPECT_TRUE(result.isCompileError);
40
+ }
41
+
42
+ TEST(RedBoxErrorParserTest, ParsesBundleLoadError_SyntaxError) {
43
+ auto result = parseErrorMessage(
44
+ "SyntaxError in /app/index.js: Unexpected token (3:10)\ncode frame");
45
+
46
+ EXPECT_EQ(result.title, "Syntax Error");
47
+ EXPECT_EQ(result.message, "Unexpected token");
48
+ ASSERT_TRUE(result.codeFrame.has_value());
49
+ EXPECT_EQ(result.codeFrame->fileName, "/app/index.js");
50
+ EXPECT_EQ(result.codeFrame->row, 3);
51
+ EXPECT_EQ(result.codeFrame->column, 10);
52
+ EXPECT_TRUE(result.isCompileError);
53
+ }
54
+
55
+ TEST(RedBoxErrorParserTest, ParsesBundleLoadError_UnableToResolve) {
56
+ auto result = parseErrorMessage(
57
+ "UnableToResolveError in /app/index.js: Cannot find module (1:0)");
58
+
59
+ EXPECT_EQ(result.title, "Module Not Found");
60
+ EXPECT_TRUE(result.isCompileError);
61
+ }
62
+
63
+ TEST(RedBoxErrorParserTest, ParsesGenericTransformError) {
64
+ auto result = parseErrorMessage("TransformError some error message");
65
+
66
+ EXPECT_EQ(result.title, "Syntax Error");
67
+ EXPECT_EQ(result.message, "TransformError some error message");
68
+ EXPECT_FALSE(result.codeFrame.has_value());
69
+ EXPECT_TRUE(result.isCompileError);
70
+ }
71
+
72
+ TEST(RedBoxErrorParserTest, DefaultsToUncaughtError) {
73
+ auto result = parseErrorMessage("TypeError: undefined is not a function");
74
+
75
+ EXPECT_EQ(result.title, "Uncaught Error");
76
+ EXPECT_EQ(result.message, "TypeError: undefined is not a function");
77
+ EXPECT_FALSE(result.codeFrame.has_value());
78
+ EXPECT_FALSE(result.isCompileError);
79
+ EXPECT_TRUE(result.isRetryable);
80
+ }
81
+
82
+ TEST(RedBoxErrorParserTest, UsesNameForTitle) {
83
+ auto result = parseErrorMessage("something broke", "CustomError");
84
+
85
+ EXPECT_EQ(result.title, "CustomError");
86
+ }
87
+
88
+ TEST(RedBoxErrorParserTest, UsesRenderErrorForComponentStack) {
89
+ auto result =
90
+ parseErrorMessage("something broke", "", "in MyComponent\nin App");
91
+
92
+ EXPECT_EQ(result.title, "Render Error");
93
+ }
94
+
95
+ TEST(RedBoxErrorParserTest, NonFatalDefaultsToError) {
96
+ auto result = parseErrorMessage("warning message", "", "", false);
97
+
98
+ EXPECT_EQ(result.title, "Error");
99
+ }
100
+
101
+ TEST(RedBoxErrorParserTest, HandlesEmptyMessage) {
102
+ auto result = parseErrorMessage("");
103
+
104
+ EXPECT_EQ(result.title, "Uncaught Error");
105
+ EXPECT_EQ(result.message, "");
106
+ EXPECT_FALSE(result.codeFrame.has_value());
107
+ }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<20973c91d9d7e791598083c0cee5b934>>
7
+ * @generated SignedSource<<9ceab23bb1cb8d569411222993ef9f1e>>
8
8
  */
9
9
 
10
10
  /**
@@ -290,6 +290,14 @@ bool ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion() {
290
290
  return getAccessor().preventShadowTreeCommitExhaustion();
291
291
  }
292
292
 
293
+ bool ReactNativeFeatureFlags::redBoxV2Android() {
294
+ return getAccessor().redBoxV2Android();
295
+ }
296
+
297
+ bool ReactNativeFeatureFlags::redBoxV2IOS() {
298
+ return getAccessor().redBoxV2IOS();
299
+ }
300
+
293
301
  bool ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover() {
294
302
  return getAccessor().shouldPressibilityUseW3CPointerEventsForHover();
295
303
  }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<ec187a2009bd901f242bf65034357e5f>>
7
+ * @generated SignedSource<<26b7504c2446d37c6540609a620854cb>>
8
8
  */
9
9
 
10
10
  /**
@@ -369,6 +369,16 @@ class ReactNativeFeatureFlags {
369
369
  */
370
370
  RN_EXPORT static bool preventShadowTreeCommitExhaustion();
371
371
 
372
+ /**
373
+ * Use the redesigned RedBox error overlay on Android, styled to match the LogBox visual language.
374
+ */
375
+ RN_EXPORT static bool redBoxV2Android();
376
+
377
+ /**
378
+ * Use the redesigned RedBox error overlay on iOS, styled to match the LogBox visual language.
379
+ */
380
+ RN_EXPORT static bool redBoxV2IOS();
381
+
372
382
  /**
373
383
  * Function used to enable / disable Pressibility from using W3C Pointer Events for its hover callbacks
374
384
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<3c510c97c279768dbf3bfd5c2b2c1903>>
7
+ * @generated SignedSource<<71a8a1e9b86beb41e91532bc07831dba>>
8
8
  */
9
9
 
10
10
  /**
@@ -1217,6 +1217,42 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() {
1217
1217
  return flagValue.value();
1218
1218
  }
1219
1219
 
1220
+ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() {
1221
+ auto flagValue = redBoxV2Android_.load();
1222
+
1223
+ if (!flagValue.has_value()) {
1224
+ // This block is not exclusive but it is not necessary.
1225
+ // If multiple threads try to initialize the feature flag, we would only
1226
+ // be accessing the provider multiple times but the end state of this
1227
+ // instance and the returned flag value would be the same.
1228
+
1229
+ markFlagAsAccessed(66, "redBoxV2Android");
1230
+
1231
+ flagValue = currentProvider_->redBoxV2Android();
1232
+ redBoxV2Android_ = flagValue;
1233
+ }
1234
+
1235
+ return flagValue.value();
1236
+ }
1237
+
1238
+ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() {
1239
+ auto flagValue = redBoxV2IOS_.load();
1240
+
1241
+ if (!flagValue.has_value()) {
1242
+ // This block is not exclusive but it is not necessary.
1243
+ // If multiple threads try to initialize the feature flag, we would only
1244
+ // be accessing the provider multiple times but the end state of this
1245
+ // instance and the returned flag value would be the same.
1246
+
1247
+ markFlagAsAccessed(67, "redBoxV2IOS");
1248
+
1249
+ flagValue = currentProvider_->redBoxV2IOS();
1250
+ redBoxV2IOS_ = flagValue;
1251
+ }
1252
+
1253
+ return flagValue.value();
1254
+ }
1255
+
1220
1256
  bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHover() {
1221
1257
  auto flagValue = shouldPressibilityUseW3CPointerEventsForHover_.load();
1222
1258
 
@@ -1226,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo
1226
1262
  // be accessing the provider multiple times but the end state of this
1227
1263
  // instance and the returned flag value would be the same.
1228
1264
 
1229
- markFlagAsAccessed(66, "shouldPressibilityUseW3CPointerEventsForHover");
1265
+ markFlagAsAccessed(68, "shouldPressibilityUseW3CPointerEventsForHover");
1230
1266
 
1231
1267
  flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover();
1232
1268
  shouldPressibilityUseW3CPointerEventsForHover_ = flagValue;
@@ -1244,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr
1244
1280
  // be accessing the provider multiple times but the end state of this
1245
1281
  // instance and the returned flag value would be the same.
1246
1282
 
1247
- markFlagAsAccessed(67, "shouldTriggerResponderTransferOnScrollAndroid");
1283
+ markFlagAsAccessed(69, "shouldTriggerResponderTransferOnScrollAndroid");
1248
1284
 
1249
1285
  flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid();
1250
1286
  shouldTriggerResponderTransferOnScrollAndroid_ = flagValue;
@@ -1262,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause()
1262
1298
  // be accessing the provider multiple times but the end state of this
1263
1299
  // instance and the returned flag value would be the same.
1264
1300
 
1265
- markFlagAsAccessed(68, "skipActivityIdentityAssertionOnHostPause");
1301
+ markFlagAsAccessed(70, "skipActivityIdentityAssertionOnHostPause");
1266
1302
 
1267
1303
  flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause();
1268
1304
  skipActivityIdentityAssertionOnHostPause_ = flagValue;
@@ -1280,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::sweepActiveTouchOnChildNativeGesturesAndro
1280
1316
  // be accessing the provider multiple times but the end state of this
1281
1317
  // instance and the returned flag value would be the same.
1282
1318
 
1283
- markFlagAsAccessed(69, "sweepActiveTouchOnChildNativeGesturesAndroid");
1319
+ markFlagAsAccessed(71, "sweepActiveTouchOnChildNativeGesturesAndroid");
1284
1320
 
1285
1321
  flagValue = currentProvider_->sweepActiveTouchOnChildNativeGesturesAndroid();
1286
1322
  sweepActiveTouchOnChildNativeGesturesAndroid_ = flagValue;
@@ -1298,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
1298
1334
  // be accessing the provider multiple times but the end state of this
1299
1335
  // instance and the returned flag value would be the same.
1300
1336
 
1301
- markFlagAsAccessed(70, "traceTurboModulePromiseRejectionsOnAndroid");
1337
+ markFlagAsAccessed(72, "traceTurboModulePromiseRejectionsOnAndroid");
1302
1338
 
1303
1339
  flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
1304
1340
  traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -1316,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit(
1316
1352
  // be accessing the provider multiple times but the end state of this
1317
1353
  // instance and the returned flag value would be the same.
1318
1354
 
1319
- markFlagAsAccessed(71, "updateRuntimeShadowNodeReferencesOnCommit");
1355
+ markFlagAsAccessed(73, "updateRuntimeShadowNodeReferencesOnCommit");
1320
1356
 
1321
1357
  flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
1322
1358
  updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
@@ -1334,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
1334
1370
  // be accessing the provider multiple times but the end state of this
1335
1371
  // instance and the returned flag value would be the same.
1336
1372
 
1337
- markFlagAsAccessed(72, "useAlwaysAvailableJSErrorHandling");
1373
+ markFlagAsAccessed(74, "useAlwaysAvailableJSErrorHandling");
1338
1374
 
1339
1375
  flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
1340
1376
  useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -1352,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
1352
1388
  // be accessing the provider multiple times but the end state of this
1353
1389
  // instance and the returned flag value would be the same.
1354
1390
 
1355
- markFlagAsAccessed(73, "useFabricInterop");
1391
+ markFlagAsAccessed(75, "useFabricInterop");
1356
1392
 
1357
1393
  flagValue = currentProvider_->useFabricInterop();
1358
1394
  useFabricInterop_ = flagValue;
@@ -1370,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeEqualsInNativeReadableArrayAndroi
1370
1406
  // be accessing the provider multiple times but the end state of this
1371
1407
  // instance and the returned flag value would be the same.
1372
1408
 
1373
- markFlagAsAccessed(74, "useNativeEqualsInNativeReadableArrayAndroid");
1409
+ markFlagAsAccessed(76, "useNativeEqualsInNativeReadableArrayAndroid");
1374
1410
 
1375
1411
  flagValue = currentProvider_->useNativeEqualsInNativeReadableArrayAndroid();
1376
1412
  useNativeEqualsInNativeReadableArrayAndroid_ = flagValue;
@@ -1388,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeTransformHelperAndroid() {
1388
1424
  // be accessing the provider multiple times but the end state of this
1389
1425
  // instance and the returned flag value would be the same.
1390
1426
 
1391
- markFlagAsAccessed(75, "useNativeTransformHelperAndroid");
1427
+ markFlagAsAccessed(77, "useNativeTransformHelperAndroid");
1392
1428
 
1393
1429
  flagValue = currentProvider_->useNativeTransformHelperAndroid();
1394
1430
  useNativeTransformHelperAndroid_ = flagValue;
@@ -1406,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
1406
1442
  // be accessing the provider multiple times but the end state of this
1407
1443
  // instance and the returned flag value would be the same.
1408
1444
 
1409
- markFlagAsAccessed(76, "useNativeViewConfigsInBridgelessMode");
1445
+ markFlagAsAccessed(78, "useNativeViewConfigsInBridgelessMode");
1410
1446
 
1411
1447
  flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
1412
1448
  useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -1424,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
1424
1460
  // be accessing the provider multiple times but the end state of this
1425
1461
  // instance and the returned flag value would be the same.
1426
1462
 
1427
- markFlagAsAccessed(77, "useOptimizedEventBatchingOnAndroid");
1463
+ markFlagAsAccessed(79, "useOptimizedEventBatchingOnAndroid");
1428
1464
 
1429
1465
  flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
1430
1466
  useOptimizedEventBatchingOnAndroid_ = flagValue;
@@ -1442,7 +1478,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
1442
1478
  // be accessing the provider multiple times but the end state of this
1443
1479
  // instance and the returned flag value would be the same.
1444
1480
 
1445
- markFlagAsAccessed(78, "useRawPropsJsiValue");
1481
+ markFlagAsAccessed(80, "useRawPropsJsiValue");
1446
1482
 
1447
1483
  flagValue = currentProvider_->useRawPropsJsiValue();
1448
1484
  useRawPropsJsiValue_ = flagValue;
@@ -1460,7 +1496,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
1460
1496
  // be accessing the provider multiple times but the end state of this
1461
1497
  // instance and the returned flag value would be the same.
1462
1498
 
1463
- markFlagAsAccessed(79, "useShadowNodeStateOnClone");
1499
+ markFlagAsAccessed(81, "useShadowNodeStateOnClone");
1464
1500
 
1465
1501
  flagValue = currentProvider_->useShadowNodeStateOnClone();
1466
1502
  useShadowNodeStateOnClone_ = flagValue;
@@ -1478,7 +1514,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() {
1478
1514
  // be accessing the provider multiple times but the end state of this
1479
1515
  // instance and the returned flag value would be the same.
1480
1516
 
1481
- markFlagAsAccessed(80, "useSharedAnimatedBackend");
1517
+ markFlagAsAccessed(82, "useSharedAnimatedBackend");
1482
1518
 
1483
1519
  flagValue = currentProvider_->useSharedAnimatedBackend();
1484
1520
  useSharedAnimatedBackend_ = flagValue;
@@ -1496,7 +1532,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() {
1496
1532
  // be accessing the provider multiple times but the end state of this
1497
1533
  // instance and the returned flag value would be the same.
1498
1534
 
1499
- markFlagAsAccessed(81, "useTraitHiddenOnAndroid");
1535
+ markFlagAsAccessed(83, "useTraitHiddenOnAndroid");
1500
1536
 
1501
1537
  flagValue = currentProvider_->useTraitHiddenOnAndroid();
1502
1538
  useTraitHiddenOnAndroid_ = flagValue;
@@ -1514,7 +1550,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
1514
1550
  // be accessing the provider multiple times but the end state of this
1515
1551
  // instance and the returned flag value would be the same.
1516
1552
 
1517
- markFlagAsAccessed(82, "useTurboModuleInterop");
1553
+ markFlagAsAccessed(84, "useTurboModuleInterop");
1518
1554
 
1519
1555
  flagValue = currentProvider_->useTurboModuleInterop();
1520
1556
  useTurboModuleInterop_ = flagValue;
@@ -1532,7 +1568,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
1532
1568
  // be accessing the provider multiple times but the end state of this
1533
1569
  // instance and the returned flag value would be the same.
1534
1570
 
1535
- markFlagAsAccessed(83, "useTurboModules");
1571
+ markFlagAsAccessed(85, "useTurboModules");
1536
1572
 
1537
1573
  flagValue = currentProvider_->useTurboModules();
1538
1574
  useTurboModules_ = flagValue;
@@ -1550,7 +1586,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() {
1550
1586
  // be accessing the provider multiple times but the end state of this
1551
1587
  // instance and the returned flag value would be the same.
1552
1588
 
1553
- markFlagAsAccessed(84, "viewCullingOutsetRatio");
1589
+ markFlagAsAccessed(86, "viewCullingOutsetRatio");
1554
1590
 
1555
1591
  flagValue = currentProvider_->viewCullingOutsetRatio();
1556
1592
  viewCullingOutsetRatio_ = flagValue;
@@ -1568,7 +1604,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() {
1568
1604
  // be accessing the provider multiple times but the end state of this
1569
1605
  // instance and the returned flag value would be the same.
1570
1606
 
1571
- markFlagAsAccessed(85, "virtualViewHysteresisRatio");
1607
+ markFlagAsAccessed(87, "virtualViewHysteresisRatio");
1572
1608
 
1573
1609
  flagValue = currentProvider_->virtualViewHysteresisRatio();
1574
1610
  virtualViewHysteresisRatio_ = flagValue;
@@ -1586,7 +1622,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
1586
1622
  // be accessing the provider multiple times but the end state of this
1587
1623
  // instance and the returned flag value would be the same.
1588
1624
 
1589
- markFlagAsAccessed(86, "virtualViewPrerenderRatio");
1625
+ markFlagAsAccessed(88, "virtualViewPrerenderRatio");
1590
1626
 
1591
1627
  flagValue = currentProvider_->virtualViewPrerenderRatio();
1592
1628
  virtualViewPrerenderRatio_ = flagValue;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<c2d5d69c054d37738687e71db5da210d>>
7
+ * @generated SignedSource<<7286fc61200f969c22910f37180ad481>>
8
8
  */
9
9
 
10
10
  /**
@@ -98,6 +98,8 @@ class ReactNativeFeatureFlagsAccessor {
98
98
  bool perfMonitorV2Enabled();
99
99
  double preparedTextCacheSize();
100
100
  bool preventShadowTreeCommitExhaustion();
101
+ bool redBoxV2Android();
102
+ bool redBoxV2IOS();
101
103
  bool shouldPressibilityUseW3CPointerEventsForHover();
102
104
  bool shouldTriggerResponderTransferOnScrollAndroid();
103
105
  bool skipActivityIdentityAssertionOnHostPause();
@@ -130,7 +132,7 @@ class ReactNativeFeatureFlagsAccessor {
130
132
  std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
131
133
  bool wasOverridden_;
132
134
 
133
- std::array<std::atomic<const char*>, 87> accessedFeatureFlags_;
135
+ std::array<std::atomic<const char*>, 89> accessedFeatureFlags_;
134
136
 
135
137
  std::atomic<std::optional<bool>> commonTestFlag_;
136
138
  std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
@@ -198,6 +200,8 @@ class ReactNativeFeatureFlagsAccessor {
198
200
  std::atomic<std::optional<bool>> perfMonitorV2Enabled_;
199
201
  std::atomic<std::optional<double>> preparedTextCacheSize_;
200
202
  std::atomic<std::optional<bool>> preventShadowTreeCommitExhaustion_;
203
+ std::atomic<std::optional<bool>> redBoxV2Android_;
204
+ std::atomic<std::optional<bool>> redBoxV2IOS_;
201
205
  std::atomic<std::optional<bool>> shouldPressibilityUseW3CPointerEventsForHover_;
202
206
  std::atomic<std::optional<bool>> shouldTriggerResponderTransferOnScrollAndroid_;
203
207
  std::atomic<std::optional<bool>> skipActivityIdentityAssertionOnHostPause_;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<d726518e7e191f59f8c89b5c14c168fd>>
7
+ * @generated SignedSource<<0118a824a779b337399cb008d2c40af2>>
8
8
  */
9
9
 
10
10
  /**
@@ -291,6 +291,14 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
291
291
  return false;
292
292
  }
293
293
 
294
+ bool redBoxV2Android() override {
295
+ return false;
296
+ }
297
+
298
+ bool redBoxV2IOS() override {
299
+ return false;
300
+ }
301
+
294
302
  bool shouldPressibilityUseW3CPointerEventsForHover() override {
295
303
  return false;
296
304
  }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<6e8731d9d7642d65b9b707741ef71873>>
7
+ * @generated SignedSource<<1434eae86af219c2c989aade2e59968d>>
8
8
  */
9
9
 
10
10
  /**
@@ -639,6 +639,24 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
639
639
  return ReactNativeFeatureFlagsDefaults::preventShadowTreeCommitExhaustion();
640
640
  }
641
641
 
642
+ bool redBoxV2Android() override {
643
+ auto value = values_["redBoxV2Android"];
644
+ if (!value.isNull()) {
645
+ return value.getBool();
646
+ }
647
+
648
+ return ReactNativeFeatureFlagsDefaults::redBoxV2Android();
649
+ }
650
+
651
+ bool redBoxV2IOS() override {
652
+ auto value = values_["redBoxV2IOS"];
653
+ if (!value.isNull()) {
654
+ return value.getBool();
655
+ }
656
+
657
+ return ReactNativeFeatureFlagsDefaults::redBoxV2IOS();
658
+ }
659
+
642
660
  bool shouldPressibilityUseW3CPointerEventsForHover() override {
643
661
  auto value = values_["shouldPressibilityUseW3CPointerEventsForHover"];
644
662
  if (!value.isNull()) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<886710691ddc524f90129b6921cb2c2a>>
7
+ * @generated SignedSource<<990b3d661a81316160046f01bba5e683>>
8
8
  */
9
9
 
10
10
  /**
@@ -91,6 +91,8 @@ class ReactNativeFeatureFlagsProvider {
91
91
  virtual bool perfMonitorV2Enabled() = 0;
92
92
  virtual double preparedTextCacheSize() = 0;
93
93
  virtual bool preventShadowTreeCommitExhaustion() = 0;
94
+ virtual bool redBoxV2Android() = 0;
95
+ virtual bool redBoxV2IOS() = 0;
94
96
  virtual bool shouldPressibilityUseW3CPointerEventsForHover() = 0;
95
97
  virtual bool shouldTriggerResponderTransferOnScrollAndroid() = 0;
96
98
  virtual bool skipActivityIdentityAssertionOnHostPause() = 0;