Skip to content

Commit 854370a

Browse files
committed
Update trimming Justificaitons
1 parent 23e00e3 commit 854370a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Components/Components/src/PersistentState/PersistentServicesRegistry.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public PersistentServicesRegistry(IServiceProvider serviceProvider)
3636

3737
internal IReadOnlyList<IPersistentComponentRegistration> Registrations => _registrations;
3838

39-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
39+
[UnconditionalSuppressMessage(
40+
"Trimming",
41+
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
42+
Justification = "Types registered for persistence are preserved in the API call to register them and typically live in assemblies that aren't trimmed.")]
4043
internal void RegisterForPersistence(PersistentComponentState state)
4144
{
4245
if (_subscriptions.Count != 0)
@@ -91,7 +94,9 @@ private static void PersistInstanceState(object instance, Type type, PersistentC
9194
}
9295
}
9396

94-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
97+
[UnconditionalSuppressMessage("Trimming",
98+
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
99+
Justification = "Types registered for persistence are preserved in the API call to register them and typically live in assemblies that aren't trimmed.")]
95100
[DynamicDependency(LinkerFlags.JsonSerialized, typeof(PersistentComponentRegistration))]
96101
internal void Restore(PersistentComponentState state)
97102
{
@@ -103,7 +108,7 @@ internal void Restore(PersistentComponentState state)
103108
RestoreRegistrationsIfAvailable(state);
104109
}
105110

106-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
111+
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "Types registered for persistence are preserved in the API call to register them and typically live in assemblies that aren't trimmed.")]
107112
private void RestoreRegistrationsIfAvailable(PersistentComponentState state)
108113
{
109114
foreach (var registration in _registrations)

src/Components/Components/src/SupplyParameterFromPersistentComponentStateValueProvider.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ public bool CanSupplyValue(in CascadingParameterInfo parameterInfo)
5656
return state.TryTakeFromJson(storageKey, parameterInfo.PropertyType, out var value) ? value : null;
5757
}
5858

59-
[UnconditionalSuppressMessage("Trimming", "IL2075:'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.", Justification = "<Pending>")]
60-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
61-
[UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.", Justification = "<Pending>")]
59+
[UnconditionalSuppressMessage("Trimming", "IL2075:'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.", Justification = "OpenComponent already has the right set of attributes")] [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "OpenComponent already has the right set of attributes")] [UnconditionalSuppressMessage("Trimming", "IL2072:Target parameter argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The return value of the source method does not have matching annotations.", Justification = "OpenComponent already has the right set of attributes")]
6260
public void Subscribe(ComponentState subscriber, in CascadingParameterInfo parameterInfo)
6361
{
6462
var propertyName = parameterInfo.PropertyName;

0 commit comments

Comments
 (0)