react-native-windows 0.0.0-canary.458 → 0.0.0-canary.459

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.
@@ -53,6 +53,10 @@ uint16_t ReactSettingsSnapshot::SourceBundlePort() const noexcept {
53
53
  return m_settings->SourceBundlePort();
54
54
  }
55
55
 
56
+ bool ReactSettingsSnapshot::RequestInlineSourceMap() const noexcept {
57
+ return m_settings->RequestInlineSourceMap();
58
+ }
59
+
56
60
  hstring ReactSettingsSnapshot::JavaScriptBundleFile() const noexcept {
57
61
  return winrt::to_hstring(m_settings->JavaScriptBundleFile());
58
62
  }
@@ -21,6 +21,7 @@ struct ReactSettingsSnapshot : winrt::implements<ReactSettingsSnapshot, IReactSe
21
21
  hstring BundleRootPath() const noexcept;
22
22
  hstring SourceBundleHost() const noexcept;
23
23
  uint16_t SourceBundlePort() const noexcept;
24
+ bool RequestInlineSourceMap() const noexcept;
24
25
  hstring JavaScriptBundleFile() const noexcept;
25
26
 
26
27
  public:
@@ -57,8 +58,8 @@ struct ReactContext : winrt::implements<ReactContext, IReactContext> {
57
58
  JSValueArgWriter const &paramsArgWriter) noexcept;
58
59
 
59
60
  public: // IReactContext
60
- // Not part of the public ABI interface
61
- // Internal accessor for within the Microsoft.ReactNative dll to allow calling into internal methods
61
+ // Not part of the public ABI interface
62
+ // Internal accessor for within the Microsoft.ReactNative dll to allow calling into internal methods
62
63
  Mso::React::IReactContext &GetInner() const noexcept;
63
64
 
64
65
  private:
@@ -84,6 +84,12 @@ namespace Microsoft.ReactNative
84
84
  "that will be used to load the bundle from.")
85
85
  UInt16 SourceBundlePort { get; };
86
86
 
87
+ DOC_STRING(
88
+ "A read-only snapshot of the @ReactInstanceSettings.RequestInlineSourceMap property value "
89
+ "at the time when the React instance was created.\n"
90
+ "If set, the bundler will include the source maps inline (this will improve debugging experience, but for very large bundles it could have a significant performance hit)")
91
+ Boolean RequestInlineSourceMap { get; };
92
+
87
93
  DOC_STRING(
88
94
  "A read-only snapshot of the @ReactInstanceSettings.JavaScriptBundleFile property value "
89
95
  "at the time when the React instance was created.\n"
@@ -456,6 +456,8 @@ static void StyleYogaNode(
456
456
  wrap = YGWrapNoWrap;
457
457
  else if (value == "wrap")
458
458
  wrap = YGWrapWrap;
459
+ else if (value == "wrap-reverse")
460
+ wrap = YGWrapWrapReverse;
459
461
  else
460
462
  assert(false);
461
463
 
@@ -79,6 +79,13 @@ uint16_t ReactSettingsSnapshot::SourceBundlePort() const noexcept {
79
79
  return 0;
80
80
  }
81
81
 
82
+ bool ReactSettingsSnapshot::RequestInlineSourceMap() const noexcept {
83
+ if (auto instance = m_reactInstance.GetStrongPtr()) {
84
+ return instance->RequestInlineSourceMap();
85
+ }
86
+ return false;
87
+ }
88
+
82
89
  std::string ReactSettingsSnapshot::JavaScriptBundleFile() const noexcept {
83
90
  if (auto instance = m_reactInstance.GetStrongPtr()) {
84
91
  return instance->JavaScriptBundleFile();
@@ -27,6 +27,7 @@ class ReactSettingsSnapshot final : public Mso::UnknownObject<IReactSettingsSnap
27
27
  std::string BundleRootPath() const noexcept override;
28
28
  std::string SourceBundleHost() const noexcept override;
29
29
  uint16_t SourceBundlePort() const noexcept override;
30
+ bool RequestInlineSourceMap() const noexcept override;
30
31
  std::string JavaScriptBundleFile() const noexcept override;
31
32
  bool UseDeveloperSupport() const noexcept override;
32
33
  JSIEngine JsiEngine() const noexcept override;
@@ -102,6 +102,7 @@ struct IReactSettingsSnapshot : IUnknown {
102
102
  virtual std::string BundleRootPath() const noexcept = 0;
103
103
  virtual std::string SourceBundleHost() const noexcept = 0;
104
104
  virtual uint16_t SourceBundlePort() const noexcept = 0;
105
+ virtual bool RequestInlineSourceMap() const noexcept = 0;
105
106
  virtual std::string JavaScriptBundleFile() const noexcept = 0;
106
107
  virtual bool UseDeveloperSupport() const noexcept = 0;
107
108
  virtual JSIEngine JsiEngine() const noexcept = 0;
@@ -149,6 +150,7 @@ struct ReactDevOptions {
149
150
  //! Specify a value for a component, or leave empty to use the default.
150
151
  std::string SourceBundleHost; // Host domain (without port) for the bundler server. Default: "localhost".
151
152
  uint16_t SourceBundlePort{0}; // Host port for the bundler server. Default: "8081".
153
+ bool RequestInlineSourceMap{true}; // Request the source map inline
152
154
  std::string SourceBundleName; // Bundle name without any extension (e.g. "index.win32"). Default: "index.{PLATFORM}"
153
155
  std::string SourceBundleExtension; // Bundle name extension. Default: ".bundle".
154
156
 
@@ -352,6 +352,7 @@ void ReactInstanceWin::Initialize() noexcept {
352
352
  devSettings->useJITCompilation = m_options.EnableJITCompilation;
353
353
  devSettings->sourceBundleHost = SourceBundleHost();
354
354
  devSettings->sourceBundlePort = SourceBundlePort();
355
+ devSettings->inlineSourceMap = RequestInlineSourceMap();
355
356
  devSettings->debugBundlePath = DebugBundlePath();
356
357
  devSettings->liveReloadCallback = GetLiveReloadCallback();
357
358
  devSettings->errorCallback = GetErrorCallback();
@@ -408,7 +409,6 @@ void ReactInstanceWin::Initialize() noexcept {
408
409
  case JSIEngine::Hermes:
409
410
  devSettings->jsiRuntimeHolder =
410
411
  std::make_shared<facebook::react::HermesRuntimeHolder>(devSettings, m_jsMessageThread.Load());
411
- devSettings->inlineSourceMap = false;
412
412
  break;
413
413
  case JSIEngine::V8:
414
414
  #if defined(USE_V8)
@@ -1031,6 +1031,10 @@ uint16_t ReactInstanceWin::SourceBundlePort() const noexcept {
1031
1031
  : facebook::react::DevServerHelper::DefaultPackagerPort;
1032
1032
  }
1033
1033
 
1034
+ bool ReactInstanceWin::RequestInlineSourceMap() const noexcept {
1035
+ return m_options.DeveloperSettings.RequestInlineSourceMap;
1036
+ }
1037
+
1034
1038
  JSIEngine ReactInstanceWin::JsiEngine() const noexcept {
1035
1039
  return m_options.JsiEngine();
1036
1040
  }
@@ -77,6 +77,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
77
77
  std::string BundleRootPath() const noexcept;
78
78
  std::string SourceBundleHost() const noexcept;
79
79
  uint16_t SourceBundlePort() const noexcept;
80
+ bool RequestInlineSourceMap() const noexcept;
80
81
  std::string JavaScriptBundleFile() const noexcept;
81
82
  bool UseDeveloperSupport() const noexcept;
82
83
  JSIEngine JsiEngine() const noexcept;
@@ -130,6 +130,9 @@ struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings> {
130
130
  uint16_t SourceBundlePort() noexcept;
131
131
  void SourceBundlePort(uint16_t value) noexcept;
132
132
 
133
+ bool RequestInlineSourceMap() noexcept;
134
+ void RequestInlineSourceMap(bool value) noexcept;
135
+
133
136
  JSIEngine JSIEngineOverride() noexcept;
134
137
  void JSIEngineOverride(JSIEngine value) noexcept;
135
138
 
@@ -174,6 +177,7 @@ struct ReactInstanceSettings : ReactInstanceSettingsT<ReactInstanceSettings> {
174
177
  hstring m_sourceBundleHost{};
175
178
  hstring m_debuggerRuntimeName{};
176
179
  uint16_t m_sourceBundlePort{0};
180
+ bool m_requestInlineSourceMap{true};
177
181
  LogHandler m_nativeLogger{nullptr};
178
182
 
179
183
  #if USE_HERMES
@@ -308,6 +312,14 @@ inline void ReactInstanceSettings::SourceBundlePort(uint16_t value) noexcept {
308
312
  m_sourceBundlePort = value;
309
313
  }
310
314
 
315
+ inline bool ReactInstanceSettings::RequestInlineSourceMap() noexcept {
316
+ return m_requestInlineSourceMap;
317
+ }
318
+
319
+ inline void ReactInstanceSettings::RequestInlineSourceMap(bool value) noexcept {
320
+ m_requestInlineSourceMap = value;
321
+ }
322
+
311
323
  inline JSIEngine ReactInstanceSettings::JSIEngineOverride() noexcept {
312
324
  return m_jSIEngineOverride;
313
325
  }
@@ -204,17 +204,23 @@ namespace Microsoft.ReactNative
204
204
  IReactDispatcher UIDispatcher { get; set; };
205
205
 
206
206
  DOC_STRING(
207
- "When using a @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger this is the server hostname "
207
+ "When using @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger this is the server hostname "
208
208
  "that will be used to load the bundle from.")
209
209
  DOC_DEFAULT("localhost")
210
210
  String SourceBundleHost { get; set; };
211
211
 
212
212
  DOC_STRING(
213
- "When using a @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger this is the server port "
213
+ "When using @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger this is the server port "
214
214
  "that will be used to load the bundle from.")
215
215
  DOC_DEFAULT("8081")
216
216
  UInt16 SourceBundlePort { get; set; };
217
217
 
218
+ DOC_STRING(
219
+ "When using @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger this controls whether the bundler should include inline source maps."
220
+ "If set, the bundler will include the source maps inline (this will improve debugging experience, but for very large bundles it could have a significant performance hit)")
221
+ DOC_DEFAULT("true")
222
+ Boolean RequestInlineSourceMap { get; set; };
223
+
218
224
  DOC_STRING(
219
225
  "The @JSIEngine override to be used with the React instance.\n"
220
226
  "In order for the override to work, Microsoft.ReactNative must be compiled with support of that engine. "
@@ -132,6 +132,7 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
132
132
  }
133
133
  reactOptions.DeveloperSettings.SourceBundleHost = to_string(m_instanceSettings.SourceBundleHost());
134
134
  reactOptions.DeveloperSettings.SourceBundlePort = m_instanceSettings.SourceBundlePort();
135
+ reactOptions.DeveloperSettings.RequestInlineSourceMap = m_instanceSettings.RequestInlineSourceMap();
135
136
 
136
137
  reactOptions.ByteCodeFileUri = to_string(m_instanceSettings.ByteCodeFileUri());
137
138
  reactOptions.EnableByteCodeCaching = m_instanceSettings.EnableByteCodeCaching();
@@ -10,7 +10,7 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.0.0-canary.458</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.0.0-canary.459</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
@@ -306,7 +306,6 @@ InstanceImpl::InstanceImpl(
306
306
  switch (m_devSettings->jsiEngineOverride) {
307
307
  case JSIEngineOverride::Hermes:
308
308
  m_devSettings->jsiRuntimeHolder = std::make_shared<HermesRuntimeHolder>(m_devSettings, m_jsThread);
309
- m_devSettings->inlineSourceMap = false;
310
309
  break;
311
310
  case JSIEngineOverride::V8: {
312
311
  #if defined(USE_V8)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.0.0-canary.458",
3
+ "version": "0.0.0-canary.459",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",