react-native-windows 0.72.17 → 0.72.19
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.
|
@@ -121,6 +121,42 @@ bool ReactSettingsSnapshot::UseDeveloperSupport() const noexcept {
|
|
|
121
121
|
return false;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
struct WeakRefPropertyBag : winrt::implements<WeakRefPropertyBag, winrt::Microsoft::ReactNative::IReactPropertyBag> {
|
|
125
|
+
WeakRefPropertyBag(winrt::Microsoft::ReactNative::IReactPropertyBag propertyBag) : m_wkPropBag(propertyBag) {}
|
|
126
|
+
|
|
127
|
+
IInspectable Get(winrt::Microsoft::ReactNative::IReactPropertyName const &name) noexcept {
|
|
128
|
+
if (auto propBag = m_wkPropBag.get()) {
|
|
129
|
+
return propBag.Get(name);
|
|
130
|
+
}
|
|
131
|
+
return nullptr;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
IInspectable GetOrCreate(
|
|
135
|
+
winrt::Microsoft::ReactNative::IReactPropertyName const &name,
|
|
136
|
+
winrt::Microsoft::ReactNative::ReactCreatePropertyValue const &createValue) noexcept {
|
|
137
|
+
if (auto propBag = m_wkPropBag.get()) {
|
|
138
|
+
return propBag.GetOrCreate(name, createValue);
|
|
139
|
+
}
|
|
140
|
+
return nullptr;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
IInspectable Set(winrt::Microsoft::ReactNative::IReactPropertyName const &name, IInspectable const &value) noexcept {
|
|
144
|
+
if (auto propBag = m_wkPropBag.get()) {
|
|
145
|
+
return propBag.Set(name, value);
|
|
146
|
+
}
|
|
147
|
+
return nullptr;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
void CopyFrom(winrt::Microsoft::ReactNative::IReactPropertyBag const &value) noexcept {
|
|
151
|
+
if (auto propBag = m_wkPropBag.get()) {
|
|
152
|
+
return propBag.CopyFrom(value);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
private:
|
|
157
|
+
winrt::weak_ref<winrt::Microsoft::ReactNative::IReactPropertyBag> m_wkPropBag;
|
|
158
|
+
};
|
|
159
|
+
|
|
124
160
|
//=============================================================================================
|
|
125
161
|
// ReactContext implementation
|
|
126
162
|
//=============================================================================================
|
|
@@ -131,7 +167,7 @@ ReactContext::ReactContext(
|
|
|
131
167
|
winrt::Microsoft::ReactNative::IReactNotificationService const ¬ifications) noexcept
|
|
132
168
|
: m_reactInstance{std::move(reactInstance)},
|
|
133
169
|
m_settings{Mso::Make<ReactSettingsSnapshot>(Mso::Copy(m_reactInstance))},
|
|
134
|
-
m_properties{properties},
|
|
170
|
+
m_properties{winrt::make<WeakRefPropertyBag>(properties)},
|
|
135
171
|
m_notifications{notifications} {}
|
|
136
172
|
|
|
137
173
|
void ReactContext::Destroy() noexcept {
|
|
@@ -255,6 +255,11 @@ ReactInstanceWin::ReactInstanceWin(
|
|
|
255
255
|
m_whenDestroyedResult =
|
|
256
256
|
m_whenDestroyed.AsFuture().Then<Mso::Executors::Inline>([whenLoaded = m_whenLoaded,
|
|
257
257
|
onDestroyed = m_options.OnInstanceDestroyed,
|
|
258
|
+
// instance might be the only thing keeping
|
|
259
|
+
// the propertyBag alive.
|
|
260
|
+
// We want it to remain alive for the
|
|
261
|
+
// InstanceDestroyed callbacks
|
|
262
|
+
propBag = m_options.Properties,
|
|
258
263
|
reactContext = m_reactContext]() noexcept {
|
|
259
264
|
whenLoaded.TryCancel(); // It only has an effect if whenLoaded was not set before
|
|
260
265
|
Microsoft::ReactNative::HermesRuntimeHolder::storeTo(ReactPropertyBag(reactContext->Properties()), nullptr);
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.72.
|
|
13
|
+
<ReactNativeWindowsVersion>0.72.19</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>19</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>318d6227643ae6c9d080a1e3000c903104afa59b</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|