Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the WASM Trimming issue #996

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/Demo/Client/FluentUI.Demo.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" PrivateAssets="all" />
</ItemGroup>

<!-- For WASM, Trim Icons and Emojis Libs, -->
<!-- but not Core and Shared libs -->
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.FluentUI.AspNetCore.Components" />
<TrimmerRootAssembly Include="FluentUI.Demo.Shared" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\FluentUI.Demo.Shared.csproj" />
</ItemGroup>
Expand Down
12 changes: 1 addition & 11 deletions examples/Demo/Shared/Pages/Drag/DragDropPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,4 @@

<ApiDocumentation Component="typeof(FluentDragContainer<>)" InstanceTypes="@(new[] {typeof(object)})" GenericLabel="TItem" />
<ApiDocumentation Component="typeof(FluentDropZone<>)" InstanceTypes="@(new[] {typeof(object)})" GenericLabel="TItem" />
<ApiDocumentation Component="typeof(FluentDragEventArgs<>)" InstanceTypes="@(new[] {typeof(object)})" GenericLabel="TItem" />

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
FluentDragContainer<object> temp1 = new FluentDragContainer<object>();
FluentDropZone<object> temp2 = new FluentDropZone<object>();
FluentDragEventArgs<object> temp3 = new FluentDragEventArgs<object>();
}
<ApiDocumentation Component="typeof(FluentDragEventArgs<>)" InstanceTypes="@(new[] {typeof(object)})" GenericLabel="TItem" />
10 changes: 1 addition & 9 deletions examples/Demo/Shared/Pages/Emoji/EmojiPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,4 @@

<h2 id="documentation">Documentation</h2>

<ApiDocumentation Component="typeof(FluentEmoji<>)" InstanceTypes="@(new[] {typeof(Emoji)})" GenericLabel="Emoji"></ApiDocumentation>

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
FluentEmoji<Emoji> temp = new FluentEmoji<Emoji>();
}
<ApiDocumentation Component="typeof(FluentEmoji<>)" InstanceTypes="@(new[] {typeof(Emoji)})" GenericLabel="Emoji"></ApiDocumentation>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
options.Title = message;
options.Intent = type;
options.Section = App.MESSAGES_TOP;
options.Timeout = 4;
options.Timeout = 4000;
});
}

Expand Down
13 changes: 1 addition & 12 deletions examples/Demo/Shared/Pages/MessageBar/MessageBarPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,4 @@

<ApiDocumentation Component="typeof(MessageService)" />

<ApiDocumentation Component="typeof(Message)" />

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
FluentMessageBarProvider temp1 = new FluentMessageBarProvider();
FluentMessageBar temp2 = new FluentMessageBar();
MessageService temp3 = new MessageService();
Message temp4 = new Message();
}
<ApiDocumentation Component="typeof(Message)" />
21 changes: 1 addition & 20 deletions examples/Demo/Shared/Pages/MessageBox/MessageBoxPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,4 @@

<ApiDocumentation Component="typeof(MessageBoxContent)" />

<ApiDocumentation Component="typeof(DialogParameters<>)" InstanceTypes="@(new[] {typeof(MessageBoxContent)})" GenericLabel="MessageBoxData" />

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
protected override void OnInitialized()
{
var temp1 = new DialogParameters<MessageBoxContent>();
var temp2 = new MessageBoxContent()
{
Icon = new Icons.Regular.Size24.Check(),
IconColor = Color.Accent,
};
var temp3 = temp2.IconColor;
var temp4 = temp2.Intent;
var temp5 = temp2.MarkupMessage;
}
}
<ApiDocumentation Component="typeof(DialogParameters<>)" InstanceTypes="@(new[] {typeof(MessageBoxContent)})" GenericLabel="MessageBoxData" />
11 changes: 1 addition & 10 deletions examples/Demo/Shared/Pages/SplashScreen/SplashScreenPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,4 @@

<ApiDocumentation Component="typeof(SplashScreenContent)" />

<ApiDocumentation Component="typeof(FluentSplashScreen)" />

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
SplashScreenContent temp1 = new SplashScreenContent();
FluentSplashScreen temp2 = new FluentSplashScreen() { Dialog = new FluentDialog() };
}
<ApiDocumentation Component="typeof(FluentSplashScreen)" />
9 changes: 0 additions & 9 deletions examples/Demo/Shared/Pages/Splitter/SplitterPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,3 @@

<ApiDocumentation Component="typeof(FluentSplitter)" />
<ApiDocumentation Component="typeof(SplitterResizedEventArgs)" />

@code
{
// Hack to force the compiler to include this class in the final library
// (WASM publishing)
// TODO: To find a better solution
FluentSplitter temp1 = new FluentSplitter();
SplitterResizedEventArgs temp2 = new SplitterResizedEventArgs();
}