-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a74365
commit 8ac4dab
Showing
13 changed files
with
294 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<linker> | ||
<assembly fullname="MauiEmbedding" /> | ||
<assembly fullname="MauiEmbedding.Wasm" /> | ||
|
||
<!-- | ||
Uncomment this section when using JSON.NET | ||
<assembly fullname="System.Core"> | ||
<type fullname="System.Linq.Expressions*" /> | ||
</assembly> | ||
--> | ||
</linker> |
75 changes: 75 additions & 0 deletions
75
samples/MauiEmbedding/MauiEmbedding.Wasm/MauiEmbedding.Wasm.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<!-- This is only required because this project references Uno.Extensions.Maui.WinUI as a package reference (ie by source) --> | ||
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.props" /> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<NoWarn>$(NoWarn);NU1504;NU1505;NU1701</NoWarn> | ||
<!-- Disabled due to issue with Central Package Management with implicit using --> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<WasmPWAManifestFile>manifest.webmanifest</WasmPWAManifestFile> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<!-- | ||
Supports Deep Linking Routes | ||
https://aka.platform.uno/wasm-deeplink | ||
--> | ||
<WasmShellWebAppBasePath>/</WasmShellWebAppBasePath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> | ||
<MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled> | ||
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants> | ||
<DebugType>portable</DebugType> | ||
<DebugSymbols>true</DebugSymbols> | ||
<!-- | ||
IL Linking is disabled in Debug configuration. | ||
When building in Release, see https://platform.uno/docs/articles/features/using-il-linker-WebAssembly.html | ||
--> | ||
<WasmShellILLinkerEnabled>false</WasmShellILLinkerEnabled> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> | ||
<!-- XAML Resource trimming https://aka.platform.uno/xaml-trimming --> | ||
<!--<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>--> | ||
<!-- Improve performance with AOT builds https://aka.platform.uno/wasm-aot --> | ||
<!-- <WasmShellMonoRuntimeExecutionMode>InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode> --> | ||
<!-- Temporarily uncomment to generate an AOT profile https://aka.platform.uno/wasm-aot-profile --> | ||
<!-- <WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile> --> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="manifest.webmanifest" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="WasmCSS\Fonts.css" /> | ||
<EmbeddedResource Include="WasmScripts\AppManifest.js" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<LinkerDescriptor Include="LinkerConfig.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!-- | ||
This item group is required by the project template because of the | ||
new SDK-Style project, otherwise some files are not added automatically. | ||
You can safely remove this ItemGroup completely. | ||
--> | ||
<None Include="Program.cs" /> | ||
<None Include="LinkerConfig.xml" /> | ||
<None Include="wwwroot\web.config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Windows.Compatibility" /> | ||
<PackageReference Include="Uno.Wasm.Bootstrap" /> | ||
<PackageReference Include="Uno.Wasm.Bootstrap.DevServer" /> | ||
<PackageReference Include="Uno.WinUI.WebAssembly" /> | ||
<PackageReference Include="Uno.WinUI.RemoteControl" Condition="'$(Configuration)'=='Debug'" /> | ||
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" /> | ||
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Console" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\MauiEmbedding\MauiEmbedding.csproj" /> | ||
</ItemGroup> | ||
<Import Project="..\MauiEmbedding.Base\base.props" /> | ||
<Import Project="..\..\..\src\Uno.Extensions.Maui.UI\build\Package.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace MauiEmbedding.Wasm; | ||
|
||
public class Program | ||
{ | ||
private static App? _app; | ||
|
||
public static int Main(string[] args) | ||
{ | ||
Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead()); | ||
|
||
return 0; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
samples/MauiEmbedding/MauiEmbedding.Wasm/WasmCSS/Fonts.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
When adding fonts here, make sure to add them using a base64 data uri, otherwise | ||
fonts loading are delayed, and text may get displayed incorrectly. | ||
*/ | ||
|
||
/* https://github.com/unoplatform/uno/issues/3954 */ | ||
@font-face { | ||
font-family: 'Segoe UI'; | ||
src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'Roboto'; | ||
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype'); | ||
font-weight: 300; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Roboto'; | ||
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype'); | ||
font-weight: 400; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Roboto'; | ||
src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype'); | ||
font-weight: 500; | ||
} |
3 changes: 3 additions & 0 deletions
3
samples/MauiEmbedding/MauiEmbedding.Wasm/WasmScripts/AppManifest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var UnoAppManifest = { | ||
displayName: "MauiEmbedding" | ||
} |
10 changes: 10 additions & 0 deletions
10
samples/MauiEmbedding/MauiEmbedding.Wasm/manifest.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"background_color": "#ffffff", | ||
"description": "MauiEmbedding", | ||
"display": "standalone", | ||
"name": "MauiEmbedding", | ||
"short_name": "MauiEmbedding", | ||
"start_url": "/index.html", | ||
"theme_color": "#ffffff", | ||
"scope": "/" | ||
} |
30 changes: 30 additions & 0 deletions
30
samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/staticwebapp.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"navigationFallback": { | ||
"rewrite": "/index.html", | ||
"exclude": [ | ||
"*.{css,js}", | ||
"*.{png}", | ||
"*.{c,h,wasm,clr,pdb,dat,txt}" | ||
] | ||
}, | ||
"routes": [ | ||
{ | ||
"route": "/package_*", | ||
"headers": { | ||
"cache-control": "public, immutable, max-age=31536000" | ||
} | ||
}, | ||
{ | ||
"route": "/*.ttf", | ||
"headers": { | ||
"cache-control": "public, immutable, max-age=31536000" | ||
} | ||
}, | ||
{ | ||
"route": "/*", | ||
"headers": { | ||
"cache-control": "must-revalidate, max-age=3600" | ||
} | ||
} | ||
] | ||
} |
78 changes: 78 additions & 0 deletions
78
samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/web.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<system.web> | ||
<customErrors mode="Off"/> | ||
</system.web> | ||
|
||
<system.webServer> | ||
|
||
<!-- Disable compression as we're doing it through pre-compressed files --> | ||
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" /> | ||
|
||
<staticContent> | ||
<remove fileExtension=".dll" /> | ||
<remove fileExtension=".wasm" /> | ||
<remove fileExtension=".woff" /> | ||
<remove fileExtension=".woff2" /> | ||
<mimeMap fileExtension=".wasm" mimeType="application/wasm" /> | ||
<mimeMap fileExtension=".clr" mimeType="application/octet-stream" /> | ||
<mimeMap fileExtension=".pdb" mimeType="application/octet-stream" /> | ||
<mimeMap fileExtension=".woff" mimeType="application/font-woff" /> | ||
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" /> | ||
<mimeMap fileExtension=".dat" mimeType="application/octet-stream" /> | ||
<!-- Required for PWAs --> | ||
<mimeMap fileExtension=".json" mimeType="application/octet-stream" /> | ||
</staticContent> | ||
|
||
<rewrite> | ||
<rules> | ||
<rule name="Lookup for pre-compressed brotli file" stopProcessing="true"> | ||
<match url="(.*)$"/> | ||
<conditions> | ||
<!-- Match brotli requests --> | ||
<add input="{HTTP_ACCEPT_ENCODING}" pattern="br" /> | ||
|
||
<!-- Match all but pre-compressed files --> | ||
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_br/)(.*)$" /> | ||
|
||
<!-- Check if the pre-compressed file exists on the disk --> | ||
<add input="{DOCUMENT_ROOT}/_compressed_br/{C:0}" matchType="IsFile" negate="false" /> | ||
</conditions> | ||
<action type="Rewrite" url="/_compressed_br{C:0}" /> | ||
</rule> | ||
|
||
<rule name="Lookup for pre-compressed gzip file" stopProcessing="true"> | ||
<match url="(.*)$"/> | ||
<conditions> | ||
<!-- Match gzip requests --> | ||
<add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" /> | ||
|
||
<!-- Match all but pre-compressed files --> | ||
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_gz/)(.*)$" /> | ||
|
||
<!-- Check if the pre-compressed file exists on the disk --> | ||
<add input="{DOCUMENT_ROOT}/_compressed_gz/{C:0}" matchType="IsFile" negate="false" /> | ||
</conditions> | ||
<action type="Rewrite" url="/_compressed_gz{C:0}" /> | ||
</rule> | ||
</rules> | ||
|
||
<outboundRules> | ||
<rule name="Adjust content encoding for gzip pre-compressed files" enabled="true" stopProcessing="true"> | ||
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" /> | ||
<conditions> | ||
<add input="{REQUEST_URI}" pattern="/_compressed_gz/.*$" /> | ||
</conditions> | ||
<action type="Rewrite" value="gzip"/> | ||
</rule> | ||
<rule name="Adjust content encoding for brotli pre-compressed files" enabled="true" stopProcessing="true"> | ||
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" /> | ||
<conditions> | ||
<add input="{REQUEST_URI}" pattern="/_compressed_br/.*$" /> | ||
</conditions> | ||
<action type="Rewrite" value="br"/> | ||
</rule> | ||
</outboundRules> | ||
</rewrite> | ||
</system.webServer> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters