Skip to content

Add Trimming for MudBlazor and rework Icons for the Trimming support#4639

Merged
Garderoben merged 8 commits intoMudBlazor:devfrom
ScarletKuro:dev
May 30, 2022
Merged

Add Trimming for MudBlazor and rework Icons for the Trimming support#4639
Garderoben merged 8 commits intoMudBlazor:devfrom
ScarletKuro:dev

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented May 19, 2022

@henon
As promised, if I find a non breaking way for Icons I will make a PR.
Fixes #2424

Description

This was detailed discussed in the issue ticket so I will move to details of this PR.
Since for better Trimming support there was need to switch from property to const string and not to hold class reference on Icons there was a little nuance - namespaces.
In MudBlazor you could access non-custom icons two ways, for example:
Icons.Filled.Add
and
Icons.Filled.Material.Add
this is an issue for const because you can't do something like that

public class ExampleConst
{
    public const string ConstIcon = "svg";
}

public class Icons
{
    public static readonly ExampleConst Filled = new();
}

If you try to access it like this Icons.Filled.ConstIcon compiler will give an error and tell you to use ExampleConst.ConstIcon instead. This would be a breaking change because even inside MudBlazor in some places the icon was accessed via Icons.Filled and in some Icons.Material.Filled

So my solution to this problem is following, ik its ugly and verbose, but at same time it's genius to keep the backward compatibility.
To keep the namespaces for Icons.Material.Filled(etc) I did this

public partial class Icons
{
        public partial class Material
        {
            public partial class Filled
            {
                  public const string _10k = "svg";
            }
        }
}

to keep Icons.Filled I did this

public partial class Icons
{
        public partial class Filled
        {
              public const string _10k = Material.Filled._10k;
        }
}

Pretty much one of them just references another. Of course, I had to copy-paste all the fields twice, but don't worry, this doesn't add any extra size for the library, and luckily for us this gets trimmed without any issues.

NB! Icons.Filled, Icons.Outlined, Icons.Rounded, Icons.Sharp, Icons.TwoTone I moved to "Obsolete" folder(if you think the folder should have different name, please let me know), because in future I think the icons should be accessed only via Icons.Material.* and in new major version we should keep only one option.

Docs

I had to slightly modify the MudBlazor.Docs to support the const fields.

Difference

Mode Size
MudBlazor without trimming 8600 KB
MudBlazor with trimming 7178 KB
this PR without trimming 8092 KB
this PR with trimming 443 KB

I also added to the MudBlazor.csproj

  <PropertyGroup>
    <IsTrimmable>true</IsTrimmable>
    <TrimMode>link</TrimMode>
  </PropertyGroup>

Otherwise, the trimming won't work with <PublishTrimmed>true</PublishTrimmed> because dotnet doesn't touch libraries that aren't marked with IsTrimmable unless you force it with some magic like TrimmableAssembly or ManagedAssemblyToLink which is not obvious for most people.

How Has This Been Tested?

Run the existing unit tests. Mostly visually, I made sure that the Icons work properly in MudBlazor.Docs and tested it on my production application.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #4639 (97ce0e9) into dev (68a80de) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #4639      +/-   ##
==========================================
- Coverage   91.39%   91.37%   -0.02%     
==========================================
  Files         366      365       -1     
  Lines       12573    12535      -38     
==========================================
- Hits        11491    11454      -37     
+ Misses       1082     1081       -1     
Impacted Files Coverage Δ
src/MudBlazor/Base/MudFormComponent.cs 87.98% <ø> (ø)
src/MudBlazor/Components/DataGrid/Cell.cs 93.47% <ø> (ø)
...MudBlazor/Components/DataGrid/MudDataGrid.razor.cs 82.13% <ø> (+0.25%) ⬆️
src/MudBlazor/Services/JsEvent/JsEvent.cs 91.91% <ø> (ø)
...udBlazor/Services/KeyInterceptor/KeyInterceptor.cs 75.75% <ø> (ø)
...dBlazor/Services/ReseizeObserver/ResizeObserver.cs 83.87% <ø> (ø)
...azor/Services/ResizeListener/BreakpointService .cs 93.02% <ø> (ø)
...r/Services/ResizeListener/ResizeListenerService.cs 68.00% <ø> (ø)
...MudBlazor/Services/ResizeListener/ResizeService.cs 93.33% <ø> (ø)
src/MudBlazor/Services/Scroll/ScrollListener.cs 83.33% <ø> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68a80de...97ce0e9. Read the comment docs.

@mikes-gh
Copy link
Contributor

mikes-gh commented May 19, 2022

