react-native 0.83.0-rc.4 → 0.83.0

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.
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
29
29
  static major: number = 0;
30
30
  static minor: number = 83;
31
31
  static patch: number = 0;
32
- static prerelease: string | null = 'rc.4';
32
+ static prerelease: string | null = null;
33
33
 
34
34
  static getVersionString(): string {
35
35
  return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(83),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.4",
27
+ RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.83.0-rc.4
1
+ VERSION_NAME=0.83.0
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
  react.internal.hermesPublishingGroup=com.facebook.hermes
4
4
 
@@ -35,7 +35,8 @@ internal object NetworkEventUtil {
35
35
  request.url().toString(),
36
36
  request.method(),
37
37
  headersMap,
38
- request.body()?.toString().orEmpty(),
38
+ (request.body() as? ProgressRequestBody)?.getBodyPreview()
39
+ ?: request.body()?.toString().orEmpty(),
39
40
  request.body()?.contentLength() ?: 0,
40
41
  )
41
42
  InspectorNetworkReporter.reportConnectionTiming(devToolsRequestId, headersMap)
@@ -23,6 +23,10 @@ internal class ProgressRequestBody(
23
23
  ) : RequestBody() {
24
24
  private var contentLength = 0L
25
25
 
26
+ companion object {
27
+ private const val MAX_BODY_PREVIEW_SIZE = 1024 * 1024 // 1MB
28
+ }
29
+
26
30
  override fun contentType(): MediaType? {
27
31
  return requestBody.contentType()
28
32
  }
@@ -78,4 +82,20 @@ internal class ProgressRequestBody(
78
82
  }
79
83
  )
80
84
  }
85
+
86
+ fun getBodyPreview(): String {
87
+ return try {
88
+ val buffer = okio.Buffer()
89
+ requestBody.writeTo(buffer)
90
+ val size = buffer.size()
91
+ if (size <= MAX_BODY_PREVIEW_SIZE) {
92
+ buffer.readUtf8()
93
+ } else {
94
+ buffer.readUtf8(MAX_BODY_PREVIEW_SIZE.toLong()) +
95
+ "\n... [truncated, showing $MAX_BODY_PREVIEW_SIZE of $size bytes]"
96
+ }
97
+ } catch (e: Exception) {
98
+ ""
99
+ }
100
+ }
81
101
  }
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 83,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.4"
18
+ "prerelease" to null
19
19
  )
20
20
  }
@@ -338,3 +338,10 @@ target_include_directories(reactnative
338
338
  $<TARGET_PROPERTY:uimanagerjni,INTERFACE_INCLUDE_DIRECTORIES>
339
339
  $<TARGET_PROPERTY:yoga,INTERFACE_INCLUDE_DIRECTORIES>
340
340
  )
341
+
342
+ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
343
+ target_compile_options(reactnative PRIVATE
344
+ -DREACT_NATIVE_DEBUGGER_ENABLED=1
345
+ -DREACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1
346
+ )
347
+ endif ()
@@ -23,3 +23,10 @@ target_link_libraries(react_devsupportjni
23
23
  react_networking)
24
24
 
25
25
  target_compile_reactnative_options(react_devsupportjni PRIVATE)
