Skip to content

Commit b47b96b

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Move RecoverableError to its own target and the frameworks tier
Summary: `cxxreact/RecoverableError.h` was exported only by `cxxreact:bridge` and guarded as private, so libraries could not use it under `RN_STRICT_API`, and the bridgeless Android runtime had to depend on the bridge to get it. - Add a header-only `cxxreact:recoverableerror` target. The include path stays `<cxxreact/RecoverableError.h>`; `cxxreact:bridge` re-exports it for existing users. - Move the header from the private tier to "for frameworks" (`FrameworksGuard.h`). - `ReactAndroid`'s `runtime/jni` depends on `cxxreact:recoverableerror` instead of `cxxreact:bridge`. - Remove the unused include from `Instance.cpp`. Changelog: [General][Changed] - Move `RecoverableError` from private headers to "for frameworks" headers Differential Revision: D124957581
1 parent 95941fd commit b47b96b

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎packages/react-native/ReactCommon/cxxreact/Instance.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "MethodCall.h"
1818
#include "NativeToJsBridge.h"
1919
#include "RAMBundleRegistry.h"
20-
#include "RecoverableError.h"
2120
#include "TraceSection.h"
2221

2322
#include <folly/json.h>

‎packages/react-native/ReactCommon/cxxreact/RecoverableError.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/PrivateGuard.h>
10+
#include <react/cxxstableapi/FrameworksGuard.h>
1111

1212
#include <exception>
1313
#include <functional>

‎scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6439,6 +6439,13 @@ struct facebook::react::ReadableType : public facebook::jni::JavaClass<facebook:
64396439
public static jni::alias_ref<facebook::react::ReadableType> getType(folly::dynamic::Type type);
64406440
}
64416441

6442+
struct facebook::react::RecoverableError : public std::exception {
6443+
public RecoverableError(const std::string& what_);
6444+
public virtual const char* what() const noexcept override;
6445+
template <typename E>
6446+
public static void runRethrowingAsRecoverable(std::function<void()> act);
6447+
}
6448+
64426449
struct facebook::react::Rect {
64436450
public bool containsPoint(facebook::react::Point point) noexcept;
64446451
public bool operator==(const facebook::react::Rect& rhs) const noexcept = default;

‎scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8474,6 +8474,13 @@ struct facebook::react::ReactNativeVersionType {
84748474
public std::string_view Prerelease;
84758475
}
84768476

8477+
struct facebook::react::RecoverableError : public std::exception {
8478+
public RecoverableError(const std::string& what_);
8479+
public virtual const char* what() const noexcept override;
8480+
template <typename E>
8481+
public static void runRethrowingAsRecoverable(std::function<void()> act);
8482+
}
8483+
84778484
struct facebook::react::Rect {
84788485
public bool containsPoint(facebook::react::Point point) noexcept;
84798486
public bool operator==(const facebook::react::Rect& rhs) const noexcept = default;

‎scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4620,6 +4620,13 @@ struct facebook::react::ReactNativeVersionType {
46204620
public std::string_view Prerelease;
46214621
}
46224622

4623+
struct facebook::react::RecoverableError : public std::exception {
4624+
public RecoverableError(const std::string& what_);
4625+
public virtual const char* what() const noexcept override;
4626+
template <typename E>
4627+
public static void runRethrowingAsRecoverable(std::function<void()> act);
4628+
}
4629+
46234630
struct facebook::react::Rect {
46244631
public Float getMaxX() const noexcept;
46254632
public Float getMaxY() const noexcept;

0 commit comments

Comments
 (0)