How to work with the existing project?
Hello @tesar-tech , I want to generate a static site with my project. And it need runing the interactive components on wasm.
The site is : https://github.com/ant-design-blazor/ant-design-blazor/tree/master/site/AntDesign.Docs.Wasm
Thank you.
Hello.
What kind of static site we are talking about? Because typically when you are ok with wasm (its payload), you just do your site in wasm and all the pages there...
I can imagine a need where you have mostly static pages, like Page1, Page2, that are just plain html (which is what BlazorStatic
generates) and then Page3 => boom, wasm kicks i,n payload is downloaded, interactivity secured... Is that what you are looking for?
Thanks for quick reply, please look at the following picture:
I want the green part is static rendering for SEO, and the red part is interactive wasm for showing the demos. This is somehow like blazor interactiev webassembly with prerendering. But I want the prerendering part is using BlazorStatic way.
I understand.
Two steps to take:
- Figure out how to use blazor wasm component inside of an HTML page
- Figure out how to plug it in into BlazorStatic
For the first I think this is the way: https://www.telerik.com/blogs/embed-blazor-components-any-webpage-dotnet-7-official-custom-elements-support
For the second we'll need to adjust the .NET8 SSR to also work with wasm part and then the BlazorStatic should be easy I guess..
Exactly, I think the .NET 8 way is that you don't have to register custom elements.
What do you mean? I have found 0 articles about such change, all the sources are for .NET7...
With .net 8 you can have the wasm part next to server side rendered part. This will fulfill your requirements, but you still need to run a server - no static pages... Question is, if the custom elements will be enough..
Hey @ElderJames, any progress here? Do you need help with BlazorStatic integration?
Yes @tesar-tech ,actually I'm working on a site generator for libraries with source generators and blazor, here is the repo: https://github.com/ElderJames/dim-sum . I need use BlazorStatic to build the document pages is static that user no need to load wasm, but the demo pages can be interactive that user can try the demos on the page.
I learned that BlazorStatic converts blazor sites to htm static pages, but it doesn't work well when I need some interactivity. Even with custom elements, there is development isolation from blazor itself, and the problem can only be solved by implementing an auto rendering mode that does not require a server