Skip to content

Return actual loaded bundle URL from SourceCodeModule#56698

Closed
javache wants to merge 1 commit into
react:mainfrom
javache:export-D102669868
Closed

Return actual loaded bundle URL from SourceCodeModule#56698
javache wants to merge 1 commit into
react:mainfrom
javache:export-D102669868

Conversation

@javache

@javache javache commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary:
The C++ SourceCodeModule (ReactCxxPlatform) always derived scriptURL from DevServerHelper::getBundleUrl(), coupling the module to dev infrastructure. This diff replaces that dependency with a simple std::string parameter passed at construction time.

ReactHost and FoxReactHost store the source URL in a shared_ptr<string> that is updated on each successful dev-server bundle load. When SourceCodeModule is instantiated (lazily, after the bundle is loaded), the TurboModule provider dereferences the current value and passes it through as a plain string. For file-based bundle loading the URL is cleared, matching the previous behavior.

This decouples SourceCodeModule from DevServerHelper without introducing lambdas, context container lookups, or shared mutable state in the module itself.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D102669868

Summary:
The C++ `SourceCodeModule` (ReactCxxPlatform) always derived `scriptURL` from `DevServerHelper::getBundleUrl()`, coupling the module to dev infrastructure. This diff replaces that dependency with a simple `std::string` parameter passed at construction time.

`ReactHost` and `FoxReactHost` store the source URL in a `shared_ptr<string>` that is updated on each successful dev-server bundle load. When `SourceCodeModule` is instantiated (lazily, after the bundle is loaded), the TurboModule provider dereferences the current value and passes it through as a plain string. For file-based bundle loading the URL is cleared, matching the previous behavior.

This decouples `SourceCodeModule` from `DevServerHelper` without introducing lambdas, context container lookups, or shared mutable state in the module itself.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D102669868
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 6, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels May 6, 2026
@meta-codesync

meta-codesync Bot commented May 6, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D102669868.

@meta-codesync meta-codesync Bot closed this in 5b3a1a4 May 6, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 6, 2026
@meta-codesync

meta-codesync Bot commented May 6, 2026

Copy link
Copy Markdown

This pull request has been merged in 5b3a1a4.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @javache in 5b3a1a4

When will my fix make it into a release? | How to file a pick request?

@javache javache deleted the export-D102669868 branch May 7, 2026 11:11
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 Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants