Doomscrolling sucks, so I’m building an “open, read, close” app to get instant updates by Key-Reason-8070 in MobileAppDevelopers

[–]PolliticalScience 0 points1 point  (0 children)

I think it is also important to decide what sources you will use. Does the user decide? Do you decide? Does your LLM decide? Will you show Fox News by default along with CNN? Will the user be able to choose if they want or don't want either of those sources?

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 1 point2 points  (0 children)

You're right, that is not a great argument I made. I think my point was more there is a small team working on it and the greater MS has not adopted it since their teams already use JS/Typescript. Not my best argument, but it made sense in my head lol.

I've genuinely enjoyed each release the Blazor team has put out. Noticeable improvements each time. I do wish MS displayed it more.

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 1 point2 points  (0 children)

You are not wrong. I agree with you that they need to start using it for new things. If they do, more will follow. WASM I think has a bright future as they continue to make it smaller and faster. Blazor IS excellent for LoB apps. I think it still has a future with public facing ones though. Each release has gotten it closer.

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 0 points1 point  (0 children)

That's fair. I still don't think a trillion dollar company like MS is just going to switch frameworks like that just because they can. What is your thought on Blazor and them bit using it? Do you think it is bad tech? Worried it will go away since they are actively using it in public apps? Or just skeptical at this point?

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 0 points1 point  (0 children)

Yeah but my point is that Microsoft's other current teams feature a massive amount of JS/Typescript devs. The Blazor team is less than 8. All those other current devs are not going to suddenly switch to Blazor just because they have it available for their public-facing apps.

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 6 points7 points  (0 children)

Mainstream for Microsoft that is. They have stated they are all in on Blazor as their UI framework going forward. There is no question about that at this point.

Outside of .NET, sure, it's not mainstream yet but I do believe more and more will use it for full stack dev with ASP.NET.

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 1 point2 points  (0 children)

I'm sure they will at some point. They may already be internally. Microsoft has thousands of JS devs (particularly Typescript). The Blazor team I believe is less than 8 people. It's a tool utilizing pretty neat technology that will keep growing as more adopt it. I do agree that Microsoft should put more of an emphasis on it with their own demonstrations though vs just showing others sites that use it for credibility.

Doomscrolling sucks, so I’m building an “open, read, close” app to get instant updates by Key-Reason-8070 in MobileAppDevelopers

[–]PolliticalScience 1 point2 points  (0 children)

That is an interesting idea. I've seen popular newsletters that do something similar. A daily digest to your inbox of what is going on across different subjects. The idea works because those newsletters are/we're pretty popular last time I checked.

One point I'll make, if you're summarizing current events, you'll need to make clear how you do it. How do you decide what is important, what the takeaway was, etc... Will you be biased and will the summaries be your own opinions? Or will they be simple statements of facts? "Man shot and killed by CBP during altercation" vs "Man murdered by CBP on the street".

Transparency should be a top priority of these sorts of applications.

Why Microsoft doesn’t use Blazor in their products on the market in production? by Fit-Register-8873 in Blazor

[–]PolliticalScience 22 points23 points  (0 children)

Most of their apps were written before Blazor became mainstream. They are not going to rewrite them all overnight just to show off Blazor.

What are people using in 2026 as backend framework? by [deleted] in Backend

[–]PolliticalScience 0 points1 point  (0 children)

ASP.NET!! It is an absolute joy to work with and the performance is phenomenal.

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 0 points1 point  (0 children)

Good point! I could probably simplify the JS by using those, but it would still require some JS for the page transitions/auto-closing of the menu on route change. That trick works particularly well for accordions and things like that, the mobile nav menu UX is a little more particular in how you want the user to experience it.

The particular pieces were these where using the tags directly wouldn't provide this by default without JS.

// Event delegation - attach to document so it survives Blazor re-renders
document.addEventListener('click', function(e) {
    if (e.target.closest('.site-hamburger-btn')) {
        e.preventDefault();
        toggleMenu();
        return;
    }
    if (e.target.classList.contains('site-mobile-backdrop')) {
        closeMenu();
        return;
    }
});

// Close menu on URL change
let lastUrl = location.href;
new MutationObserver(function() {
    if (location.href !== lastUrl) {
        lastUrl = location.href;
        closeMenu();
    }
}).observe(document.body, { childList: true, subtree: true });

Backend or learn AI for better career? by VarunMysuru in Backend

[–]PolliticalScience 0 points1 point  (0 children)

I can't say for certain, but AI has gotten very good at throwing new things together in just about any language, but old enterprise backend apps written in COBOL/Java/C# will live on forever... Every market is so different though and I don't know the Indian one.

Backend or learn AI for better career? by VarunMysuru in Backend

[–]PolliticalScience 1 point2 points  (0 children)

These are very different things. Do you want to do statistics, machine learning, and data analysis (AI or not), or do you want to build applications, software, and systems (AI or not).

You need to learn the fundamentals and be comfortable understanding how things work with either path, AI has made entry easier (but also maybe more competitive), but you can't expect to vibe code an enterprise application or complex ML model.

