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

[Fix] Improved loading #700

Merged
merged 7 commits into from
Aug 2, 2023
Merged

[Fix] Improved loading #700

merged 7 commits into from
Aug 2, 2023

Conversation

onetrickwolf
Copy link
Collaborator

Motivation

Resolves #681

Sets some ground work for #693: context provider added to ensure app doesn't load until worker is done initializing; this context can eventually be used for worker management (and maybe eventually moved to the TS SDK).

This issue will be iterated on in #693 and #596. This PR is just meant to be a quick fix to resolve the app not loading in some conditions.

Test Plan

Functionality should be identical but app shouldn't need a refresh on mobile or slow connections. Should see spinner while initial assets are loading.

Preview link: https://improved-loading--aleo-tools-3481ab.netlify.app/

@onetrickwolf onetrickwolf marked this pull request as ready for review August 1, 2023 22:04
Copy link
Collaborator

@iamalwaysuncomfortable iamalwaysuncomfortable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, but otherwise great. Quick question though: does this remove wasm loading until after the react components load?

website/src/workers/worker.js Outdated Show resolved Hide resolved
Co-authored-by: Mike Turner <mturner@aleo.org>
Signed-off-by: Brent C <brent.conn@gmail.com>
@onetrickwolf
Copy link
Collaborator Author

One small nit, but otherwise great. Quick question though: does this remove wasm loading until after the react components load?

@iamalwaysuncomfortable No it doesn't the worker still triggers the wasm download before the react components mount so it's no slower to download. The main difference here is just that we are waiting until the worker is ready (i.e. for the wasm to download) before we allow the app to render the main route.

It's kind of a quick hack but it should fix the slow connection white screen which seems to be caused by the app rendering before the wasm is done initiating. In future issues/as part of some of the SDK improvements I have some ideas for properly managing the worker and the wasm to make it easier to navigate and optimal for render speed.

@onetrickwolf
Copy link
Collaborator Author

Also want to mention for reference we had an issue where the wasm was being initiated and downloaded twice before:
image

After:

image

In simulated slow connections this seems to double the wasm load speed.

Throttle profile for reference:
image

@onetrickwolf onetrickwolf merged commit 955697d into testnet3 Aug 2, 2023
4 of 5 checks passed
@onetrickwolf onetrickwolf deleted the feat/better-loading branch August 2, 2023 20:03
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.

[Bug] Aleo.tools fails to load on mobile or slow connections sometimes
2 participants