Skip to content

Commit

Permalink
feat: Enabling Hot Reload
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrandolph committed Oct 27, 2023
1 parent 9f48484 commit e279cb7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Uno.Templates/Uno.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<PropertyGroup>
<UnoExtensionsVersion Condition="'$(UnoExtensionsVersion)' == ''">3.0.0-dev.2335</UnoExtensionsVersion>
<UnoVersion Condition="'$(UnoVersion)' == ''">5.0.0-dev.3597</UnoVersion>
<UnoVersion Condition="'$(UnoVersion)' == ''">5.1.0-dev.52</UnoVersion>
<UnoExtensionsLoggingVersion Condition="'$(UnoExtensionsLoggingVersion)' == ''">1.6.0</UnoExtensionsLoggingVersion>
<SkiaSharpVersion Condition="'$(SkiaSharpVersion)' == ''">2.88.6</SkiaSharpVersion>
<UnoCoreExtensionsLoggingVersion Condition="'$(UnoCoreExtensionsLoggingVersion)' == ''">4.0.1</UnoCoreExtensionsLoggingVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
MainWindow = Microsoft.UI.Xaml.Window.Current;
#endif

#if DEBUG
MainWindow.EnableHotReload();
#endif

//+:cnd:noEmit
#if mauiEmbedding
//-:cnd:noEmit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
);
MainWindow = builder.Window;

//-:cnd:noEmit
#if DEBUG
MainWindow.EnableHotReload();
#endif
//+:cnd:noEmit

#if useFrameNav
//-:cnd:noEmit
Host = builder.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#endif
//+:cnd:noEmit
#endif
global using Uno.UI;
#if (useCsharpMarkup)
global using Uno.Extensions.Markup;
#if (useMaterial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@
<ItemGroup>
<!--#if (useCPM)-->
<PackageReference Include="Uno.WinUI.Lottie" />
<PackageReference Include="Uno.WinUI.DevServer" Condition="'$(Configuration)'=='Debug'" />
<!--#else-->
<PackageReference Include="Uno.WinUI.Lottie" Version="$UnoWinUIVersion$" />
<PackageReference Include="Uno.WinUI.DevServer" Version="$UnoWinUIVersion$" Condition="'$(Configuration)'=='Debug'" />
<!--#endif-->

<!-- Include all images by default - matches the __WindowsAppSdkDefaultImageIncludes property in the WindowsAppSDK -->
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.Templates/reinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param(
[string]$ExtensionsVersion = "3.0.0-dev.2335",

# Version of published Uno.WinUI packages
[string]$UnoVersion = "5.0.0-dev.3597"
[string]$UnoVersion = "5.1.0-dev.52"
)

function RemoveNuGetPackage {
Expand Down

0 comments on commit e279cb7

Please sign in to comment.