react-native-windows 0.72.0-preview.6 → 0.72.0-preview.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,8 +66,9 @@
66
66
  </PropertyGroup>
67
67
 
68
68
  <PropertyGroup Label="NuGet" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
69
- <!--See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target-->
70
- <RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
69
+ <!-- See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target -->
70
+ <!-- RestoreUseStaticGraphEvaluation broke in VS 17.6, see https://github.com/microsoft/react-native-windows/issues/11670 -->
71
+ <RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.6')) AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
71
72
  </PropertyGroup>
72
73
 
73
74
  </Project>
@@ -65,6 +65,10 @@ hstring ReactSettingsSnapshot::BundleAppId() const noexcept {
65
65
  return winrt::to_hstring(m_settings->BundleAppId());
66
66
  }
67
67
 
68
+ bool ReactSettingsSnapshot::RequestDevBundle() const noexcept {
69
+ return m_settings->RequestDevBundle();
70
+ }
71
+
68
72
  Mso::React::IReactSettingsSnapshot const &ReactSettingsSnapshot::GetInner() const noexcept {
69
73
  return *m_settings;
70
74
  }
@@ -24,6 +24,7 @@ struct ReactSettingsSnapshot : winrt::implements<ReactSettingsSnapshot, IReactSe
24
24
  bool RequestInlineSourceMap() const noexcept;
25
25
  hstring JavaScriptBundleFile() const noexcept;
26
26
  hstring BundleAppId() const noexcept;
27
+ bool RequestDevBundle() const noexcept;
27
28
 
28
29
  public:
29
30
  // Internal accessor for within the Microsoft.ReactNative dll to allow calling into internal methods
@@ -125,6 +125,12 @@ namespace Microsoft.ReactNative
125
125
  "at the time when the React instance was created.\n"
126
126
  "The name of the app passed to the packager server via the 'app' query parameter.")
127
127
  String BundleAppId { get; };
128
+
129
+ DOC_STRING(
130
+ "A read-only snapshot of the @ReactInstanceSettings.RequestDevBundle property value "
131
+ "at the time when the React instance was created.\n"
132
+ "When querying the bundle server for a bundle, should it request the dev bundle or release bundle.")
133
+ Boolean RequestDevBundle { get; };
128
134
  }
129
135
 
130
136
  [webhosthidden]
@@ -100,6 +100,13 @@ std::string ReactSettingsSnapshot::BundleAppId() const noexcept {
100
100
  return {};
101
101
  }
102
102
 
