-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreflight.App.csproj
More file actions
92 lines (78 loc) · 4.39 KB
/
Preflight.App.csproj
File metadata and controls
92 lines (78 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<RootNamespace>Preflight.App</RootNamespace>
<AssemblyName>Preflight.App</AssemblyName>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer"
PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Localization" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" />
<PackageReference Include="Markdig" />
<!-- NOTE: FluentUI Icons package NOT referenced on purpose.
It ships ~100+ MB of separate WASM assemblies (Filled/Regular/Light variants)
which Blazor tries to download on startup, making boot hang in dev and
ballooning the production bundle. We use emojis for iconography instead. -->
<!-- <PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" /> -->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Preflight.Unattend\Preflight.Unattend.csproj" />
</ItemGroup>
<!--
📝 CHANGELOG embedded as resource so the in-app "What's new" modal
and the GitHub release-notes never drift apart. Source of truth lives
at the repo root: docs reference it, contributors edit it there, and
the desktop release pipeline pulls the same file. LogicalName pins
the resource key the app reads via assembly.GetManifestResourceStream.
Per-language file (CHANGELOG.uk.md) is loaded when CurrentUICulture's
two-letter code matches; otherwise ChangelogService falls back to the
canonical CHANGELOG.md. Add a new translation by dropping
CHANGELOG.{xx}.md alongside the EN file and adding it here.
WithCulture="false" is critical: MSBuild treats files named like
`*.<lang>.*` (e.g. CHANGELOG.uk.md) as culture-specific resources and
routes them into a satellite assembly (uk\Preflight.App.resources.dll)
instead of the main one. ChangelogService loads via
GetManifestResourceStream on the MAIN assembly, so the resource needs
to live there. WithCulture="false" overrides the auto-detection.
-->
<ItemGroup>
<EmbeddedResource Include="..\..\CHANGELOG.md" LogicalName="CHANGELOG.md" WithCulture="false" />
<EmbeddedResource Include="..\..\CHANGELOG.uk.md" LogicalName="CHANGELOG.uk.md" WithCulture="false" />
</ItemGroup>
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js"
PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
<!--
🔒 IL Trimmer guards for Newtonsoft-driven JSON deserialization.
Blazor WASM Release publishing trims IL aggressively (default for net8+).
Three things in our JSON path are reflection-only and get stripped without
explicit roots, each surfacing as a different startup crash:
1. UnattendGenerator (vendored Schneegans assembly) - Bloatware.json uses
Newtonsoft `$type` polymorphism, so concrete BloatwareStep subclasses
are referenced only as strings. Without this root:
"Could not load type 'Schneegans.Unattend.PackageBloatwareStep,
UnattendGenerator'"
2. System.Collections.Immutable - the catalog deserializes into
ImmutableList<BloatwareStep>. Newtonsoft uses ImmutableList.CreateRange
via reflection; nothing else calls it directly, so the trimmer drops
it. Without this root:
"Unable to find a constructor to use for type
System.Collections.Immutable.ImmutableList`1[BloatwareStep]"
3. Newtonsoft.Json itself - several reflection paths (ImmutableCollections
utils, $type resolver) are reachable only through internals; safest to
pin the whole assembly.
Total cost ~400 KB on top of the published WASM bundle. Without these the
app crashes on first construction of UnattendXmlBuilder (singleton -> first
page that touches the bloatware catalog).
-->
<ItemGroup>
<TrimmerRootAssembly Include="UnattendGenerator" />
<TrimmerRootAssembly Include="System.Collections.Immutable" />
<TrimmerRootAssembly Include="Newtonsoft.Json" />
</ItemGroup>
</Project>