Thanks for your work on this.

I did quite a bit of work on this previously but couldn't get it to work.
Are you sure turning off the trim analyser doesn't affect functionality?
How are you dealing with all the reflection?
What happens when you use one icon. Does it add the whole class as a dependency?

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 19, 2022

What happens when you use one icon. Does it add the whole class as a dependency?

If we use some dissembler and look inside the trimmed library, we won't even see Icons there.
If the project uses an Icon, it will copy the value to its project, I think the image is self-explanatory
code
this is taken from my project. The reference icon turned into the string in my project meanwhile there is no presence of Icons.Rounded.Phone in the MudBlazor.dll

How are you dealing with all the reflection?

I didn't see much reflection in the MudBlazor except the MudBlazor.Docs for the Icons for example and one place that uses Expression for filtering?

Are you sure turning off the trim analyses doesn't affect functionality?

By default it's disabled, I explicitly set the property because it makes sense to enable it in the future.
Enabling it would fail the complication because 4 components are not trim friendly, in total there are 10 warnings.
MudFormComponent(validation only)
MudDataGrid
FilterDefinition(which only uses MudDataGrid)
EventManager

This are the problematic methods:
ValidationContext(Form validation)
Expression.Property(only MudDataGrid)
JsonSerializer.Serialize(mainly MudDataGrid)
JsonSerializer.Deserialize(mainly MudDataGrid)

So my bet is that mostly only the MudDataGrid grid is broken, which I understand will be reworked anyway.

So there is chance it won't work properly with trimming(but not necessarily). We need to investigate it.
For now as separate PR we can mark those components/methods(some are public) as RequiresUnreferencedCode to make it clearer to the developer that this are not trim friendly. Later we can rewrite some to make it trim friendly. Nothing too criminal.

@mikes-gh
Copy link
Contributor

mikes-gh commented May 19, 2022

Let me first say I appreciate this PR 👍
Bugs that turn up due to trimming are very hard to diagnose so I just want to be sure you have fully assessed the reasons and affects of ignoring the trim warnings.

Are you sure turning off the trim analyses doesn't affect functionality?

By default it's disabled,

I am not sure that is true. Remove it and recompile and the build will fail

For now as separate PR we can mark those methods as RequiresUnreferencedCode

That leads you down a path that I failed on as once you mark one method you have to mark the dependencies and so on and so on.

Probably the only way is to make the relevant methods trim friendly.

Its up to the core team if we want to ignore the trim warnings @henon @just-the-benno

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 20, 2022

I am not sure that is true. Remove it and recompile and the build will fail

You are correct, for some reason I thought that by default it's disabled.

Bugs that turn up due to trimming are very hard to diagnose so I just want to be sure you have fully assessed the reasons and affects of ignoring the trim warnings.

Ok, tmr I will make analysis and check on the MudBlazor.Docs with trimming to see what got broken and how bad it is. My project obviously doesn't use all the components so I don't know how usable it is actually.
You have a point, I guess it's not best idea to leave the developer with bugs that might happen because of trimming and maybe then we should remove IsTrimmable so they would use it only at their own risk, on the other hand trimming is not officially yet supported in .net6 for aspnetcore which doesn't stop people from using it and we have to start from some point.

@mikes-gh
Copy link
Contributor

This is great work would be a shame to lose momentum on it. I hope to have a look at the trim warnings as well. Maybe there are some easy wins.

@henon
Copy link
Contributor

henon commented May 20, 2022

@ScarletKuro Thank you very much for making a non-breaking PR. And yes, next major version we'll remove the old way of using the icons in favor of the new structure if @Garderoben agrees.

@Garderoben
Copy link
Member

Wow! Amazing! and @henon yes, yes yes!

@Garderoben
Copy link
Member

I uploaded it as a dev nuget 6.0.11-dev.1
https://www.nuget.org/packages/MudBlazor/6.0.11-dev.1

Copy link
Member

@JonBunator JonBunator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a powershell script that automatically updates the icons: https://github.com/MudBlazor/MudBlazor/tree/dev/tools%2FIcons
I guess your PR will break it, won't it?

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 20, 2022

I guess your PR will break it, won't it?

Yes, this PR will break it. But looking at the script it shouldn't be hard to adopt it.

Ok, tmr I will make analysis and check on the MudBlazor.Docs with trimming to see what got broken and how bad it is. My project obviously doesn't use all the components so I don't know how usable it is actually.

Did this today. I tried trimming with MudBlazor.Docs to see what will work and what not. The MudBlazor library was something like ~1.2mb.
Mainly because for the Icons reflection was used and they got trimmed, and we will not count this as "broken" for obvious reason.

Components that got broken for sure:
MudSelect
MudScrollToTop

I didn't really find yet why MudSelect got broken, but when you click on the Item, the dropdown doesn't disappear.
MudScrollToTop is easy to explain, because:

[JSInvokable]
public void RaiseOnScroll(ScrollEventArgs e)
{
     _onScroll?.Invoke(this, e);
}

It's using JSInvokable and has no references, so it's simply got trimmed. There are other places with such issue, for example: KeyInterceptor, ResizeListenerService, ScrollSpy maybe some more but it's not hard to find those. My bet is that if we mark them with DynamicallyAccessedMembersAttribute \ DynamicDependency we are good to go. (will make a PR for this later)

The rest actually looks like working fine. I had no issues with form validation, didn't see bugs in the MudDataGrid either.

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 21, 2022

Okay, I think i fixed all interop, and now MudSelect and MudScrollToTop is working.
@henon now I have a question, should I update this PR with interop trim fixes or make new PR?
Do I need to comment in code why I marked those classes with attributes or just explanations in the ticket will be enough?

@ScarletKuro
Copy link
Member Author

@JonBunator updated powershell script.

@ScarletKuro ScarletKuro requested a review from JonBunator May 21, 2022 11:40
@JonBunator
Copy link
Member

@JonBunator updated powershell script.

Thank you!

@mikes-gh
Copy link
Contributor

@ScarletKuro Great work. I would suggest adding the fixes to this PR. We don't want to merge known bugs even if the next PR fixes them. @henon @Garderoben after these fixes and before we merge should we publish the PR to MudBlazorTest ?Trimming bugs don't hit the test suite. Maybe the core team could run through the docs to see if they can find any broken bits and then compare to dev.

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 21, 2022

Added to PR. the pattern was taken from aspnetcore.
I also had to mark not only some methods but types too, because they were used by JS but not by the library, like ScrollEventArgs. Or for example KeyOptions and KeyInterceptorOptions was used by lib but only the setters, and getters would be trimmed, when getters are needed for interop serlization.

I think I can fix some TrimAnalyzer warnings, the JsonSerializer with SourceGenerator, but this will be somekind of breaking change.
This one for example

var @event = JsonSerializer.Deserialize(eventData, element.eventType, new JsonSerializerOptions

Currently it has no restriction on the eventType object,
We can use JsonSerializerContext and make a "whitelist" of web events

    [JsonSerializable(typeof(EventArgs))]
    [JsonSerializable(typeof(ChangeEventArgs))]
    [JsonSerializable(typeof(ClipboardEventArgs))]
    [JsonSerializable(typeof(DragEventArgs))]
    [JsonSerializable(typeof(ErrorEventArgs))]
    [JsonSerializable(typeof(FocusEventArgs))]
    [JsonSerializable(typeof(KeyboardEventArgs))]
    [JsonSerializable(typeof(MouseEventArgs))]
    [JsonSerializable(typeof(PointerEventArgs))]
    [JsonSerializable(typeof(ProgressEventArgs))]
    [JsonSerializable(typeof(TouchEventArgs))]
    [JsonSerializable(typeof(WheelEventArgs))]
    internal sealed partial class WebEventJsonContext : JsonSerializerContext
    {
    }

And then it will be trimm friendly. The breaking thing here is that it won't accept any kind of type.

@henon
Copy link
Contributor

henon commented May 21, 2022

@mikes-gh
Copy link
Contributor

@Garderoben @henon Is it ok to use MudBlazor-Test to publish this with docs? I saw it was used recently.

@henon
Copy link
Contributor

henon commented May 21, 2022

Sure, why not?

@mikes-gh
Copy link
Contributor

mikes-gh commented May 21, 2022

Sure, why not?

Just wanted to make sure someone wasnt using it for a current piece of work because I saw it was at 6.0.10

@mikes-gh
Copy link
Contributor

I published this to

https://mudblazor-test.azurewebsites.net/

As discussed no icons in there as the reflection is not annotated but at least this tells us its trimmed version of docs.

https://mudblazor-test.azurewebsites.net/features/icons#icons

See if we can find any more issues.

@ScarletKuro
Copy link
Member Author

ScarletKuro commented May 21, 2022

@mikes-gh did you host the MudBlazor.Docs.Wasm not the MudBlazor.Docs.WasmHost? If yes then as side note the table/datagrid won't be able to load the api(webapi/periodictable / webapi/americanStates) to show anything. Also if u want you can edit/remove the Content Security Policy in index.html to get rid of some errors in console.

@mikes-gh
Copy link
Contributor

Youre right I'll republish

@mikes-gh
Copy link
Contributor

OK Done sorry for delay. vscode publish wasnt working so had to use my work machine to publish with vs 2022

@mikes-gh
Copy link
Contributor

mikes-gh commented May 21, 2022

@ScarletKuro Could you fix the material icons in the docs please. I see for custom icons the class is instantiated so the custom icons don't get trimmed but material still only uses reflection so they are not in MudBlazor.dll. Of course this means that the docs wont have much saving from trimming but this is expected as the docs showcase nearly all the features. Or we could turn off trimming for the docs but there might be some savings? (I added <PubishTrimmed>true</PublishTrimmed> to MudBlazor.Docs.Wasm). Or maybe we could lazy load the full set of icons if they were in a separate library.

@mikes-gh
Copy link
Contributor

mikes-gh commented May 21, 2022

@Garderoben For the purposes of the docs how about serving the icon page svg strings from the wasm host via api. That way we can keep the larger MudBlazor.dll server side and use only the smaller version in the WASM startup.

@ScarletKuro
Copy link
Member Author

OK Done

Ty, now it's working

Could you fix the material icons in the docs please

Ok i will look this one when I will have time.

Or we could turn off trimming for the docs

If you just turn off the PubishTrimmed for wasm client then the libs won't be trimmed


I have another question. Does it make sense to fix MudDataGrid trimm warnings or not? Because as I understood that someone is working on DataGrid anyway?

We can avoid those either by using expression overload with type which is already marked with DynamicallyAccessedMembers

public static MemberExpression Property(Expression? expression [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties|DynamicallyAccessedMemberTypes.NonPublicProperties)] Type type, string propertyName)
else if(isNumber){
    var nullableDoubleType = typeof(double?);
    var isnotnull = Expression.IsTrue(Expression.Property(field, nullableDoubleType, "HasValue"));
    var isnull = Expression.IsFalse(Expression.Property(field, nullableDoubleType, "HasValue"));
}
else if (isBoolean){
    var isnotnull = Expression.IsTrue(Expression.Property(field, typeof(bool?), "HasValue"));
}
else if (isDateTime){
    var nullableDateTimeType = typeof(DateTime?);
    var isnotnull = Expression.IsTrue(Expression.Property(field, nullableDateTimeType, "HasValue"));
    var isnull = Expression.IsFalse(Expression.Property(field, nullableDateTimeType, "HasValue"));
}

or using wrapper

internal class NullableProperty<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> where T : struct
    public static PropertyInfo HasValue { get; } = typeof(T?).GetProperty("HasValue");
}
else if(isNumber){
    var isnotnull = Expression.IsTrue(Expression.Property(field, NullableProperty<double>.HasValue));
    var isnull = Expression.IsFalse(Expression.Property(field, NullableProperty<double>.HasValue));
}
else if (isBoolean){
    var isnotnull = Expression.IsTrue(Expression.Property(field, NullableProperty<bool>.HasValue));
}
else if (isDateTime){
    var isnotnull = Expression.IsTrue(Expression.Property(field, NullableProperty<DateTime>.HasValue));
    var isnull = Expression.IsFalse(Expression.Property(field, NullableProperty<DateTime>.HasValue));
}

@henon
Copy link
Contributor

henon commented Jun 8, 2022

it is already released as a preview nuget https://www.nuget.org/packages/MudBlazor/6.0.11-dev.3
but @Garderoben will very soon release v6.0.11

@boukenka
Copy link
Contributor

@henon I'm rather waiting for version v6.0.11 for the fixes concerning memory leaks. I hope it will be available soon

@boukenka
Copy link
Contributor

@Garderoben I ask again because I think it's important to have a new official (non-dev) version available to fix memory leaks. When will the release be available?

@henon henon mentioned this pull request Jun 16, 2022
6 tasks
@Yomodo
Copy link
Contributor

Yomodo commented Jun 24, 2022

There have been several inquiries about the release date of v6.0.11 but unfortunately no response as of yet.
I even tried asking on Discord to no avail.

According to NuGet stats, v6.0.10-dev4 has been downloaded 2500 times already and browsing through the MudBlazor Issues,
it seems there are no specific issues related to this dev4 release. In other words: It seems (very) good to go.

In our case, we are eagerly awaiting to make some new features available to our customers
using components that depend on the MudDropZone component; v6.0.10-dev4 has some crucial fixes to make it
work as expected.

Somehow I can't help to feel that MudBlazor has lost traction over the last weeks.
Many, many issues still have triage status and the list of PR's doesn't seem to get shorter.

