react-native-windows 0.68.0-preview.2 → 0.68.0-preview.3

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.
@@ -8,6 +8,7 @@
8
8
  #include <Base/CoreNativeModules.h>
9
9
  #include <Threading/MessageDispatchQueue.h>
10
10
  #include <Threading/MessageQueueThreadFactory.h>
11
+ #include <appModel.h>
11
12
  #include <comUtil/qiCast.h>
12
13
 
13
14
  #ifndef CORE_ABI
@@ -411,10 +412,19 @@ void ReactInstanceWin::Initialize() noexcept {
411
412
  break;
412
413
  case JSIEngine::V8:
413
414
  #if defined(USE_V8)
414
- #ifndef CORE_ABI
415
- preparedScriptStore =
416
- std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationLocalFolder());
417
- #endif // CORE_ABI
415
+ {
416
+ uint32_t length{0};
417
+ if (GetCurrentPackageFullName(&length, nullptr) != APPMODEL_ERROR_NO_PACKAGE) {
418
+ preparedScriptStore =
419
+ std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(getApplicationTempFolder());
420
+ } else {
421
+ wchar_t tempPath[MAX_PATH];
422
+ if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
423
+ preparedScriptStore =
424
+ std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
425
+ }
426
+ }
427
+ }
418
428
  devSettings->jsiRuntimeHolder = std::make_shared<facebook::react::V8JSIRuntimeHolder>(
419
429
  devSettings, m_jsMessageThread.Load(), std::move(scriptStore), std::move(preparedScriptStore));
420
430
  break;
@@ -975,8 +985,8 @@ Mso::CntPtr<IReactInstanceInternal> MakeReactInstance(
975
985
  }
976
986
 
977
987
  #if defined(USE_V8)
978
- std::string ReactInstanceWin::getApplicationLocalFolder() {
979
- auto local = winrt::Windows::Storage::ApplicationData::Current().LocalFolder().Path();
988
+ std::string ReactInstanceWin::getApplicationTempFolder() {
989
+ auto local = winrt::Windows::Storage::ApplicationData::Current().TemporaryFolder().Path();
980
990
 
981
991
  return Microsoft::Common::Unicode::Utf16ToUtf8(local.c_str(), local.size()) + "\\";
982
992
  }
@@ -130,7 +130,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
130
130
  };
131
131
 
132
132
  #if defined(USE_V8)
133
- static std::string getApplicationLocalFolder();
133
+ static std::string getApplicationTempFolder();
134
134
  #endif
135
135
 
136
136
  private: // immutable fields
@@ -10,7 +10,7 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.68.0-preview.2</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.68.0-preview.3</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>68</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.68.0-preview.2",
3
+ "version": "0.68.0-preview.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "^7.0.1",
27
27
  "@react-native-community/cli-platform-android": "^7.0.1",
28
28
  "@react-native-community/cli-platform-ios": "^7.0.1",
29
- "@react-native-windows/cli": "0.68.0-preview.2",
29
+ "@react-native-windows/cli": "0.68.0-preview.3",
30
30
  "@react-native-windows/virtualized-list": "0.68.0-preview.2",
31
31
  "@react-native/assets": "1.0.0",
32
32
  "@react-native/normalize-color": "2.0.0",
@@ -70,7 +70,7 @@
70
70
  "flow-bin": "^0.170.0",
71
71
  "jscodeshift": "^0.13.1",
72
72
  "just-scripts": "^1.3.3",
73
- "metro-config": "^0.66.0",
73
+ "metro-config": "^0.67.0",
74
74
  "prettier": "^2.4.1",
75
75
  "react": "17.0.2",
76
76
  "react-native": "0.68.0-rc.1",