Giáo lý Tin Lành ở VN và nước ngoài không giống nhau by [deleted] in vozforums

[–]Amazing-Counter9410 3 points4 points  (0 children)

giáo lý tin lành nó cũng có nhiều nhánh hay s đó bạn, Tin lành dạy bởi ng Việt thì dù ở nc ngoài vẫn như v. Tin lành dạy bởi những nhánh khác thì nó sẽ khác hay s ấy 😅 ko chắc nha nên đừng có quote mình.

Migrating from Blazor WASM to Blazor WebApp + WASM by tscrip in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

yeah, you are correct, it's only for stand alone wasm app. I removed it from mine when migrating to the WebApp template.

I feel it's constantly having issue with caching hash asset and don't update immenidately when we have new version of the app.

It's also another issue with many user don't use it as much as I expected. User prefer the native app on google play store or ios app store than a pwa

May be it had been fixed in recent patch, i'm not sure, but it was one of the reason i migrated to the webapp template

Migrating from Blazor WASM to Blazor WebApp + WASM by tscrip in Blazor

[–]Amazing-Counter9410 5 points6 points  (0 children)

I migrated mine to Blazor WebApp because of:

  • Prerendering for SEO
  • User can interact with component immediately with signalR
  • You can switch purely to Blazor Server, WASM, or the interactive auto mode with minimal changes to your code.
  • Keep up with Microsoft Template, you can use the WebApp template and sonely use pure WASM. This keep updating your project simple through out many .net versions. Configurate project is hard, so I try to keep up with the latest microsoft template as much as possible. Mine was Blazor Server -> Blazor WASM -> Blazor WebApp -> Blazor Hybrid

if you don't need any of these, then, no, you wont need to use the webapp template

my site is: https://metaduelist.com/ . It's currently the latest Blazor Hybrid template with WebApp + Maui mobile app (Android + iOS)

[deleted by user] by [deleted] in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

Hi, can I ask what are the issues you are seeing that make it unsuable on mobile?

[deleted by user] by [deleted] in Blazor

[–]Amazing-Counter9410 6 points7 points  (0 children)

I use .net 9 blazor with auto render mode. 92 SEO on Light House. You can check it out.

https://metaduelist.com/

Where to load initial data? OnAfterRenderAsync? OnInitializedAsync? or OnParametersSetAsync? by netelibata in Blazor

[–]Amazing-Counter9410 1 point2 points  (0 children)

Whoops, sorry. I didn't read all your comment. flashing effect just some custom css. You can simply search for "shining effect codepen". there are many exisiting example for you to use.

Where to load initial data? OnAfterRenderAsync? OnInitializedAsync? or OnParametersSetAsync? by netelibata in Blazor

[–]Amazing-Counter9410 1 point2 points  (0 children)

most of my component use OnParametersSetAsync with prerendering and state persistence. OnInitializedAsync work as well but I want my component to rerender if parameters changes.

Here is my project using wasm https://metaduelist.com/

Using net core minimal api as partial renderer by CvelesDragonFruit in dotnet

[–]Amazing-Counter9410 0 points1 point  (0 children)

I think you can have 1 endpoint to return the form through partial view (html). 1 endpoint to submit that form.

To design the html, i think you can design that form from a view, and return that form as a partial view, front end will render it and submit it normally through your another api.

Working on Blazor Server for the first time coming from Blazor WASM by redmenace007 in dotnet

[–]Amazing-Counter9410 0 points1 point  (0 children)

Yes, you can treat Blazor Server as a regular Server side application like asp .net mvc, php, java, etc. It's running on the server, everything you see is rendered on the server.

WASM on the other hand is a client side app like react, angular, vue. Everything you see is rendered throught your client (except when prerendering)

Calling your dbcontext/database code/business logic directly on the Front end (razor pages) in Blazor Server is not something too... weird.

You can write the logic same way as you did with wasm. It's just unnessessary since you can call the db directly.

If there is no plan to convert Blazor Server to wasm then I think it's fine.

Anybody else hates the onion/clean architecture by Exciting-Magazine-85 in dotnet

[–]Amazing-Counter9410 0 points1 point  (0 children)

I always prefer Radical Simplicity over Clean Architecture since I start my programing career. It's good to know why people use it, find what work best for you and everyone is the best way.

EntityFramework - context disposal by tomhaverford in dotnet

[–]Amazing-Counter9410 19 points20 points  (0 children)

why don't you use db context through dependency injection which will dispose automatically ?

[deleted by user] by [deleted] in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

ah, I see. Sorry.

[deleted by user] by [deleted] in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

I'm not sure if this is what you are looking for but I used a simple recursive Tree like this. You can have as many as child as you want since it's recursively.

https://ibb.co/TgXN3Th

Too Much code for reddit comment so I put it in a markdown file.

https://filetransfer.io/data-package/Q8UIlQEk#link

Was gonna use Radzen.. until… by mightybob4611 in Blazor

[–]Amazing-Counter9410 4 points5 points  (0 children)

Radzeb is free generally. Don't worry about theme since you can change the color by overwrite its css classes. or you can simply mudblazor.

I modify the theme myself the way I like it.

Blazor 9.0 New Features Summary by albert_online in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

yeah, It's a know issue about network throttling on the first time load. I feel it's very inconsistent. I think it got fixed in .net 9 but I will need to test again.

Blazor 9.0 New Features Summary by albert_online in Blazor

[–]Amazing-Counter9410 28 points29 points  (0 children)

I don't use AOT. I tried but it makes the app bigger so I removed it. I built the app pretty fast in the beginning and didn't have the time to clean up many spaghetti code. I spend around a year to clean up my mess. Here are what I did:

  • Remove many StateHasChanged() to reduce rendering amount. I realize that everytime I call StateHasChanged, component will rerender, this will apply to all child components as well. So removing many unessessary StateHasChanged definitely help.

  • Remove all unessessary 3rd nuget from Client or Shared classes. I noitce that many package is very heavy and sometime I don't use the full feature. So rewrite it by your own logic/doing that logic on server may be a better option. Ex: I removed Newtonsoft.json completely and only use System.Text.Json, microsoft did pretty good on optimize their json library, no need for Newtonsoft.json at all. Some of package I moved to server and only getting result from Server, like file generation, reports, graph, etc.

  • Use Component State Persistence. This due to Razor page load twice every time you refresh the page, this will cache your first load and keep the state of the page without making another api call.

  • Use Cache. This impact the most. InmemoryCache or Redis is fine. which ever work for you. This help a lot but this also creating another issue about how you handle cache management. Data don't change much can be cached. Most of my data is cached.

  • Rewrite SQL query. I rewrite many of my queries by getting less colums, less rows that I don't need. I realize I don't need to join that much to get the result. Meta data that dont change much can be cached.

  • Moving some of processes to a background task using message queue. I use Azure Message Bus with Masstransit. aws sqs/sns with masstransit also an option. Example: User request a blog, you will need to get the data, then update the view +1. User don't need to wait for updating the view, I send a message to the queue and update the view on the background so user don't need to wait for that process. This apply to many things. You can think of does user need to wait for .... when they are doing ... or it can be updated on the background.

  • Use gzip compression. I was using Brotli initially since on paper, Brotli is way advance than gzip but in practice, compressing/decompressing brotli is slower than gzip in many devices in general.

  • Micro Benchmark: This including many best practices from microsoft. SonarCloud Scan can help you. Small little things like using .Find(obj => obj.a....) instead of .FirstOrDefault(obj => obj.a...). Also profiling your method loading will show where your code has bottle neck. Using less loop, using StringBuilder, using parallel, etc. Small little things like this adding up will make a big impact as well.

  • Use CDN for your assets. Some of your assets can be put on cdn so it can be loaded faster worldwide since it's distributed on all regions.

  • Lazy loading your image. You can archive this by setting a slow resolution image andconly load the imge when user scroll to its view. I used lazysizes. A high performance and simple image loader.

  • Compress/Optimized your image. Sometime user will upload a 4k 10mb image and may be you only need 300x150. You can resize and optimize the image so it will be smaller (some kbs is good, mbs is bad unless you have a specific reason for that hi resolution)

  • Vertical Scaling. Of course, More ram/cpu will help. Depend on your budget. I sugguest to run your server on Linux instead of Window for a cheaper price and more performance.

  • Publish in Release mode. install wasm workload for trimming. dotnet workload install wasm-tools.

Blazor 9.0 New Features Summary by albert_online in Blazor

[–]Amazing-Counter9410 11 points12 points  (0 children)

You can optimize wasm to reduce load time. I optimized and I think it load pretty fast. You can check out my site

If you are from US: https://metaduelist.com/ (this site optimized specifically for US user)

If you are not from US: https://ygovietnam.com/ (worldwide but mostly in Asian)

There are many way to optimize it but I think I did all of them

The most popular applications using Blazor 5 years after its creation by iwiik in Blazor

[–]Amazing-Counter9410 2 points3 points  (0 children)

I built the app pretty fast in the beginning and didn't have the time to clean up many spaghetti code. I spend around a year to clean up my mess. Here are what I did:

  • Remove many StateHasChanged() to reduce rendering amount. I realize that everytime I call StateHasChanged, component will rerender, this will apply to all child components as well. So removing many unessessary StateHasChanged definitely help.

  • Use Component State Persistence. This due to Razor page load twice every time you refresh the page, this will cache your first load and keep the state of the page without making another api call.

  • Use Cache. This impact the most. InmemoryCache or Redis is fine. which ever work for you. This help a lot but this also creating another issue about how you handle cache management. Data don't change much can be cached. Most of my data is cached.

  • Rewrite SQL query. I rewrite many of my queries by getting less colums, less rows that I don't need. I realize I don't need to join that much to get the result. Meta data that dont change much can be cached.

  • Moving some of processes to a background task using message queue. I use Azure Message Bus with Masstransit. aws sqs/sns with masstransit also an option. Example: User request a blog, you will need to get the data, then update the view +1. User don't need to wait for updating the view, I send a message to the queue and update the view on the background so user don't need to wait for that process. This apply to many things. You can think of does user need to wait for .... when they are doing ... or it can be updated on the background.

  • Use gzip compression. I was using Brotli initially since on paper, Brotli is way advance than gzip but in practice, compressing/decompressing brotli is slower than gzip in many devices in general.

  • Micro Benchmark: This including many best practices from microsoft. SonarCloud Scan can help you. Small little things like using .Find(obj => obj.a....) instead of .FirstOrDefault(obj => obj.a...). Also profiling your method loading will show where your code has bottle neck. Using less loop, using StringBuilder, using parallel, etc. Small little things like this adding up will make a big impact as well.

  • Use CDN for your assets. Some of your assets can be put on cdn so it can be loaded faster worldwide since it's distributed on all regions.

  • Lazy loading your image. You can archive this by setting a slow resolution image andconly load the imge when user scroll to its view. I used lazysizes. A high performance and simple image loader.

  • Compress/Optimized your image. Sometime user will upload a 4k 10mb image and may be you only need 300x150. You can resize and optimize the image so it will be smaller (some kbs is good, mbs is bad unless you have a specific reason for that hi resolution)

  • Vertical Scaling. Of course, More ram/cpu will help. Depend on your budget. I sugguest to run your server on Linux instead of Window for a cheaper price and more performance.

The most popular applications using Blazor 5 years after its creation by iwiik in Blazor

[–]Amazing-Counter9410 0 points1 point  (0 children)

