Skip to content

Commit 4b656c2

Browse files
kevinvangelderrozele
authored andcommitted
feat(Portable): Migrate most of Modules/Core and portions of DevSupport (microsoft#760)
* migrate most of Modules/Core and portions of DevSupport * fix diff
1 parent c21c76c commit 4b656c2

14 files changed

+24
-12
lines changed

ReactWindows/ReactNative/DevSupport/DisabledDevSupportManager.cs renamed to ReactWindows/ReactNative.Shared/DevSupport/DisabledDevSupportManager.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
using System;
55
using System.Runtime.ExceptionServices;
66
using System.Threading.Tasks;
7+
#if WINDOWS_UWP
78
using Windows.ApplicationModel.Core;
89
using Windows.UI.Core;
10+
#else
11+
using System.Threading;
12+
using System.Windows.Threading;
13+
#endif
914

1015
namespace ReactNative.DevSupport
1116
{
@@ -65,10 +70,17 @@ public string JavaScriptBundleUrlForRemoteDebugging
6570

6671
public async void HandleException(Exception exception)
6772
{
73+
#if WINDOWS_UWP
6874
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
6975
{
7076
ExceptionDispatchInfo.Capture(exception).Throw();
7177
}).AsTask().ConfigureAwait(false);
78+
#else
79+
await Dispatcher.CurrentDispatcher.InvokeAsync(() =>
80+
{
81+
ExceptionDispatchInfo.Capture(exception).Throw();
82+
}, DispatcherPriority.Send).Task.ConfigureAwait(false);
83+
#endif
7284
}
7385

7486
public void HandleReloadJavaScript()

ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,19 @@
7373
<Compile Include="$(MSBuildThisFileDirectory)Collections\ListExtensions.cs" />
7474
<Compile Include="$(MSBuildThisFileDirectory)Common\ReactConstants.cs" />
7575
<Compile Include="$(MSBuildThisFileDirectory)Common\WindowsPlatformHelper.cs" />
76+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\DebugServerException.cs" />
77+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\DisabledDevSupportManager.cs" />
78+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\HMRClient.cs" />
79+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\IDevSupportManager.cs" />
80+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\IReactInstanceDevCommandsHandler.cs" />
81+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\IStackFrame.cs" />
82+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\StackFrameExtensions.cs" />
83+
<Compile Include="$(MSBuildThisFileDirectory)DevSupport\StackTraceHelper.cs" />
84+
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\DeviceEventManagerModule.cs" />
85+
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\JavaScriptException.cs" />
7686
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\JSTimersExecution.cs" />
87+
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\RCTDeviceEventEmitter.cs" />
88+
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\RCTNativeAppEventEmitter.cs" />
7789
<Compile Include="$(MSBuildThisFileDirectory)Modules\Core\Timing.cs" />
7890
<Compile Include="$(MSBuildThisFileDirectory)Modules\DevSupport\IDeveloperSettings.cs" />
7991
<Compile Include="$(MSBuildThisFileDirectory)Modules\DevSupport\SourceCodeModule.cs" />

ReactWindows/ReactNative/ReactNative.csproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,38 +116,29 @@
116116
<Compile Include="Bridge\NativeModuleRegistry.cs" />
117117
<Compile Include="Bridge\Queue\ReactQueueConfiguration.cs" />
118118
<Compile Include="Chakra\Executor\NativeJavaScriptExecutor.cs" />
119-
<Compile Include="DevSupport\DebugServerException.cs" />
120119
<Compile Include="DevSupport\DevInternalSettings.cs" />
121120
<Compile Include="DevSupport\DevOptionDialog.xaml.cs">
122121
<DependentUpon>DevOptionDialog.xaml</DependentUpon>
123122
</Compile>
124123
<Compile Include="DevSupport\DevServerHelper.cs" />
125124
<Compile Include="DevSupport\DevSupportManager.cs" />
126-
<Compile Include="DevSupport\DisabledDevSupportManager.cs" />
127-
<Compile Include="DevSupport\HMRClient.cs" />
128-
<Compile Include="DevSupport\IReactInstanceDevCommandsHandler.cs" />
129-
<Compile Include="DevSupport\IStackFrame.cs" />
130125
<Compile Include="DevSupport\ProgressDialog.xaml.cs">
131126
<DependentUpon>ProgressDialog.xaml</DependentUpon>
132127
</Compile>
133128
<Compile Include="DevSupport\RedBoxDialog.xaml.cs">
134129
<DependentUpon>RedBoxDialog.xaml</DependentUpon>
135130
</Compile>
136131
<Compile Include="DevSupport\ShakeAccelerometer.cs" />
137-
<Compile Include="DevSupport\StackFrameExtensions.cs" />
138-
<Compile Include="DevSupport\StackTraceHelper.cs" />
139132
<Compile Include="Chakra\Executor\ChakraJavaScriptExecutor.cs" />
140133
<Compile Include="Chakra\Executor\JTokenToJavaScriptValueConverter.cs" />
141134
<Compile Include="Bridge\ReactBridge.cs" />
142135
<Compile Include="CoreModulesPackage.cs" />
143-
<Compile Include="DevSupport\IDevSupportManager.cs" />
144136
<Compile Include="DevSupport\WebSocketJavaScriptExecutor.cs" />
145137
<Compile Include="GlobalSuppressions.cs" />
146138
<Compile Include="Modules\AppState\AppStateModule.cs" />
147139
<Compile Include="Modules\Clipboard\ClipboardInstance.cs" />
148140
<Compile Include="Modules\Clipboard\ClipboardModule.cs" />
149141
<Compile Include="Modules\Clipboard\IClipboardInstance.cs" />
150-
<Compile Include="Modules\Core\JavaScriptException.cs" />
151142
<Compile Include="Modules\Dialog\DialogModule.cs" />
152143
<Compile Include="Modules\Image\BitmapImageHelpers.cs" />
153144
<Compile Include="Modules\Image\ImageLoaderModule.cs" />
@@ -192,9 +183,6 @@
192183
<Compile Include="Modules\Core\ExceptionsManagerModule.cs" />
193184
<Compile Include="Modules\WebSocket\WebSocketModule.cs" />
194185
<Compile Include="ReactInstanceManager.cs" />
195-
<Compile Include="Modules\Core\DeviceEventManagerModule.cs" />
196-
<Compile Include="Modules\Core\RCTDeviceEventEmitter.cs" />
197-
<Compile Include="Modules\Core\RCTNativeAppEventEmitter.cs" />
198186
<Compile Include="IReactPackage.cs" />
199187
<Compile Include="Shell\MainReactPackage.cs" />
200188
<Compile Include="Touch\JavaScriptResponderHandler.cs" />

0 commit comments

Comments
 (0)