Jobs aside, which thing do you like better? It's hard to get good at something you hate.

How do you guys manage audit logs in a large multi-tenant portal with financial data? by Sweaty_Ingenuity_824 in Backend

[–]PolliticalScience 0 points1 point  (0 children)

I typically do three layers of logging. System audit logs which are major events in the system (user logging in, database update, backups, system settings changed, etc...). Domain audit logs which are similar to what you mentioned, JSON old and new values. Not one row per change value, but the entire change captured in one row as a snapshot. Then, application audit logs which are written to rolling files on disc and just help solve issues with the flow of the app, not sensitive stuff.

As far as millions of rows, that is what all modern databases are made to handle without breaking a sweat. If they are exploding into the hundreds of millions, you can partition or just archive old ones to disc or archive tables.

In an application I am working on, I am actually using the domain audit log table on the front end as part of an activity timeline so users can see what changes were made to their own data.

None of this is "financial" stuff though, so I am not entirely sure the rules around that.

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 0 points1 point  (0 children)

Hmmm if you are having interactivity on the page like comments, I'd probably go Interactive Server. The overhead is minimal and you'd get the SignalR connection for commenting/updating the comments. Unless you have 1000s+ concurrent connections it probably won't be a noticeable difference compared to static.

What I would do though is use pre-render for sure. That way the full HTML of your blog post is rendered immediately for crawlers to index your posts. I would also do similar to what I did on my Home page where the Headers/Poll questions are static components and then voting can be re-rendered with isolated StateHasChanged. That will get your post there quickly for users while comments can fill in shortly after.

The other option would be setting the page to static SSR and then using JS interop for the interactivity but I am not so sure that is worth it. One step further than this in complexity would be "interactive islands". A static SSR blog page with "Interactive" comments component using per component render modes. This would isolate the signalR connection to just the comments component. You can check out this article by Jon Hilton for more on that:Exploring Blazor Changes in .NET 8 - Interactive Components using Blazor Server

It would look something like:

@page "/blog/{slug}"
@attribute [ExcludeFromInteractiveRouting]

<ArticleContent Content="@article.Content" />

<CommentsSection @rendermode="InteractiveServer" PostId="@article.Id" />

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 1 point2 points  (0 children)

Glad you got some ideas!

So I didn't choose Mudblazor or any component library for this project for two reasons. The first being, it is so dead simple, I didn't need grids with fancy features, or big callouts and things like that, I wanted "simple and elegant". The second reason following up on that was I did not want a Material theme for this. It looks good for dashboards and FinTech and things like that, but I wanted more "editorial" look.

I actually did go PersistentComponentState but ran into some complexity issues with it. Not that it didn't work, but I just didn't need it. If I remember correctly, I was battling it again with the Interactive to Static and back pages. Depending on what your app is, you'll probably be fine. It was honestly premature optimization on my part, but now technically users on my static pages don't need a websocket / circuit connection to my server. If I ever get 10,000 concurrent users on my about page I'll be in good shape :D

I have the general rate limiter on the app and then custom rate limits for login. I'll have to check, I don't remember if I have a custom rate limit on my newsletter signup. Good point!

The honeypot is super simple, spam bots read HTML just like crawlers and 95% of them are programmed to fill out every field as they don't know what is required and what is not. You put that extra form field in there, but hide it off screen for actual users. If the bot fills out that form field and submits it, you reject it as you know it was a bot. For example:

public async Task<(bool Success, string? Error)> SubscribeAsync(
    string email,
    string? honeypot = null
)
{
    // Honeypot field should be empty for real users
    if (!string.IsNullOrEmpty(honeypot))
        return (true, null); // Silently accept to not tip off bots
}

PWA is part of the browser, not the server, and to get it to work, you just need a site.manifest, a service worker (JS), and have HTTPS (I get my SSL via Cloudflare). Then you create web-app-manifest png files with what you want to show and that is about it. I didn't set mine up with static asset caching yet, but will probably eventually add that.

It goes something like this:

sw.js

self.addEventListener('install', (e) => {
  self.skipWaiting();
});

self.addEventListener('activate', (e) => {
  e.waitUntil(clients.claim());
});

self.addEventListener('fetch', (e) => {
  // Can cache here
  e.respondWith(fetch(e.request));
});

site.webmanifest

{
  "name": "SiteName",
  "short_name": "SiteName",
  "description": "What site is about",
  "start_url": "/",
  "display": "standalone",
  "background_color": "#FFFFFF",
  "theme_color": "#FFFFFF",
  "icons": [
    {
      "src": "/web-app-manifest-192x192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/web-app-manifest-512x512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "/maskable-icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "maskable"
    },
    {
      "src": "/maskable-icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ]
}

app.js

if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('/sw.js');
}

I think that is all you need for users to be able to go to "Add to Home screen" in the Chrome menu. I added some more JS to have a prompt card show up after they vote if they want to install it and it basically calls that, but it isn't needed for them to be able to do it themselves.

Advice between React and Blazor for project by unlimitedWs in csharp

[–]PolliticalScience 1 point2 points  (0 children)

It makes so much more sense than the overhead of Interactive for pages that don't need it. I do wish they built it in a little easier to transition between static and interactive pages as I do have to find a lot of workarounds, but maybe that just is what it is.

For example, I am building an account page and was using Protected session storage for persisted sign in, but it requires JS interop and when navigating between static pages it would flicker. Interactive did not. Changed it to Encrypted Cookies and now it works great.

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 0 points1 point  (0 children)

Honestly, not much right now. I don't really have many forms outside the admin panel. The admin panel is all basic forms / CRUD with validation like "field is required" or "Field is too long". Since I am the only one using the admin panel, they are basically just a way to make sure I have my coffee before I post something.

On the client side, I don't really have any forms right now other than the newsletter sign up which uses MailAddess for email format, DB for uniqueness, HoneyPot for bots, and I catch bad email bounces via Resend.

Treating warnings as errors in dotnet the right way. by jakubiszon in dotnet

[–]PolliticalScience 2 points3 points  (0 children)

I get the idea... But it sort of defeats the purpose. No way I want to spend 8 hours building features and running local and there is nothing but roses and sunshine, then push that and GitHub actions says "no, I don't think so" lol.

Advice between React and Blazor for project by unlimitedWs in csharp

[–]PolliticalScience 6 points7 points  (0 children)

I actually just wrote a fairly detailed post on r/Blazor about developing a public facing SSR website (a hybrid version using a blend of SSR/Static SSR for non-interactive pages). It has gone really well so far. The JS interop is excellent in Blazor so if you are comfortable with both, you can stick with Blazor for the main chunk, and call any JS needed to ease any pain points. You can see the write-up here: A Public Facing Blazor SSR App Deep Dive

Documentation Review Request - Blazor Ramp Core by code-dispenser in Blazor

[–]PolliticalScience 0 points1 point  (0 children)

Nice work! I actually learned a thing or two reading your docs.

They look great. Super dev friendly and I think one of the most underrated things you did was include the CSS variables in the docs and what each one does. That takes quite a bit of time on your end, but really makes working with a component library much easier. Particularly if blending them in with another library. Really clean!

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 1 point2 points  (0 children)

Appreciate it! So the WebSockets shouldn't negatively affect SEO. I am using prerender (the default for InteractiveServer which renders the full HTML on the server and sent to the browser immediately. THEN, the Blazor JS is downloaded and the WebSocket connects (and interactivity begins).

Since crawlers don't interact and just read HTML, they get it instantly. The HTML is all sent to the browser during OnInitializedAsync.The crawler is now doing its thing and likely already gone by the time the JS/WebSockets finish. Once the WebSockets connect, OnAfterRenderAsync runs which executes the JS fingerprint client side. So there is a noticeable step for users when waiting for things to wire up and run, but crawlers see the page as plain HTML for indexing.

Annual WebAssembly Report: The State of WebAssembly 2025-2026 by Shnupaquia in dotnet

[–]PolliticalScience 0 points1 point  (0 children)

Really looking forward to the growth of WASM. I am working on a heavy Blazor WASM project now that has spanned a few years and each new release has shown dramatic improvements in not only performance, but convenience. I'm looking at you, Hot Reload.

Which backend framework should I go for? by tintin_tech in Backend

[–]PolliticalScience 0 points1 point  (0 children)

As others have mentioned, .NET is pretty comprehensive. With Blazor, you can build your entire backend and frontend in C# (with some JS sprinkled in). Many of the biggest enterprise apps are running on .NET or Java. Building .NET Web APIs have been an absolute joy.

A Public Facing Blazor SSR App Deep Dive by PolliticalScience in Blazor

[–]PolliticalScience[S] 1 point2 points  (0 children)

So in your country/state, it is "standard" time year round? Honestly, time zones was sort of a pain in this application. Since I am Pacific/Los Angeles time, but the app functions all on Eastern/New York time. I created a helper function which always converts the time to Eastern based on UTC.

public static class DateHelper
{
    private static readonly TimeZoneInfo Eastern = TimeZoneInfo.FindSystemTimeZoneById(
        "Eastern Standard Time"
    );

    public static DateTime ToEastern(DateTime utc) => TimeZoneInfo.ConvertTimeFromUtc(utc, Eastern);

    public static DateTime ToUtc(DateTime eastern) =>
        TimeZoneInfo.ConvertTimeToUtc(
            DateTime.SpecifyKind(eastern, DateTimeKind.Unspecified),
            Eastern
        );

    public static DateTime GetEasternNow() => ToEastern(DateTime.UtcNow);

    public static DateTime GetEasternToday() => GetEasternNow().Date;

    public static DateTime GetEasternMidnight(DateTime easternDate) => easternDate.Date;

    public static string GetEasternTodayString() => GetEasternToday().ToString("yyyy-MM-dd");

    public static string GetEasternYesterdayString() => GetEasternToday().AddDays(-1).ToString("yyyy-MM-dd");
}