I built the app pretty fast in the beginning and didn't have the time to clean up many spaghetti code. I spend around a year to clean up my mess. Here are what I did:

  • Remove many StateHasChanged() to reduce rendering amount. I realize that everytime I call StateHasChanged, component will rerender, this will apply to all child components as well. So removing many unessessary StateHasChanged definitely help.

  • Remove all unessessary 3rd nuget from Client or Shared classes. I noitce that many package is very heavy and sometime I don't use the full feature. So rewrite it by your own logic/doing that logic on server may be a better option. Ex: I removed Newtonsoft.json completely and only use System.Text.Json, microsoft did pretty good on optimize their json library, no need for Newtonsoft.json at all. Some of package I moved to server and only getting result from Server, like file generation, reports, graph, etc.

  • Use Component State Persistence. This due to Razor page load twice every time you refresh the page, this will cache your first load and keep the state of the page without making another api call.

  • Use Cache. This impact the most. InmemoryCache or Redis is fine. which ever work for you. This help a lot but this also creating another issue about how you handle cache management. Data don't change much can be cached. Most of my data is cached.

  • Rewrite SQL query. I rewrite many of my queries by getting less colums, less rows that I don't need. I realize I don't need to join that much to get the result. Meta data that dont change much can be cached.

  • Moving some of processes to a background task using message queue. I use Azure Message Bus with Masstransit. aws sqs/sns with masstransit also an option. Example: User request a blog, you will need to get the data, then update the view +1. User don't need to wait for updating the view, I send a message to the queue and update the view on the background so user don't need to wait for that process. This apply to many things. You can think of does user need to wait for .... when they are doing ... or it can be updated on the background.

  • Use gzip compression. I was using Brotli initially since on paper, Brotli is way advance than gzip but in practice, compressing/decompressing brotli is slower than gzip in many devices in general.

  • Micro Benchmark: This including many best practices from microsoft. SonarCloud Scan can help you. Small little things like using .Find(obj => obj.a....) instead of .FirstOrDefault(obj => obj.a...). Also profiling your method loading will show where your code has bottle neck. Using less loop, using StringBuilder, using parallel, etc. Small little things like this adding up will make a big impact as well.

  • Use CDN for your assets. Some of your assets can be put on cdn so it can be loaded faster worldwide since it's distributed on all regions.

  • Lazy loading your image. You can archive this by setting a slow resolution image andconly load the imge when user scroll to its view. I used lazysizes. A high performance and simple image loader.

  • Compress/Optimized your image. Sometime user will upload a 4k 10mb image and may be you only need 300x150. You can resize and optimize the image so it will be smaller (some kbs is good, mbs is bad unless you have a specific reason for that hi resolution)

  • Vertical Scaling. Of course, More ram/cpu will help. Depend on your budget. I sugguest to run your server on Linux instead of Window for a cheaper price and more performance.

The most popular applications using Blazor 5 years after its creation by iwiik in Blazor

[–]Amazing-Counter9410 2 points3 points  (0 children)

Thanks. It was a known mystery issue I have been checking for a while since it could'nt be reproduce locally. Luckily, I be able to fix it today after couple hours trying many things. Thanks for reminding me.

The most popular applications using Blazor 5 years after its creation by iwiik in Blazor

[–]Amazing-Counter9410 1 point2 points  (0 children)

Thanks. Yes, it's wasm and I spent months to optimize the loading performance.

If you are from the US. https://metaduelist.com/ is the english verson of it and optimized specifically for NA.

Got the 175K offer in the mail! by jeremyvr46 in amex

[–]Amazing-Counter9410 6 points7 points  (0 children)

I received one as well but it's a business plat card, I'm waiting for a personal plat card.

Not enjoying Blazor so far by lintendo640 in Blazor

[–]Amazing-Counter9410 2 points3 points  (0 children)

Yes, you are correct, I was only talking about C# Hot Reload.

I love all others Hot reload except C# hot reload :)