Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side pre-rendering for Blazor UI #5519

Open
hikalkan opened this issue Sep 21, 2020 · 6 comments
Open

Server side pre-rendering for Blazor UI #5519

hikalkan opened this issue Sep 21, 2020 · 6 comments

Comments

@hikalkan
Copy link
Member

I currently don't know if that's possible or how to do. But we should work on that to develop search engine friendly web sites, learn and document best practices on that.

@realZhangChi
Copy link

Any updates?

@Xeevis
Copy link
Contributor

Xeevis commented Apr 17, 2022

I've been experimenting with Blazor WebAssembly prerendering with ABP and it's so much better experience. Slight disadvantage is that you must somehow pause your users from interacting with the page while app is hydrating in the background. Authenticated prerendering isn't officially supported either.

If it's not fully hydrated navigation anchor elements will send requests back to server for more prerendered content defeating purpose and benefits of SPA. I'm convinced simple click blocking transparent CSS overlay with unobtrusive loading bar and working scrollbar does the trick neatly allowing to consume at least some content while waiting for app to fully load.

z7nF1XVTPy

Implementation in ABP should actually be quite simple, changes to existing code are minimal, all we need is extra MVC wrapper like Acme.BookStore.Blazor.Host that will respond to requests with prerendered markup of our existing Blazor app.

I still need to iron some things out like authentication and state preservation to prevent second-render flicker, but I'm hopeful I'll be able to share a working sample repo soon™.

image

@ParsaGachkar
Copy link

any update?

@Xeevis
Copy link
Contributor

Xeevis commented Sep 8, 2022

I've just wrote step-by-step guide on how to achieve basic prerendering with Blazor WebAssembly in ABP 6 (releasing soon). Feel free to give it a try and let me know in comment how it went. ✌

https://community.abp.io/posts/prerendering-blazor-wasm-application-with-abp-6.x-2v8590g3

@Znow
Copy link
Contributor

Znow commented Oct 8, 2022

@Xeevis Good work! Did you manage to get further with this?

@Xeevis
Copy link
Contributor

Xeevis commented Oct 10, 2022

@Xeevis Good work! Did you manage to get further with this?

Hey, thanks @Znow. I have a prototype site I've made like a year ago that has many of the stuff working I just need to bring it over to latest versions and document it. If you have any particular issues you'd like to see solved as a priority, feel free to open separate issues in my repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants