Repository navigation
Conversation
…54006) Summary: ## Summary: Following the [RFC](react-native-community/discussions-and-proposals#933), this PR introduces a new `RCTBundleConfiguration` interface for modifying the bundle URL and exposes a new API for setting its instance in the `RCTReactNativeFactory`. The configuration object includes: - bundleFilePath - the URL of the bundle to load from the file system, - packagerServerScheme - the server scheme (e.g. http or https) to use when loading from the packager, - packagerServerHost - the server host (e.g. localhost) to use when loading from the packager. The `RCTBundleConfiguration` allows only for either `bundleFilePath` or `(packagerServerScheme, packagerServerHost)` to be set by defining appropriate initializers. The logic for creating bundle URL query items is extracted to a separate `createJSBundleURLQuery` method and is used by `RCTBundleManager` to set the configured `packagerServerHost` and `packagerServerScheme`. If the configuration is not defined, the `getBundleURL` method returns the result of the passed `fallbackURLProvider`. The `bundleFilePath` should be created with `[NSURL fileURLWithPath:<path>]`, as otherwise the HMR client is created and fails ungracefully. The check is added in the `getBundle` method to log the error beforehand: <img width="306" height="822" alt="Simulator Screenshot - iPhone 16 Pro - 2025-10-15 at 17 09 58" src="https://github.com/user-attachments/assets/869eed16-c5d8-4204-81d7-bd9cd42b2223" /> When the `bundleFilePath` is set in the `RCTBundleConfiguration` the `Connect to Metro...` message shouldn't be suggested. ## Changelog: [IOS][ADDED] - Add new `RCTBundleConfiguration` for modifying bundle URL on `RCTReactNativeFactory`. Test Plan: Test plan included in the last diff in the stack. Reviewed By: cipolleschi Differential Revision: D84058022 Pulled By: coado
… it down to the `RCTHost` (#54256) Summary: ## Summary In this diff the `RCTBundleConfiguration` is set on the `RCTReactNativeFactory` and passed down to the `RCTHost` instance where it is set on the bundle manager. The diff prepares bundle config for final usage by packager connection and bundle loader. ## Changelog [IOS][CHANGED] - Add `RCTBundleConfiguration` property on `RCTReactNativeFactory` and pass it down to `RCTHost`. Reviewed By: cipolleschi Differential Revision: D85247248
…e bundle config (#54258) Summary: ## Summary It associates `RCTPackagerConnection` (previously singleton) with the `RCTDevSettings` instance, which has access to the `RCTBundleManager`, which contains the specified configuration object. The connection is now established in the `RCTDevSettings initialize` method, called after the bundle manager is set by invoking the new `startWithBundleManager` method on the `RCTPackagerConnection`. ## Changelog: [IOS][CHANGED] - Make `RCTPackagerConnection` instance of the `RCTDevSettings` and use bundle config. Differential Revision: D85247267
Collaborator
|
This pull request was successfully merged by @coado in cf92cad When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been merged in cf92cad. |
douglowder
pushed a commit
to react-native-tvos/react-native-tvos
that referenced
this pull request
Nov 15, 2025
…e bundle config (#54258) Summary: Pull Request resolved: react/react-native#54258 ## Summary It associates `RCTPackagerConnection` (previously singleton) with the `RCTDevSettings` instance, which has access to the `RCTBundleManager`, which contains the specified configuration object. The connection is now established in the `RCTDevSettings initialize` method, called after the bundle manager is set by invoking the new `startWithBundleManager` method on the `RCTPackagerConnection`. ## Changelog: [IOS][BREAKING] - Make `RCTPackagerConnection` instance of the `RCTDevSettings` and use bundle config. Reviewed By: vzaidman Differential Revision: D85247267 fbshipit-source-id: 7586c9b9510a154b1d087e83025b2d1dbbe2b463
3 tasks done
Kudo
added a commit
to expo/expo
that referenced
this pull request
Nov 20, 2025
# Why fixes nightlies error: https://github.com/expo/expo/runs/55505214477 # How - breaking change from react/react-native#54258 - add patch but not sure if that's a right fix yet
This was referenced Jul 1, 2026
Merged
1 of 3 tasks
kitten
added a commit
to expo/expo
that referenced
this pull request
Jul 22, 2026
… bundle URL (#48010) Related to #43018 Related to react/react-native#54258 Follow-up to #47424 # Why React Native 0.84 added `RCTBundleConfiguration` as a new root view (host creation?) argument as `bundleConfiguration`, while `RCTDevSettings` now uses this input to start the `RCTPackagerConnection`. Internally, `RCTPackagerConnection` is now instance-owned by `RCTDevSettings` and initialized from `RCTBundleManager.bundleConfig`. Expo was passing the real resolved bundle URL through `bundleURLBlock`, however, hooked up `RCTBundleConfiguration.default()` to the `bundleConfiguration` argument. As a result, the bundle was loading correctly (from the manifest-provided URL), however, the command websocket on `/message` used `RCTBundleURLProvider`'s default shared settings, which is `localhost:8081`. Previously, this wasn't as noticeable since Expo Go and `expo-dev-client` would reconnect immediately via `devSettings.packagerConnection`. But, this reconnection was removed on Expo Go and this made the issue more obvious. Either way, the `reconnect` path doesn't seem to be desired fix here. # How This PR adds `EXBundleConfiguration` / `ExpoBundleConfiguration`, which implements/sub-classes `RCTBundleConfiguration` so it can be derived from an already normalised and resolved bundle URL. This: - returns the original bundle URL on `getBundleURL` - derives the host and scheme from the bundle URL - preserves file URL behaviour as is on `initWithBundleFilePath` - falls back to the default configuration as well otherwise This is then used in `ExpoReactNativeFactory` and in Expo Go's root view. # Test Plan - Compiled and ran `apps/expo-go` and connected to `expo start --port 1337 --clear` - NOTE: No connections to `8081` are observed and the reload command works # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Christian Falch <875252+chrfalch@users.noreply.github.com>
meta-codesync Bot
pushed a commit
that referenced
this pull request
Aug 12, 2026
Summary: #54258 made RCTPackagerConnection a per RCTDevSettings instance and creates it in init. The issue is that init isn't the only way these instances are built, anything constructed through the public initWithDataSource bypasses init entirely, so initWithDataSource never creates _packagerConnection and it stays nil. Those instances silently stop receiving packager commands like reload and devMenu, because the connection they would register handlers on and receive over does not exist. This moves the creation into initWithDataSource, so every construction path gets a connection. -init still delegates to initWithDataSource:, so the default path is unchanged. ## Changelog: [IOS] [FIXED] - Create the RCTDevSettings packager connection in initWithDataSource so instances built that way also receive packager commands Pull Request resolved: #57409 Test Plan: - [[RCTDevSettings alloc] init].packagerConnection is non-nil (unchanged). - [[RCTDevSettings alloc] initWithDataSource:dataSource]. packagerConnection is non-nil after this change (it was nil before). - Verified in a host that subclasses RCTDevSettings via initWithDataSource (Expo Go's scoped dev settings), reload and devMenu from the CLI now reach the app over the packager connection. Before this change they were dropped because the subclass had a nil connection. Reviewed By: vzaidman, cortinico Differential Revision: D113387408 Pulled By: cipolleschi fbshipit-source-id: bdf4b5b431c6870afd652e980022fb43c88bcb0c
kitten
added a commit
to expo/expo
that referenced
this pull request
Aug 13, 2026
… bundle URL (#48010) Related to #43018 Related to react/react-native#54258 Follow-up to #47424 React Native 0.84 added `RCTBundleConfiguration` as a new root view (host creation?) argument as `bundleConfiguration`, while `RCTDevSettings` now uses this input to start the `RCTPackagerConnection`. Internally, `RCTPackagerConnection` is now instance-owned by `RCTDevSettings` and initialized from `RCTBundleManager.bundleConfig`. Expo was passing the real resolved bundle URL through `bundleURLBlock`, however, hooked up `RCTBundleConfiguration.default()` to the `bundleConfiguration` argument. As a result, the bundle was loading correctly (from the manifest-provided URL), however, the command websocket on `/message` used `RCTBundleURLProvider`'s default shared settings, which is `localhost:8081`. Previously, this wasn't as noticeable since Expo Go and `expo-dev-client` would reconnect immediately via `devSettings.packagerConnection`. But, this reconnection was removed on Expo Go and this made the issue more obvious. Either way, the `reconnect` path doesn't seem to be desired fix here. This PR adds `EXBundleConfiguration` / `ExpoBundleConfiguration`, which implements/sub-classes `RCTBundleConfiguration` so it can be derived from an already normalised and resolved bundle URL. This: - returns the original bundle URL on `getBundleURL` - derives the host and scheme from the bundle URL - preserves file URL behaviour as is on `initWithBundleFilePath` - falls back to the default configuration as well otherwise This is then used in `ExpoReactNativeFactory` and in Expo Go's root view. - Compiled and ran `apps/expo-go` and connected to `expo start --port 1337 --clear` - NOTE: No connections to `8081` are observed and the reload command works <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Christian Falch <875252+chrfalch@users.noreply.github.com>
kitten
added a commit
to expo/expo
that referenced
this pull request
Aug 13, 2026
… bundle URL (#48010) Related to #43018 Related to react/react-native#54258 Follow-up to #47424 React Native 0.84 added `RCTBundleConfiguration` as a new root view (host creation?) argument as `bundleConfiguration`, while `RCTDevSettings` now uses this input to start the `RCTPackagerConnection`. Internally, `RCTPackagerConnection` is now instance-owned by `RCTDevSettings` and initialized from `RCTBundleManager.bundleConfig`. Expo was passing the real resolved bundle URL through `bundleURLBlock`, however, hooked up `RCTBundleConfiguration.default()` to the `bundleConfiguration` argument. As a result, the bundle was loading correctly (from the manifest-provided URL), however, the command websocket on `/message` used `RCTBundleURLProvider`'s default shared settings, which is `localhost:8081`. Previously, this wasn't as noticeable since Expo Go and `expo-dev-client` would reconnect immediately via `devSettings.packagerConnection`. But, this reconnection was removed on Expo Go and this made the issue more obvious. Either way, the `reconnect` path doesn't seem to be desired fix here. This PR adds `EXBundleConfiguration` / `ExpoBundleConfiguration`, which implements/sub-classes `RCTBundleConfiguration` so it can be derived from an already normalised and resolved bundle URL. This: - returns the original bundle URL on `getBundleURL` - derives the host and scheme from the bundle URL - preserves file URL behaviour as is on `initWithBundleFilePath` - falls back to the default configuration as well otherwise This is then used in `ExpoReactNativeFactory` and in Expo Go's root view. - Compiled and ran `apps/expo-go` and connected to `expo start --port 1337 --clear` - NOTE: No connections to `8081` are observed and the reload command works <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Christian Falch <875252+chrfalch@users.noreply.github.com>
xesrevinu
pushed a commit
to opraying/react-native-macos
that referenced
this pull request
Aug 30, 2026
Summary: react#54258 made RCTPackagerConnection a per RCTDevSettings instance and creates it in init. The issue is that init isn't the only way these instances are built, anything constructed through the public initWithDataSource bypasses init entirely, so initWithDataSource never creates _packagerConnection and it stays nil. Those instances silently stop receiving packager commands like reload and devMenu, because the connection they would register handlers on and receive over does not exist. This moves the creation into initWithDataSource, so every construction path gets a connection. -init still delegates to initWithDataSource:, so the default path is unchanged. ## Changelog: [IOS] [FIXED] - Create the RCTDevSettings packager connection in initWithDataSource so instances built that way also receive packager commands Pull Request resolved: react#57409 Test Plan: - [[RCTDevSettings alloc] init].packagerConnection is non-nil (unchanged). - [[RCTDevSettings alloc] initWithDataSource:dataSource]. packagerConnection is non-nil after this change (it was nil before). - Verified in a host that subclasses RCTDevSettings via initWithDataSource (Expo Go's scoped dev settings), reload and devMenu from the CLI now reach the app over the packager connection. Before this change they were dropped because the subclass had a nil connection. Reviewed By: vzaidman, cortinico Differential Revision: D113387408 Pulled By: cipolleschi fbshipit-source-id: bdf4b5b431c6870afd652e980022fb43c88bcb0c (cherry picked from commit e71fc4e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Differential Revision: D85247267
Summary
It associates
RCTPackagerConnection(previously singleton) with theRCTDevSettingsinstance, which has access to theRCTBundleManager, which contains the specified configuration object. The connection is now established in theRCTDevSettings initializemethod, called after the bundle manager is set by invoking the newstartWithBundleManagermethod on theRCTPackagerConnection.Changelog
[IOS][BREAKING] - Make
RCTPackagerConnectioninstance of theRCTDevSettingsand use bundle config.Test Plan:
This is the test plan for the entire stack of diffs related to
RCTBundleConfiguration.Tested changing
packagerServerHostfrom theAppDelegateby re-creating the React Native instance with updatedRCTBundleConfiguration. I've run two Metro instances, each serving a different JS bundle (changed background) on8081and8082ports. The nativeRestart RN:<current port>button on top of the screen toggles between ports (used in bundle configuration) and re-creates connections. Tested withRCT_DEVset to true and false.port-toggle-recording.mov
For setting bundle source from a file, I've generated bundle with a blue background and created a bundle configuration using
initWithBundleFilePath. I've run the app without starting Metro:code:
AppDelegate.mmAppDelegate.h