File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2828 <Routes @rendermode =" @(new InteractiveServerRenderMode(prerender: false))" />
2929 <script src =" _framework/blazor.web.js" ></script >
3030 <script src =" js/app.js" ></script >
31+
32+ @*
33+ Directly reference theme and dependencies from HTML so they load quickly.
34+ It's much faster to load them here than wait for module load from Blazor interop.
35+ Load time is important here because the theme should be applied ASAP.
36+ *@
37+ <script src =" js/app-theme.js" type =" module" ></script >
38+ <script src =" _content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type =" module" ></script >
3139</body >
3240</html >
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
4040 {
4141 if ( firstRender )
4242 {
43- _jsModule = await JS . InvokeAsync < IJSObjectReference > ( "import" , "/js/theme.js" ) ;
43+ _jsModule = await JS . InvokeAsync < IJSObjectReference > ( "import" , "/js/app- theme.js" ) ;
4444 _currentSetting = await _jsModule . InvokeAsync < string > ( "getThemeCookieValue" ) ;
4545 StateHasChanged ( ) ;
4646 }
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
113113 {
114114 if ( firstRender )
115115 {
116- _jsModule = await JS . InvokeAsync < IJSObjectReference > ( "import" , "/js/theme.js" ) ;
116+ _jsModule = await JS . InvokeAsync < IJSObjectReference > ( "import" , "/js/app- theme.js" ) ;
117117 _shortcutManagerReference = DotNetObjectReference . Create ( ShortcutManager ) ;
118118 _keyboardHandlers = await JS . InvokeAsync < IJSObjectReference > ( "window.registerGlobalKeydownListener" , _shortcutManagerReference ) ;
119119 ShortcutManager . AddGlobalKeydownListener ( this ) ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments