My Experience with mapperly
in Blazor
& bit platform
Project Templates
#666
Closed
ysmoradi
started this conversation in
Show and tell
Replies: 2 comments
-
Thanks for the feedback! We may need to add the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for sharing your experience! I think you should be able to achieve the same (also for non blazor projects) by setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to share my experience using the awesome
Mapperly
library in Blazor, especially in our Project Templates.The primary reason for using Mapper on the client side is to apply the changes returned from the API calls of Insert/Update to the object that is bound to the UI.
Most mapper libraries add about 150 kilobytes to your project (in a compressed form), which is not appealing at all.
They generally use
System.Reflection
andSystem.Reflection.Emit
, which are not ideal for both the Blazor WebAssembly Interpreter and AOT, causing slowness.This library solves this challenge using C# Source Generators.
However, this library has a relatively heavy DLL named
Riok.Mapperly.Abstractions.dll
which is not needed at runtime! (":You can prevent it from being automatically downloaded using:
<BlazorWebAssemblyLazyLoad Include="Riok.Mapperly.Abstractions.dll" />
Don't download it later as there is no need to this dll at runtime!
Next, I really need to thank them for the Extension Methods of this library ❤️
They are very attractive; I am posting two pictures that show the improvement in our code after using this library and its Extension methods:
Implementing business logic within the Controllers might not be the best idea, but currently, our Project Templates are focused on the client side.
These templates allow you to code only once with C#, HTML, and CSS and get outputs for Android, iOS, Windows, macOS, Linux, and Web. The web output can have pre-rendering or not, be a PWA (Progressive Web App) or not, or for instance, be SEO-friendly, while you've access to all underlying OS features!
Additionally, themes, multilingual support among many other benefits are included in our high performance lightweight project templates!
Moving forward, a Clean Architecture version for the backend will also be provided.
Beta Was this translation helpful? Give feedback.
All reactions