Please don't get me wrong, I do realize this is an open-source project and I very much appreciate
all the hard work that everybody is contributing to MudBlazor to make it even better.
If there are other things going on, then please let us know, post a message or something, but don't keep your
users in the dark.

My team already asked me twice now if I'm still sure that we made the right decision to choose MudBlazor.
I'm still a 100% confident about my decision, but in the back of my mind a countdown timer has started.

@ghost
Copy link

ghost commented Jun 24, 2022

@ScarletKuro I personally use a fork of the dev branch on my project to get the latest features and I can also fix bugs and open PRs at the same time. I asked myself the same things, should I or not go with MudBlazor because of the overhead. Many form components are bugged and should be rewritten from scratch but still, this is an excellent open source project. A paid version or paid support could probably help.

@henon
Copy link
Contributor

henon commented Jun 24, 2022

I think @Garderoben wanted to do the release two weeks ago but then something got in the way. That is exactly the reason why the preview releases exist, so we can make the fixes available to you all without much work on our part (no need to write the changelog and all the other adminstrative stuff @Garderoben does when he releases). He hasn't been feeling so well the last weeks so please give him some space and time.

And yes, it is not easy to be there and serve the community all the time. Especially with that volume of issues and PRs we have. We'd really have to do this full time to be able to keep up. Until the time is right to go that way with paid support etc, we kindly ask you guys to sort out issues yourself and fix bugs you need fixed for your projects. It still requires a lot of work on our part to review the PRs. For any PRs which are time critical bug fixes you can request a review from me. I'll try to review as soon as I have a free hour and I'll do preview releases regularly to get those fixes out to the community.

@henon
Copy link
Contributor

henon commented Jun 24, 2022

@Garderoben I ask again because I think it's important to have a new official (non-dev) version available to fix memory leaks. When will the release be available?

@boukenka There would not be much different between an official release and a dev preview except the name and the version. There is no guarantee that an "official" release contains less bugs than a dev preview.

@VAllens
Copy link

VAllens commented Jul 2, 2022

@ScarletKuro thanks!

@henon
Copy link
Contributor

henon commented Jul 2, 2022

FYI v6.0.11 has finally been released.

@MarianSWA
Copy link
Contributor

Unfortunately I have a breaking change after upgrading. But only because I have a special requirement in one project, I use reflection to get the icon from the Icons.Filled class. Is there a way to prevent this trimming for a specific project?

@ScarletKuro
Copy link
Member Author

ScarletKuro commented Jul 3, 2022

@MarianSWA yes, there is a way. You can look commits of this PR, I did this for the docs.
You need a storage with DynamicallyAccessedMembers attribute on type and use it like this.
Also, pay attention that its now const properties, you need .GetFields with different BindingFlags to get that.

.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);

And to get the value its GetRawConstantValue call instead of .GetValue.


Another, more advance and harder way is to use LinkerConfig.xml and add this type to exception.

Let me know if you need additional help with that.

@MarianSWA
Copy link
Contributor

@ScarletKuro The first solution worked perfectly, thanks for the detailed answer 😄

jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
@ScarletKuro ScarletKuro mentioned this pull request Dec 23, 2022
6 tasks
3dots pushed a commit to 3dots/MudBlazor that referenced this pull request Mar 23, 2023
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
ScarletKuro added a commit to ScarletKuro/MudBlazor that referenced this pull request Mar 27, 2023
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
ferraridavide pushed a commit to ferraridavide/MudBlazor that referenced this pull request May 30, 2023
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
@ScarletKuro ScarletKuro mentioned this pull request Jul 20, 2023
2 tasks
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
…udBlazor#4639)

* Add IsTrimmable to the library

Make Icons as const to support trimming
Add const Icon support in MudBlazor.Docs

* Change Update-MudIcons.ps1 for new Icons structure

* Add DynamicDependency to prevent trimming for JavaScript interop

Fix conflict

Fix

* Do not trim icons for MudBlazor.Docs

* Introduce WebEventJsonContext for trimming friendly deserialization in EventManager

* Use trim friendly Expression.Property overload for FilterDefinition

Remove unnecessary attribute from EventManager

* Suppress warning for validation. And mark datagrid with RequiresUnreferencedCode

* Add trim warning suppression in MudDataGrid

Co-authored-by: Meinrad Recheis <[email protected]>
@henon henon added the legendary Marks contributions that are highly valuable, innovative, or significantly impactful to the project label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library legendary Marks contributions that are highly valuable, innovative, or significantly impactful to the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding MudBlazor increases published WASM app size over 400%

9 participants