103
+ bool ReactSettingsSnapshot::RequestDevBundle() const noexcept {
104
+ if (auto instance = m_reactInstance.GetStrongPtr()) {
105
+ return instance->RequestDevBundle();
106
+ }
107
+ return {};
108
+ }
109
+
103
110
  JSIEngine ReactSettingsSnapshot::JsiEngine() const noexcept {
104
111
  if (auto instance = m_reactInstance.GetStrongPtr()) {
105
112
  return instance->JsiEngine();
@@ -30,6 +30,7 @@ class ReactSettingsSnapshot final : public Mso::UnknownObject<IReactSettingsSnap
30
30
  bool RequestInlineSourceMap() const noexcept override;
31
31
  std::string JavaScriptBundleFile() const noexcept override;
32
32
  std::string BundleAppId() const noexcept override;
33
+ bool RequestDevBundle() const noexcept override;
33
34
  bool UseDeveloperSupport() const noexcept override;
34
35
  JSIEngine JsiEngine() const noexcept override;
35
36
 
@@ -105,6 +105,7 @@ struct IReactSettingsSnapshot : IUnknown {
105
105
  virtual bool RequestInlineSourceMap() const noexcept = 0;
106
106
  virtual std::string JavaScriptBundleFile() const noexcept = 0;
107
107
  virtual std::string BundleAppId() const noexcept = 0;
108
+ virtual bool RequestDevBundle() const noexcept = 0;
108
109
  virtual bool UseDeveloperSupport() const noexcept = 0;
109
110
  virtual JSIEngine JsiEngine() const noexcept = 0;
110
111
  };
@@ -152,6 +153,7 @@ struct ReactDevOptions {
152
153
  std::string SourceBundleName; // Bundle name without any extension (e.g. "index.win32"). Default: "index.{PLATFORM}"
153
154
  std::string SourceBundleExtension; // Bundle name extension. Default: ".bundle".
154
155
  std::string BundleAppId; // Bundle app id. Default: "".
156
+ bool DevBundle{true}; // When requesting bundle from bundle server, query for dev bundle or release bundle
155
157
 
156
158
  //! Module name used for loading the debug bundle.
157
159
  //! e.g. The modules name registered in the jsbundle via AppRegistry.registerComponent('ModuleName', () =>
@@ -451,6 +451,7 @@ void ReactInstanceWin::Initialize() noexcept {
451
451
  devSettings->debuggerAttachCallback = GetDebuggerAttachCallback();
452
452
  devSettings->enableDefaultCrashHandler = m_options.EnableDefaultCrashHandler();
453
453
  devSettings->bundleAppId = BundleAppId();
454
+ devSettings->devBundle = RequestDevBundle();
454
455
  devSettings->showDevMenuCallback = [weakThis]() noexcept {
455
456
  if (auto strongThis = weakThis.GetStrongPtr()) {
456
457
  strongThis->m_uiQueue->Post(
@@ -1166,6 +1167,10 @@ std::string ReactInstanceWin::BundleAppId() const noexcept {
1166
1167
  return m_options.DeveloperSettings.BundleAppId;
1167
1168
  }
1168
1169
 
1170
+ bool ReactInstanceWin::RequestDevBundle() const noexcept {
1171
+ return m_options.DeveloperSettings.DevBundle;
1172
+ }
1173
+
1169
1174
  bool ReactInstanceWin::UseDeveloperSupport() const noexcept {
1170
1175
  return m_options.UseDeveloperSupport();
1171
1176
  }
@@ -80,6 +80,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
80
80
  bool RequestInlineSourceMap() const noexcept;
81
81
  std::string JavaScriptBundleFile() const noexcept;
82
82
  std::string BundleAppId() const noexcept;
83
+ bool RequestDevBundle() const noexcept;
83
84
  bool UseDeveloperSupport() const noexcept;
84
85
  JSIEngine JsiEngine() const noexcept;
85
86
 
@@ -66,6 +66,10 @@ struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings> {
66
66
  hstring BundleAppId() noexcept;
67
67
  void BundleAppId(hstring const &value) noexcept;
68
68
 
69
+ //! When querying the bundle server for a bundle, should it request the dev bundle or release bundle
70
+ bool RequestDevBundle() noexcept;
71
+ void RequestDevBundle(bool value) noexcept;
72
+
69
73
  //! Should the instance run in a remote environment such as within a browser
70
74
  //! By default, this is using a browser navigated to http://localhost:8081/debugger-ui served
71
75
  //! by Metro/Haul. Debugging will start as soon as the React Native instance is loaded.
@@ -174,6 +178,7 @@ struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings> {
174
178
  single_threaded_vector<IReactPackageProvider>()};
175
179
  hstring m_javaScriptBundleFile{};
176
180
  hstring m_bundleAppId{};
181
+ bool m_devBundle{true};
177
182
  bool m_enableJITCompilation{true};
178
183
  bool m_enableByteCodeCaching{false};
179
184
  hstring m_byteCodeFileUri{};
@@ -239,6 +244,14 @@ inline void ReactInstanceSettings::BundleAppId(hstring const &value) noexcept {
239
244
  m_bundleAppId = value;
240
245
  }
241
246
 
247
+ inline bool ReactInstanceSettings::RequestDevBundle() noexcept {
248
+ return m_devBundle;
249
+ }
250
+
251
+ inline void ReactInstanceSettings::RequestDevBundle(bool value) noexcept {
252
+ m_devBundle = value;
253
+ }
254
+
242
255
  inline bool ReactInstanceSettings::EnableJITCompilation() noexcept {
243
256
  return m_enableJITCompilation;
244
257
  }
@@ -111,6 +111,10 @@ namespace Microsoft.ReactNative
111
111
  "If no value is set, the parameter will not be passed.")
112
112
  String BundleAppId { get; set; };
113
113
 
114
+ DOC_STRING(
115
+ "When querying the bundle server for a bundle, should it request the dev bundle or release bundle.")
116
+ Boolean RequestDevBundle { get; set; };
117
+
114
118
  DOC_STRING(
115
119
  "Controls whether the instance JavaScript runs in a remote environment such as within a browser.\n"
116
120
  "By default, this is using a browser navigated to http://localhost:8081/debugger-ui served by Metro/Haul.\n"
@@ -151,6 +151,7 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
151
151
  reactOptions.DeveloperSettings.SourceBundlePort = m_instanceSettings.SourceBundlePort();
152
152
  reactOptions.DeveloperSettings.RequestInlineSourceMap = m_instanceSettings.RequestInlineSourceMap();
153
153
  reactOptions.DeveloperSettings.BundleAppId = to_string(m_instanceSettings.BundleAppId());
154
+ reactOptions.DeveloperSettings.DevBundle = m_instanceSettings.RequestDevBundle();
154
155
 
155
156
  reactOptions.ByteCodeFileUri = to_string(m_instanceSettings.ByteCodeFileUri());
156
157
  reactOptions.EnableByteCodeCaching = m_instanceSettings.EnableByteCodeCaching();
@@ -32,6 +32,8 @@ namespace Microsoft.ReactNative.Managed
32
32
 
33
33
  public bool UseWebDebugger => IsValid ? Handle.UseWebDebugger : false;
34
34
 
35
+ public bool RequestDevBundle => IsValid ? Handle.RequestDevBundle : true;
36
+
35
37
  public IReactSettingsSnapshot Handle { get; }
36
38
 
37
39
  public bool IsValid => Handle != null;
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.72.0-preview.6</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.72.0-preview.7</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>b9a2d51896667aadcd9a7c497631ca96fe0d1ca4</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>56e59fa610772e15646fa444a1fe246ed14ebfd3</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -9,8 +9,9 @@
9
9
 
10
10
  <PropertyGroup Label="NuGet">
11
11
  <!-- Should match entry in $(ReactNativeWindowsDir)vnext\Directory.Build.props -->
12
- <!--See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target-->
13
- <RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
12
+ <!-- See https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-target -->
13
+ <!-- RestoreUseStaticGraphEvaluation broke in VS 17.6, see https://github.com/microsoft/react-native-windows/issues/11670 -->
14
+ <RestoreUseStaticGraphEvaluation Condition="'$(BuildingInsideVisualStudio)' == 'true' AND $([MSBuild]::VersionLessThan('$(MSBuildVersion)', '17.6')) AND '$(DisableRestoreUseStaticGraphEvaluation)' != 'true'">true</RestoreUseStaticGraphEvaluation>
14
15
 
15
16
  <!-- Ensure PackageReference compatibility for any consuming projects/apps -->
16
17
  <ResolveNuGetPackages>false</ResolveNuGetPackages>
@@ -95,6 +95,9 @@ struct DevSettings {
95
95
 
96
96
  bool inlineSourceMap{true};
97
97
 
98
+ // When querying the bundle server for a bundle, should it request the dev bundle or release bundle
99
+ bool devBundle{true};
100
+
98
101
  bool enableDefaultCrashHandler{false};
99
102
  };
100
103
 
@@ -448,7 +448,7 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
448
448
  m_devSettings->debugBundlePath.empty() ? jsBundleRelativePath : m_devSettings->debugBundlePath,
449
449
  m_devSettings->platformName,
450
450
  m_devSettings->bundleAppId,
451
- true /* dev */,
451
+ m_devSettings->devBundle,
452
452
  m_devSettings->useFastRefresh,
453
453
  m_devSettings->inlineSourceMap,
454
454
  hermesBytecodeVersion);
@@ -470,8 +470,8 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
470
470
  m_devSettings->debugBundlePath.empty() ? jsBundleRelativePath : m_devSettings->debugBundlePath,
471
471
  m_devSettings->platformName,
472
472
  m_devSettings->bundleAppId,
473
- /*dev*/ true,
474
- /*hot*/ false,
473
+ m_devSettings->devBundle,
474
+ m_devSettings->useFastRefresh,
475
475
  m_devSettings->inlineSourceMap,
476
476
  hermesBytecodeVersion);
477
477
 
@@ -607,7 +607,7 @@ std::vector<std::unique_ptr<NativeModule>> InstanceImpl::GetDefaultNativeModules
607
607
  m_devSettings->debugBundlePath,
608
608
  m_devSettings->platformName,
609
609
  m_devSettings->bundleAppId,
610
- true /*dev*/,
610
+ m_devSettings->devBundle,
611
611
  m_devSettings->useFastRefresh,
612
612
  m_devSettings->inlineSourceMap,
613
613
  hermesBytecodeVersion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.72.0-preview.6",
3
+ "version": "0.72.0-preview.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "11.2.3",
27
27
  "@react-native-community/cli-platform-android": "11.2.3",
28
28
  "@react-native-community/cli-platform-ios": "11.2.3",
29
- "@react-native-windows/cli": "0.72.0-preview.4",
29
+ "@react-native-windows/cli": "0.72.0-preview.5",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "^0.72.0",
32
32
  "@react-native/codegen": "^0.72.3",