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

feat!(?): Do not remove loader unless explicitly required #699

Merged
merged 1 commit into from
May 3, 2023

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Mar 30, 2023

This change undoes the Persistent background changes made in #692, because it turns out they are not the crux of the problem.

When the WASM app loads, after the bootstrapper is done, it currently removes the loader (.uno-loader) and then the app itself is initialized. This takes a few hundreds of milliseconds after which Uno itself creates its own "loader" (#uno-loading). Unfortunately, those milliseconds are a problem - as they mean that a plain white background will flash there which is very jarring.

This PR changes the default behavior of the bootstrapper to keep the .uno-loader in place even after initialization is done until some child is actually added to uno-body. This means that it will stay displayed while the actual app is loading, and when it indeed adds its #uno-loading element it should remove bootstrapper's .uno-loader afterwards.

Question for @jeromelaban - is this actually a breaking change? Are there any non-Uno apps which would not add content to .uno-body - resulting in the loader not disappearing?

@MartinZikmund MartinZikmund force-pushed the dev/mazi/keep-loading branch from 209362b to 4ffe146 Compare March 30, 2023 23:04
@MartinZikmund MartinZikmund changed the title feat!: Do not remove loader unless explicitly required feat!(?): Do not remove loader unless explicitly required Mar 31, 2023
@MartinZikmund MartinZikmund self-assigned this Mar 31, 2023
@jeromelaban
Copy link
Member

@MartinZikmund I don't think there are, though we must ensure that the loader actually removes itself when not using uno.ui.

@MartinZikmund
Copy link
Member Author

@jeromelaban Is there any way to check if the app is Uno.UI-based? Alternatively it could be a flag in the manifest like "shouldRemoveLoader" that would be false by default and people could explicitly set it to true when needed.

@jeromelaban jeromelaban reopened this Mar 31, 2023
@jeromelaban
Copy link
Member

@MartinZikmund I've added the PR validation to see the result..

The new behavior has to be opt-in only, and it may be disabled when some flag has been set (optionally by Uno.UI).

@github-actions
Copy link

github-actions bot commented Mar 31, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-699.eastus2.1.azurestaticapps.net

@MartinZikmund
Copy link
Member Author

It seems to work in the sample. The change applies only in case the HTML contains the loader inside of .uno-body, so that could be a good enough safety measure. But we can discuss further next week

@MartinZikmund
Copy link
Member Author

@jeromelaban is this mergeable?

@jeromelaban
Copy link
Member

I think it is!

@jeromelaban jeromelaban merged commit 01d553f into main May 3, 2023
@delete-merged-branch delete-merged-branch bot deleted the dev/mazi/keep-loading branch May 3, 2023 19:01
MartinZikmund added a commit to unoplatform/uno that referenced this pull request May 6, 2023
…RootVisual` background (#11864)

In tandem with unoplatform/Uno.Wasm.Bootstrap#699 this should ensure no flickering of white color will show up on Android, iOS, macOS and WASM. This does not help on Skia yet unfortunately, as there is no splash screen yet.
@MartinZikmund MartinZikmund restored the dev/mazi/keep-loading branch January 8, 2024 21:51
@jeromelaban jeromelaban deleted the dev/mazi/keep-loading branch September 27, 2024 19:17
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