-
Couldn't load subscription status.
- Fork 24.9k
iOS: Make RCTPackagerConnection instance of RCTDevSettings and use bundle config
#54258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
coado
wants to merge
3
commits into
facebook:main
Choose a base branch
from
coado:export-D85247267
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+360
−73
Conversation
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
coado
added a commit
to coado/react-native
that referenced
this pull request
Oct 28, 2025
…e bundle config (facebook#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
3a769f3 to
45f5003
Compare
coado
added a commit
to coado/react-native
that referenced
this pull request
Oct 28, 2025
…e bundle config (facebook#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
…acebook#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. Differential Revision: D84058022 Pulled By: coado
… it down to the `RCTHost` (facebook#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 (facebook#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
45f5003 to
e8566db
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
meta-exported
p: Facebook
Partner: Facebook
p: Software Mansion
Partner: Software Mansion
Partner
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][CHANGED] - 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