From b9449cc4a4caee8377cdfe80fc7986a8a804ff3b Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 13 Jul 2026 13:51:24 -0400 Subject: [PATCH] feat(react-native): add pr57517 bundle url provider patch --- README.md | 1 + .../react-native/react-native-pr57517.patch | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 packages/react-native/react-native-pr57517.patch diff --git a/README.md b/README.md index 5e9f88f..aa31303 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Still open upstream, so the fix could change. Every row has a patch in `packages | Package | Version | Fix | PR | | :--------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------- | +| [`react-native`](packages/react-native/) | n/a | Declare `RCTBundleURLProviderAllowPackagerServerAccess` unconditionally so the dev-only API stops vanishing in Release builds and breaking out-of-tree callers. | [react/react-native#57517](https://github.com/react/react-native/pull/57517) | | [`expo`](packages/expo/) | n/a | Exit 1 when docs API data generation fails for any package and run the `expotools` test suite in CI, so dead mapping entries stop shipping silently. | [expo/expo#47691](https://github.com/expo/expo/pull/47691) | | [`expo-updates`](packages/expo-updates/) | `57.0.6` | Fix the Xcode 14+ warning about `EXUpdates.podspec`'s updates-resources script phase on every clean build. | [expo/expo#47622](https://github.com/expo/expo/pull/47622) | | [`hermes`](packages/hermes/) | n/a | Cherry-pick `1e94fbe0eb` onto `250829098.0.0-stable`. A class declared in a `finally` block miscompiles ([facebook/hermes#1761](https://github.com/facebook/hermes/issues/1761)). | [facebook/hermes#2046](https://github.com/facebook/hermes/pull/2046) | diff --git a/packages/react-native/react-native-pr57517.patch b/packages/react-native/react-native-pr57517.patch new file mode 100644 index 0000000..25e66af --- /dev/null +++ b/packages/react-native/react-native-pr57517.patch @@ -0,0 +1,44 @@ +diff --git a/packages/react-native/React/Base/RCTBundleURLProvider.h b/packages/react-native/React/Base/RCTBundleURLProvider.h +index 2d7dc5065374..3b33f9d215f2 100644 +--- a/packages/react-native/React/Base/RCTBundleURLProvider.h ++++ b/packages/react-native/React/Base/RCTBundleURLProvider.h +@@ -14,15 +14,15 @@ + RCT_EXTERN NSString *_Nonnull const RCTBundleURLProviderUpdatedNotification; + RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort; + +-#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY + /** + * Allow/disallow accessing the packager server for various runtime scenario. + * For instance, if a test run should never access the packager, disable it + * by calling this function before initializing React Native (RCTBridge etc). +- * By default the access is enabled. ++ * By default the access is enabled. When packager support is compiled out ++ * (neither RCT_DEV_MENU nor RCT_PACKAGER_LOADING_FUNCTIONALITY is set), ++ * calling this function is a no-op. + */ + RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); +-#endif + + NS_ASSUME_NONNULL_BEGIN + +diff --git a/packages/react-native/React/Base/RCTBundleURLProvider.mm b/packages/react-native/React/Base/RCTBundleURLProvider.mm +index 808925dd08c5..906012b06b26 100644 +--- a/packages/react-native/React/Base/RCTBundleURLProvider.mm ++++ b/packages/react-native/React/Base/RCTBundleURLProvider.mm +@@ -19,13 +19,14 @@ + + const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT; + +-#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY ++// Declared unconditionally so out-of-tree callers link in every configuration, ++// same shape as RCTDevLoadingViewSetEnabled. Reads stay gated below, so this is ++// a no-op when packager support is compiled out. + static BOOL kRCTAllowPackagerAccess = YES; + void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed) + { + kRCTAllowPackagerAccess = allowed; + } +-#endif + static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme"; + static NSString *const kRCTJsLocationKey = @"RCT_jsLocation"; + static NSString *const kRCTEnableDevKey = @"RCT_enableDev";