Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions change/react-native-windows-2020-04-15-00-20-55-sbp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Rename DeveloperSettings.SourceBundlePath -> SourceBundleName",
"packageName": "react-native-windows",
"email": "rezha@microsoft.com",
"dependentChangeType": "patch",
"date": "2020-04-15T07:20:55.380Z"
}
12 changes: 6 additions & 6 deletions vnext/Microsoft.ReactNative/ReactHost/React.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ struct ReactDevOptions {
std::string DebugHost;

//! When using web debugging and/or live reload, the source is obtained from the packager.
//! The source url for the bundle is "http://{HOST}:{PORT}/{PATH}{EXTENSION}?platform=..."
//! The source url for the bundle is "http://{HOST}:{PORT}/{NAME}{EXTENSION}?platform=..."
//! which defaults to:
//! {HOST} = "localhost",
//! {PORT} = "8081",
//! {PATH} = "index.{PLATFORM}" where {PLATFORM} = "ios", "android", "win32", etc.
//! {NAME} = "index.{PLATFORM}" where {PLATFORM} = "ios", "android", "win32", etc.
//! {EXTENSION} = ".bundle"
//! Specify a value for a component, or leave empty to use the default.
std::string SourceBundleHost; // {HOST}
std::string SourceBundlePort; // {PORT}
std::string SourceBundlePath; // {PATH}
std::string SourceBundleExtension; // {EXTENSION}
std::string SourceBundleHost; // Host domain (without port) for the bundler server. Default: "localhost".
std::string SourceBundlePort; // Host port for the bundler server. Default: "8081".
std::string SourceBundleName; // Bundle name without any extension (e.g. "index.win32"). Default: "index.{PLATFORM}"
std::string SourceBundleExtension; // Bundle name extension. Default: ".bundle".

//! Module name used for loading the debug bundle.
//! e.g. The modules name registered in the jsbundle via AppRegistry.registerComponent('ModuleName', () =>
Expand Down
6 changes: 3 additions & 3 deletions vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void ReactInstanceWin::Initialize() noexcept {
auto devSettings = std::make_shared<facebook::react::DevSettings>();
devSettings->useJITCompilation = m_options.EnableJITCompilation;
devSettings->debugHost = GetDebugHost();
devSettings->debugBundlePath = m_options.DeveloperSettings.SourceBundlePath;
devSettings->debugBundlePath = m_options.DeveloperSettings.SourceBundleName;
devSettings->liveReloadCallback = GetLiveReloadCallback();
devSettings->errorCallback = GetErrorCallback();
devSettings->loggingCallback = GetLoggingCallback();
Expand Down Expand Up @@ -273,8 +273,8 @@ void ReactInstanceWin::Initialize() noexcept {
if (m_options.DeveloperSettings.IsDevModeEnabled && State() != ReactInstanceState::HasError) {
folly::dynamic params = folly::dynamic::array(
STRING(RN_PLATFORM),
m_options.DeveloperSettings.SourceBundlePath.empty() ? m_options.Identity
: m_options.DeveloperSettings.SourceBundlePath,
m_options.DeveloperSettings.SourceBundleName.empty() ? m_options.Identity
: m_options.DeveloperSettings.SourceBundleName,
GetSourceBundleHost(),
GetSourceBundlePort(),
m_options.DeveloperSettings.UseFastRefresh);
Expand Down
2 changes: 1 addition & 1 deletion vnext/Microsoft.ReactNative/ReactNativeHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void ReactNativeHost::ReloadInstance() noexcept {

Mso::React::ReactOptions reactOptions{};
reactOptions.DeveloperSettings.IsDevModeEnabled = legacySettings.EnableDeveloperMenu;
reactOptions.DeveloperSettings.SourceBundlePath = legacySettings.DebugBundlePath;
reactOptions.DeveloperSettings.SourceBundleName = legacySettings.DebugBundlePath;
reactOptions.DeveloperSettings.UseWebDebugger = legacySettings.UseWebDebugger;
reactOptions.DeveloperSettings.UseDirectDebugger = legacySettings.UseDirectDebugger;
reactOptions.DeveloperSettings.DebuggerBreakOnNextLine = legacySettings.DebuggerBreakOnNextLine;
Expand Down
2 changes: 1 addition & 1 deletion vnext/Microsoft.ReactNative/RedBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ struct RedBox : public std::enable_shared_from_this<RedBox> {
std::string stackFrameUri = "http://";
stackFrameUri.append(devSettings.SourceBundleHost.empty() ? "localhost" : devSettings.SourceBundleHost);
stackFrameUri.append(":");
stackFrameUri.append(devSettings.SourceBundlePath.empty() ? "8081" : devSettings.SourceBundlePort);
stackFrameUri.append(devSettings.SourceBundlePort.empty() ? "8081" : devSettings.SourceBundlePort);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SourceBundlePort [](start = 43, length = 16)

good catch

stackFrameUri.append("/open-stack-frame");

Uri uri{Microsoft::Common::Unicode::Utf8ToUtf16(stackFrameUri)};
Expand Down