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

Add instructions in README for lazy loading with WebAssemblyPrerendered and preventing a flicker #32

Merged
merged 3 commits into from
Aug 3, 2023

Conversation

biegehydra
Copy link
Contributor

You can see a live example of this at Postman2CSharp. Load the home page then navigate to Upload or Advanced-Settings. You will see a navigating splash screen. However, go to those pages and reload the page and you will see no splash screen.

@jsakamoto
Copy link
Owner

@biegehydra I'm sorry to late!
And, thank you for your contributions!

I'll start to understand the contents of this pull request now and try to merge this contribution in a few days.

@jsakamoto jsakamoto merged commit 4336ec1 into jsakamoto:master Aug 3, 2023
@jsakamoto
Copy link
Owner

@biegehydra Let me say again thank you for your contributions. I've merged this pull request and published a new version, including the updated README.

I never came up with this idea that can avoid flickering at the first loading pre-rendered page that lives in a lazy loading assembly. The instructions that you let us know through the README is really awesome.

And I'm wondering whether you mind if I make the LazyLoader service to be an individual NuGet package under the Open Souce License (MIT or Mozilla Public). I'll really appreciate you if you agree with that my idea.

Again, thank you for your excellent work!👍

@biegehydra
Copy link
Contributor Author

@jsakamoto Yes, go ahead and make a nugget package, that would be amazing. I'm interested in what your strategy will be. I'll be on the look out.

@biegehydra
Copy link
Contributor Author

biegehydra commented Aug 4, 2023

@jsakamoto Word of advice, implement a catch and retry with at least 6 attempts when lazy loading assemblies (I did 10). It will initially error out if you recently uploaded a new version of your website on the first couple of attempts because it will try to load the cached dlls which have the wrong SHA. You can check out the solution on the lazy loader service on my postman2csharp repo. Just a basic catch and retry. Not a very elegant solution, maybe you can think of something better.

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

Successfully merging this pull request may close these issues.

2 participants