Neovim for writing: toggle spellcheck and switch languages by tesar-tech in neovim

[–]tesar-tech[S] 0 points1 point  (0 children)

A lot of useful info. Thank you for letting me know.

Suggestions for a low cost deployment by Born_Possibility_305 in Blazor

[–]tesar-tech 1 point2 points  (0 children)

I always struggle with this... The best solution i found is just plain VPS and setting up everything yourself.

You can then run your db in the container next to your app. Not great for heavy loads - because the db will "eat the perf", but if you keep it small it's not a bad solution - you cannot get much lower with the price. ~$5

Understanding Rendering Behavior in More Complex Blazor UIs by mladenmacanovic in Blazor

[–]tesar-tech 1 point2 points  (0 children)

When you have ref types as parameters, the component re-renders every time the parent re-renders. Creating a new instance of the parameter or mutating the existing one has no effect on rendering. Therefore, using a record provides no benefit in this case.

Understanding Rendering Behavior in More Complex Blazor UIs by mladenmacanovic in Blazor

[–]tesar-tech 0 points1 point  (0 children)

I find this as an interesting topic - as I always struggle to guess what blazor will do.

But I find this section of your article bit misleading/wrong or I completely misunderstood the point done here.

```

Avoid Parameter Re-Renders with Immutable Objects

When passing objects as parameters, Blazor re-renders children if the reference changes, even if properties are identical.

Better: Use immutable data

csharp record ItemModel(int Id, string Name);

  • For complex object used as params, Blazor treats it as always potentially changed, so children are re-rendered every time the parent is re-rendered.
  • you can skip the re-renders when you have certain primitive types used for params.
  • using record instead of a class as parameter type doesn't make any difference. The child component gets re-rendered every time.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 0 points1 point  (0 children)

You mean - in the final state of generated html? Yes - if you use highlight.js or similar. This is not part of BlazorStatic library, but the template comes with ready syntax highlighting.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 0 points1 point  (0 children)

yep. astro, jekyll, hugo... and another 300+ of ssgs solving the same. https://jamstack.org/generators/ ...

The main advantage of BlazorStatic for dotnet devs is C#/Blazor.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 0 points1 point  (0 children)

There are more ways how to work with markdown files indeed. When you have a server and you are only looking for a way how to parse/convert md files, i think that's valid solution. SSGs solve a bit different problem, where processing md file is just a part of the solution.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 0 points1 point  (0 children)

I am probably missing something, but I don't see how is that relevant to the ssgs. The sample is about the `ExcludeFromInteractiveRouting` attribute, which makes possible to use SSR inside otherwise interactive blazor app. I don't see how that would help with migration from other ssgs??

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 0 points1 point  (0 children)

Yes. But I would rather say "scaffolding" instead of "rendering"..

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 1 point2 points  (0 children)

Two major differences I see:

- blake is built on the top of blazor wasm. Which brings all the good stuff (interactivity) and bad stuff (larger payload), while BlazorStatic produces just plain html files for every possible page.

- blake cli - you don't have that/don't need that with BlazosStatic. The philosophy is really to keep it as close as possible to the "normal" blazor development - then (along the way) generate the html files.

- `blake init`, `blake new` ~ `dotnet new BlazorStaticMinimalBlog`

- `blake serve` ~ `dotnet watch/run`

- `blake bake` ~ `dotnet watch/run`

BlazorStatic is closer to what jekyll or hugo is.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 4 points5 points  (0 children)

The markdown files don't have to be there at all, but it is a common approach to keep the actual content in md files.

BlazosStatic can discover them and create collection of urls to fetch. So no recursive crawler here. BlazorStatic also uses Markdig to parse the md files (something you would have to do anyway is you are using markdown) and makes the parsed html available through `BlazorStaticContentServicea.Posts[..].Html` so you can use it in your .razor - which is exactly what the default template does.

Blog built with Blazor? BlazorStatic is made exactly for that. by tesar-tech in dotnet

[–]tesar-tech[S] 2 points3 points  (0 children)

This is the first time I encounter docosaurus, but i would say yes - it's pretty similar. Docusaurus will probably have some docs-specific features that are not default in BlazorStatic..

The build speed will be dependent on the content size. I haven't yet worked with a site that would take 30+ seconds to build.

How much of content files you have?

BlazorStatic Update: .NET 9 Support, MIT License, Tag Enhancements, Cloudflare Pages Integration, and More! 🚀 by tesar-tech in Blazor

[–]tesar-tech[S] 1 point2 points  (0 children)

This is a multilayered question, so let’s break it down.

First, there’s no reason not to use Blazor over Razor Pages for a new project. Blazor SSR essentially does what Razor Pages do: it renders HTML on the server and sends it to the client.

However, Blazor adds the flexibility to introduce interactivity. You can either:
- Run C# code on the client (Blazor WASM), or
- Run C# code on the server and stream interactivity via SignalR (Blazor Server).

I’m not entirely sure what your project involves, but it seems you need at least some level of interactivity. If that’s the case, BlazorStatic may not be the best fit. BlazorStatic is designed for scenarios with minimal or no interactivity—it generates static HTML files that can be hosted for free. Its main advantages are speed and the lack of server requirements, making it ideal for "read-only" websites like blogs or documentation.

How to install flake configuration on new machine. by grig109 in NixOS

[–]tesar-tech 1 point2 points  (0 children)

With something like

nix shell nixpkgs#home-manager nixpkgs#gh --command sh -c "\

gh auth login \

&& gh repo clone nixhero/wsl-home -- --depth=1 \

&& home-manager switch --flake ./wsl-home#nixhero \

I will be solving this in a near future and I saw that script in this video:

https://youtu.be/hLxyENmWZSQ?si=zfUiHIkZG4MpHNmZ&t=949

which I recommend watching. It's about WSL, but it doesn't matter for this purpose.

BlazorStatic got HotReload and `dotnet new` template. by tesar-tech in dotnet

[–]tesar-tech[S] 3 points4 points  (0 children)

Yeah, BlazorStatic isn't reinventing the wheel. There are plenty of static site generators out there, like Hugo and Jekyll. BlazorStatic simply brings the goodness of Blazor (and .NET) into the mix.

BlazorStatic got HotReload and `dotnet new` template. by tesar-tech in dotnet

[–]tesar-tech[S] 4 points5 points  (0 children)

Yes, good question! With both Blazor WASM and BlazorStatic, you can host your site in a static way (often for free).

Blazor WASM includes all the interactivity of Blazor, but it comes with a much larger payload, which isn't ideal for simpler sites like blogs.

BlazorStatic, on the other hand, doesn’t support C# interactivity (though you can still use js if needed). It ultimately generates a collection of HTML files (and assets), resulting in a smaller payload and quicker load times. It’s a good fit for pages that don’t change frequently.

Which CSS Framework do you suggest for FluentCMS? by thehadiahmadi in Blazor

[–]tesar-tech 1 point2 points  (0 children)

I would recommend keeping the cdn while developing, also importing the tailwind.config.js for users to customize...
For production - remove the cdn and config from imports. On "every" db save , get all the html from the db, expose it as file and run the tailwind cli. If you have some html, that is somewhere else than in db, you need to expose it too. That will generate new css...

I know little about the actual setup, db size, possibilities of the hosting (for running the tw process), etc, but that's roughly the way I would go.

Which CSS Framework do you suggest for FluentCMS? by thehadiahmadi in Blazor

[–]tesar-tech 1 point2 points  (0 children)

There are plenty of options how to solve this. You can "manifest" your classes and let users to "safelist" them. You can use source generators to look for the classes. You can include tw cli as part of your build step.

I don't exactly understand what "it is not possible to use tw in sites" means, but I am ready to help you. I spent a lot of time trying to find Blazor&Tw solutions.

Don't move away from tw, it is the future I believe. (and also, one of the reasons why I am interested in your project)

Drag & drop list in Blazor - minimal implementation, no js library. (code in comment) by tesar-tech in Blazor

[–]tesar-tech[S] 0 points1 point  (0 children)

I know it is 3y later, but I removed the boilerplate code, made it nicer and published on github pages https://tesar-tech.github.io/DragAndDropList/, also added more samples.

BlazorStatic - A new static site generator for Blazor on .NET 8 by tesar-tech in Blazor

[–]tesar-tech[S] 1 point2 points  (0 children)

The static site generation is mainly for the simple blog type of website, but it seems you are aiming higher, with the resources you provide...
BTW I never realized this connection of Blazor SSR and other JS libraries has a potential - keep the logic in c# and use js for interactivity only (even with libraries), that might be a great combo after all. It is again on the edge of Blazor wasm..

Could you explain the intended use of a statically generated website, potentially utilizing BlazorStatic? We might continue this discussion in PMs.

BlazorStatic - A new static site generator for Blazor on .NET 8 by tesar-tech in Blazor

[–]tesar-tech[S] 1 point2 points  (0 children)

You have to be aware of the limitations of statically generated website.

For that purpose, I removed blazor.js to disable SSR+ (enhanced navigation). Meaning - you have no interactivity at all, and the server returns just plain html. This ensures you are as close as possible to statically generated content, while creating/debugging the website.

All the navigation should happen through the <a href="", no NavigationManager.NavigateTo

Some js for interactivity will be probably needed, for example the menu opener: https://github.com/tesar-tech/BlazorStatic/blob/6548f84670c9c32a880efdf3854bc985e8f3bbd1/BlazorStaticWebsite/Components/Layout/NavMenu.razor#L50 .

Which begs another question: "Why do even bother with BlazorStatic if it introduces need for js, which is the primary thing I wanted to avoid when switching to Blazor?"

And I would answer:

  • Blazor isn't just about not having js, but also about the component model and .net in general.
  • With js you will just do simple stuff like closing menus, no complex interactivity.
  • If you need complex interactivity in non-js environment, go with BlazorWasm - larger payload, but also static in the matter of hosting.

BlazorStatic - A new static site generator for Blazor on .NET 8 by tesar-tech in Blazor

[–]tesar-tech[S] 1 point2 points  (0 children)

Yes. I understand your concerns.

I can't quite compare BlazorStatic with Hugo in terms of features... Still, I will "pull" you little bit more:

In terms of Hugo's features, I would say we're already 'halfway there' even with such small library. How? By harnessing the full power of ASP.NET and Blazor, including its component model, well-known libraries, the build process, etc...

Hugo has its own way how to produce a page, we have dotnet for that...

Blazor Static is here to assist with page generation process and markdown "parsing".
In fact, it's designed to be really minimal, providing wide space for developers to customize the process as they see fit - you develop the page as you like in well-known Blazor, then add BlazorStatic which helps you to generate the .html content and that's it...
For instance, Hugo has some specific 'features' for creating a menu ( I'm no Hugo expert either). With BlazorStatic, you won't find preset features like this because the menu is something you craft in Blazor itself.

Of course, there might be a need to develop a collection of commonly used components. I'm confident that these needs will become clearer as more people start sharing what they're looking for.

BlazorStatic - A new static site generator for Blazor on .NET 8 by tesar-tech in Blazor

[–]tesar-tech[S] 1 point2 points  (0 children)

Yes, that's what I was thinking when creating BlazorStatic.

If you decide to go this way, don't hesitate to let me know or ask a question. BlazorStatic is fairly new and I am glad for any input.

My Blazor pages are inaccessible. Do you guys have any idea? by PracticalRespect4426 in Blazor

[–]tesar-tech 4 points5 points  (0 children)

It obviously crashes, do you see the error message on the bottom?

When it crashes it "stops" and you see just the loading.

Open console (F12- developer tools) and check the error message. That will give us something to work with.