johnstorey, to dotnet

In my continual descent into the world of #DotNet I am looking to create a web app with #HTMX. Is Razor really my best choice in this ecosystem? I was hoping to leverage my Jinja knowldege, but can't seem to find a good Jinja solution for .NET.

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@TimPurdum @flensrocker @johnstorey Here’s the project for integration: https://github.com/khalidabuhakmeh/Htmx.Net

I also have a link to a tutorial series in the Readme I did for if you are interested

khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

Using to reimplement the Counter example that ships with the template. Can you tell which one is using WebSockets and which one isn't?

Counter examples in blazor incrementing a count.

khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

, after 5 years, still only sees 16% of usage in the crowd.

It supports my assumption that putting all the eggs in the Blazor basket might hurt overall ASP.NET Core adoption with folks looking for familiar paradigms like MVC or HTML.

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

This statistic is a bit scary. 56% of users are working with ASP.NET Core. That seems like it's down.

https://www.jetbrains.com/lp/devecosystem-2023/csharp/

anthonygiretti, to dotnet

Hey what is this? 😉😉😉

khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

Anyone wanting to see how to integrate and can check out this repo. There are not a lot of steps, but I can see this being useful for folks who want to avoid almost all JavaScript.

Cheers 🍻

https://github.com/khalidabuhakmeh/BlazorHtmx

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

I don’t know who wants this, but this is #HTMX in a Blazor Server App, invoking an endpoint that returns a Server-Rendered Blazor component.

cc @alexzeitler

#dotnet #aspnetcore #web #development

Blazor and HTMX

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

I don’t know if this is new, but lets you extract route templates from your MVC controllers. Pretty cool.

Refactor route template in MVC Controller with JetBrains Rider

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

Adding support to my library was surprisingly easy with the latest EAP release. Even forwards the ports of my sample project.

khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

Here’s a sample of using IAsyncEnumerable with server rendering. You can't use the method directly, but you have to invoke and change the state within a lifetime event like OnInitializedAsync and be sure to call StateHasChanged.

Then, you get the result you see below.

Blazor Server rendering with IAsyncLifetime

khalidabuhakmeh, (edited ) to blazor
@khalidabuhakmeh@mastodon.social avatar

Update: It does work. See the second screenshot.

—-

So, I’m exploring server streaming, but I realize that doesn't support IAsyncEnumerable (so far that I've found).

This means that while streaming the rendered results is async, you still have to have all the data at the time of rendering. A slow dependency can still affect your Time to first byte (TTFB). :\

This feature improves the UI layer but not necessarily the backend layer.

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

I wrote This neat demo to demonstrate support for streaming JSON results via IAsyncEnumerable. This allows the client to use data as it gets transmitted rather than waiting for ALL OF IT.

Showing a stream of JSON over the wire via ASP.NET Core

damienbod, to dotnet
tomasekeli, to blazor

is actually used by anything that has more than personal-website levels of visitors?

khalidabuhakmeh, to webassembly
@khalidabuhakmeh@mastodon.social avatar
khalidabuhakmeh, (edited ) to dotnet
@khalidabuhakmeh@mastodon.social avatar

So I got my Razor Pages demo working with boost concept and view transitions. And with a few lines of CSS and no backend changes, I get this sweet transition animation. What do you think, folks?

jamesmontemagno, to dotnet
@jamesmontemagno@mastodon.social avatar

We just launched some brand new Microsoft Learn Training modules for building cloud native apps with .NET. You can do them all for FREE from the browser with nothing to install! I show you how:

https://www.youtube.com/watch?v=kB7oWHmuWN8

#dotnet #cloudnative #aspnetcore #microsoftlearn #codespaces

khalidabuhakmeh, to test
@khalidabuhakmeh@mastodon.social avatar

Have you ever wondered how to your applications? Join me and Scott Sauber today, where he presents his approach to doing just that!

The chat is always lively and fun, so please bring questions. I'd love to see you there. Cheers :)

https://www.youtube.com/watch?v=aWY7R7Egm70

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

Did someone say “View Transitions with and ”?

View transitions on an HTMX ASP.NET Core application

khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

If folks are doing development on . You'll need a browser that supports Chrome Developer Protocol. If you don't want to install Chrome, then Chromium is a good option.

Be sure to update the "Chrome" option in your settings to point to chromium. It should just work.

Debugging Blazor in Chromium

jonhilton, to blazor

A visual tweak goes a long way…

You can declare methods in your components that return CSS class names.

That way you can tweak the appearance of your component based on data and/or parameters.

https://jonhilton.net/tips/blazor/020-dynamic-css-classes/
https://jonhilton.net/tips/blazor/020-dynamic-css-classes/

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@jonhilton Yeah, tbh. It’s a bummer to see Razor come so far with MVC and Razor Pages, just to take a step back and reinvent some of the same things but for Blazor.

Blazor is “fine”, but it comes at the expense of lost momentum and reinventing-the-wheel syndrome.

I liked that had these paradigms that worked together, but Blazor seems to have taken a "eat the world" approach that is a step backwards.

poppastring, to dotnet
@poppastring@dotnet.social avatar
khalidabuhakmeh, to blazor
@khalidabuhakmeh@mastodon.social avatar

I’m using the dispose pattern in a sample to mark whether I'm busy or not busy doing work (like calling the database).

A using statement that sets the current working state.

khalidabuhakmeh, to javascript
@khalidabuhakmeh@mastodon.social avatar

I’d just like to point out to folks that offers the same experience. 😅

andrewlock, to dotnet
@andrewlock@hachyderm.io avatar

Blogged: Short-circuit routing in .NET 8 - Exploring the .NET 8 preview - Part 11

https://andrewlock.net/exploring-the-dotnet-8-preview-short-circuit-routing/

In this post I describe the new short-circuit routing feature, how it differs from normal routing, discuss why it's useful, and look at how it's implemented.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines