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

Blazor Web App - Persist Style & Scripts #19410

Merged
merged 3 commits into from
Mar 25, 2024
Merged

Blazor Web App - Persist Style & Scripts #19410

merged 3 commits into from
Mar 25, 2024

Conversation

enisn
Copy link
Member

@enisn enisn commented Mar 25, 2024

Description

before:
not-persisted-style

after:
persisted-style

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

How to test it?

Please describe how this can be tested by the test engineers if it is not already explicit - or remove this section if no need to description.

@enisn enisn added this to the 8.2-preview milestone Mar 25, 2024
@enisn enisn requested a review from maliming March 25, 2024 07:32
@maliming maliming merged commit c7ff84a into dev Mar 25, 2024
2 of 3 checks passed
@maliming maliming deleted the web-app-enhancements branch March 25, 2024 08:22
@maliming
Copy link
Member

maliming commented Jun 4, 2024

It seems the mvc and blazor js&css both exist on wasm mode after this PR.

This is a problem. @enisn what do you think?

image
image

@maliming
Copy link
Member

maliming commented Jun 4, 2024

We will switch the CSS files for the Blazor server and WASM. This is the reason the page will flash once(Like image 1).

style-initializer.js

loadCssFile("_content/Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme/side-menu/css/abp-bundle.css");
loadCssFile("_content/Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme/side-menu/css/blazor-bundle.css");
loadCssFile("_content/Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme/side-menu/css/bootstrap-dim.css");
loadCssFile('_content/Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme/side-menu/css/layout-bundle.css');
loadCssFile('_content/Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme/side-menu/css/font-bundle.css');

We can add one common lepton CSS file for the server and WASM in the App.razor component. This will prevent the flash problem.

@enisn
Copy link
Member Author

enisn commented Jun 4, 2024

It seems the mvc and blazor js&css both exist on wasm mode after this PR.

This is a problem. @enisn what do you think?

image image

When we remove mvc & blazor server css and add blazor css, it cause a flicker effect. Since we remove and reload entire CSSs. In the lepton, there are no difference in CSS files. No need to remove and reload all of them.

We can add one common lepton CSS file for the server and WASM in the App.razor component. This will prevent the flash problem.

That might be a better solution 👍

@maliming
Copy link
Member

maliming commented Jun 4, 2024

#19970

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

Successfully merging this pull request may close these issues.

2 participants