@nativescript/windows 0.1.0-alpha.42 → 0.1.0-alpha.44

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.
@@ -23,6 +23,9 @@ namespace __PROJECT_NAME__
23
23
  {
24
24
  _runtimeHost.Initialize();
25
25
 
26
+ // Capture before any await — continuations may resume on a thread pool thread.
27
+ var dispatcher = Window.Current.Dispatcher;
28
+
26
29
  // Show crash report from the previous run if one exists.
27
30
  try
28
31
  {
@@ -61,24 +64,29 @@ namespace __PROJECT_NAME__
61
64
  await CrashDiagnostics.ShowCrashDialogAsync("Script Execution Error", report);
62
65
  }
63
66
 
64
- Windows.UI.Xaml.Media.CompositionTarget.Rendering += OnRenderFrame;
65
-
66
- if (Window.Current.Content == null)
67
+ // After any await, the continuation may run on a thread pool thread.
68
+ // Schedule all UI-thread-required operations through the dispatcher.
69
+ _ = dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
67
70
  {
68
- Window.Current.Content = new Windows.UI.Xaml.Controls.TextBlock
71
+ Windows.UI.Xaml.Media.CompositionTarget.Rendering += OnRenderFrame;
72
+
73
+ if (Window.Current.Content == null)
69
74
  {
70
- Text = "NativeScript runtime initialized but no UI was rendered.\n" +
71
- "Check the Output window for JS errors.",
72
- Margin = new Windows.UI.Xaml.Thickness(20),
73
- TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap,
74
- FontSize = 16,
75
- };
76
- }
75
+ Window.Current.Content = new Windows.UI.Xaml.Controls.TextBlock
76
+ {
77
+ Text = "NativeScript runtime initialized but no UI was rendered.\n" +
78
+ "Check the Output window for JS errors.",
79
+ Margin = new Windows.UI.Xaml.Thickness(20),
80
+ TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap,
81
+ FontSize = 16,
82
+ };
83
+ }
77
84
 
78
- if (!e.PrelaunchActivated)
79
- {
80
- Window.Current.Activate();
81
- }
85
+ if (!e.PrelaunchActivated)
86
+ {
87
+ Window.Current.Activate();
88
+ }
89
+ });
82
90
  }
83
91
 
84
92
  private void OnSuspending(object sender, SuspendingEventArgs e)
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/windows",
3
- "version": "0.1.0-alpha.42",
3
+ "version": "0.1.0-alpha.44",
4
4
  "description": "NativeScript for using Windows v8",
5
5
  "repository": {
6
6
  "type": "git",