26
+
27
+ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
28
+ target_compile_options(react_devsupportjni PRIVATE
29
+ -DREACT_NATIVE_DEBUGGER_ENABLED=1
30
+ -DREACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1
31
+ )
32
+ endif ()
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 83;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "rc.4";
25
+ std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -147,7 +147,7 @@ class HostAgent::Impl final {
147
147
  if (InspectorFlags::getInstance().getNetworkInspectionEnabled()) {
148
148
  if (req.method == "Network.enable") {
149
149
  auto& inspector = getInspectorInstance();
150
- if (inspector.getSystemState().registeredPagesCount > 1) {
150
+ if (inspector.getSystemState().registeredHostsCount > 1) {
151
151
  frontendChannel_(
152
152
  cdp::jsonError(
153
153
  req.id,
@@ -231,7 +231,7 @@ class HostAgent::Impl final {
231
231
  "ReactNativeApplication.metadataUpdated",
232
232
  createHostMetadataPayload(hostMetadata_)));
233
233
  auto& inspector = getInspectorInstance();
234
- bool isSingleHost = inspector.getSystemState().registeredPagesCount <= 1;
234
+ bool isSingleHost = inspector.getSystemState().registeredHostsCount <= 1;
235
235
  if (!isSingleHost) {
236
236
  emitSystemStateChanged(isSingleHost);
237
237
  }
@@ -67,8 +67,8 @@ class InspectorImpl : public IInspector {
67
67
  public:
68
68
  explicit SystemStateListener(InspectorSystemState& state) : state_(state) {}
69
69
 
70
- void onPageAdded(int /*pageId*/) override {
71
- state_.registeredPagesCount++;
70
+ void unstable_onHostTargetAdded() override {
71
+ state_.registeredHostsCount++;
72
72
  }
73
73
 
74
74
  private:
@@ -94,6 +94,7 @@ class InspectorImpl : public IInspector {
94
94
  ConnectFunc connectFunc_;
95
95
  InspectorTargetCapabilities capabilities_;
96
96
  };
97
+
97
98
  mutable std::mutex mutex_;
98
99
  int nextPageId_{1};
99
100
  std::map<int, Page> pages_;
@@ -142,9 +143,13 @@ int InspectorImpl::addPage(
142
143
  pageId,
143
144
  Page{pageId, description, vm, std::move(connectFunc), capabilities});
144
145
 
145
- for (const auto& listenerWeak : listeners_) {
146
- if (auto listener = listenerWeak.lock()) {
147
- listener->onPageAdded(pageId);
146
+ // Strong assumption: If prefersFuseboxFrontend is set, the page added is a
147
+ // HostTarget and not a legacy Hermes runtime target.
148
+ if (capabilities.prefersFuseboxFrontend) {
149
+ for (const auto& listenerWeak : listeners_) {
150
+ if (auto listener = listenerWeak.lock()) {
151
+ listener->unstable_onHostTargetAdded();
152
+ }
148
153
  }
149
154
  }
150
155
 
@@ -53,7 +53,7 @@ using InspectorPage = InspectorPageDescription;
53
53
 
54
54
  struct InspectorSystemState {
55
55
  /** The total count of pages registered during the app lifetime. */
56
- int registeredPagesCount;
56
+ int registeredHostsCount;
57
57
  };
58
58
 
59
59
  /// IRemoteConnection allows the VM to send debugger messages to the client.
@@ -83,7 +83,7 @@ class JSINSPECTOR_EXPORT ILocalConnection : public IDestructible {
83
83
  class JSINSPECTOR_EXPORT IPageStatusListener : public IDestructible {
84
84
  public:
85
85
  virtual ~IPageStatusListener() = 0;
86
- virtual void onPageAdded(int /*pageId*/) {}
86
+ virtual void unstable_onHostTargetAdded() {}
87
87
  virtual void onPageRemoved(int /*pageId*/) {}
88
88
  };
89
89
 
@@ -54,7 +54,7 @@ TracingAgent::~TracingAgent() {
54
54
  bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) {
55
55
  if (req.method == "Tracing.start") {
56
56
  auto& inspector = getInspectorInstance();
57
- if (inspector.getSystemState().registeredPagesCount > 1) {
57
+ if (inspector.getSystemState().registeredHostsCount > 1) {
58
58
  frontendChannel_(
59
59
  cdp::jsonError(
60
60
  req.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.83.0-rc.4",
3
+ "version": "0.83.0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -160,13 +160,13 @@
160
160
  },
161
161
  "dependencies": {
162
162
  "@jest/create-cache-key-function": "^29.7.0",
163
- "@react-native/assets-registry": "0.83.0-rc.4",
164
- "@react-native/codegen": "0.83.0-rc.4",
165
- "@react-native/community-cli-plugin": "0.83.0-rc.4",
166
- "@react-native/gradle-plugin": "0.83.0-rc.4",
167
- "@react-native/js-polyfills": "0.83.0-rc.4",
168
- "@react-native/normalize-colors": "0.83.0-rc.4",
169
- "@react-native/virtualized-lists": "0.83.0-rc.4",
163
+ "@react-native/assets-registry": "0.83.0",
164
+ "@react-native/codegen": "0.83.0",
165
+ "@react-native/community-cli-plugin": "0.83.0",
166
+ "@react-native/gradle-plugin": "0.83.0",
167
+ "@react-native/js-polyfills": "0.83.0",
168
+ "@react-native/normalize-colors": "0.83.0",
169
+ "@react-native/virtualized-lists": "0.83.0",
170
170
  "abort-controller": "^3.0.0",
171
171
  "anser": "^1.4.9",
172
172
  "ansi-regex": "^5.0.0",
@@ -58,9 +58,11 @@ class ReactNativePodsUtils
58
58
 
59
59
  def self.set_gcc_preprocessor_definition_for_debugger(installer)
60
60
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-jsinspector", :debug)
61
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-jsinspectornetwork", :debug)
61
62
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-RCTNetwork", :debug)
62
63
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-networking", :debug)
63
64
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-jsinspector", :debug)
65
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-jsinspectornetwork", :debug)
64
66
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-RCTNetwork", :debug)
65
67
  self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-networking", :debug)
66
68
  end