Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Components/WebAssembly/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
<!-- Avoid source build issues with WebAssembly -->
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
</PropertyGroup>

<PropertyGroup>
<WasmBootConfigFileName>dotnet.boot.js</WasmBootConfigFileName>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</head>
<body>
<app>Loading...</app>
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<body>
<app>Loading...</app>
<script src="customJsFileForTests.js"></script>
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>

<!--
Expand All @@ -16,7 +17,7 @@
<script>
Blazor.start({
loadBootResource: function (type, name, defaultUri, integrity) {
return type === 'dotnetjs'
return type === 'dotnetjs' || type === 'manifest'
? `${defaultUri}?customizedbootresource=true`
: fetch(defaultUri, { integrity: integrity, cache: 'no-cache', headers: { 'customizedbootresource': 'true' } });
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<a class="dismiss">🗙</a>
</div>

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<a class="dismiss">🗙</a>
</div>

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]"></script>
</body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<a class="dismiss">🗙</a>
</div>

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<body>
@RenderBody()

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
function start() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void CachesResourcesAfterFirstLoad()
Navigate("/");
WaitUntilLoaded();
var initialResourcesRequested = GetAndClearRequestedPaths();
Assert.NotEmpty(initialResourcesRequested.Where(path => path.EndsWith("/blazor.boot.json", StringComparison.Ordinal)));
Assert.NotEmpty(initialResourcesRequested.Where(path => path.Contains(".boot.js", StringComparison.Ordinal)));
Assert.NotEmpty(initialResourcesRequested.Where(path =>
path.Contains("/dotnet.native.", StringComparison.Ordinal) &&
path.EndsWith(".wasm", StringComparison.Ordinal)));
Expand All @@ -52,14 +52,14 @@ public void CachesResourcesAfterFirstLoad()
!path.Contains("/dotnet.native.", StringComparison.Ordinal) &&
path.EndsWith(".wasm", StringComparison.Ordinal)));

// On subsequent loads, we skip the items referenced from blazor.boot.json
// On subsequent loads, we skip the items referenced from blazor.boot.json or dotnet.boot.js
// which includes .wasm (original .dll) files and dotnet.native.[fingerprint].wasm
Navigate("about:blank");
Browser.Equal(string.Empty, () => Browser.Title);
Navigate("/");
WaitUntilLoaded();
var subsequentResourcesRequested = GetAndClearRequestedPaths();
Assert.NotEmpty(initialResourcesRequested.Where(path => path.EndsWith("/blazor.boot.json", StringComparison.Ordinal)));
Assert.NotEmpty(initialResourcesRequested.Where(path => path.Contains(".boot.js", StringComparison.Ordinal)));
Assert.DoesNotContain(subsequentResourcesRequested, path =>
path.Contains("/dotnet.native.", StringComparison.Ordinal) &&
path.EndsWith(".wasm", StringComparison.Ordinal));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
return Blazor.runtime.runtimeBuildInfo.buildConfiguration;
}
</script>
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<button id="load-boot-script" onclick="start()">Load boot script</button>

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script src="js/jsRootComponentInitializers.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<component render-mode="ServerPrerendered" type="typeof(PreserveStateComponent)" param-State="@state1"></component>
@* State can change after a component has rendered, when this happens the output will not be updated during prerendering
and will have to wait until the app restarts in interactive mode.
*@
*@
PreserveService.NewState();
<component render-mode="ServerPrerendered" type="typeof(PreserveStateComponent)" param-State="@state2"></component>
break;
Expand All @@ -57,7 +57,7 @@

@* This is just to show that the state of a service can still change after the component has rendered and it's the component
responsibility to deal with updates after the initial render
*@
*@
<p>
Service state after components have rendered: <span id="service-state">@PreserveService.Guid</span>
</p>
Expand All @@ -66,7 +66,7 @@

PreserveService.NewState();

@* This is just to show that this state will be lost and not restored since the state was persisted before *@
@* This is just to show that this state will be lost and not restored since the state was persisted before *@
<p>
Service state after state has been persisted: <span id="service-state-after">@PreserveService.Guid</span>
</p>
Expand Down Expand Up @@ -128,6 +128,7 @@
}
else
{
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
elementToFocus.focus();
}
</script>
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]" autostart="false" suppress-error="BL9992"></script>
<script src="_content/TestContentPackage/counterInterop.js"></script>
<script src="js/circuitContextTest.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</head>
<body>
<Components.WasmMinimal.Routes @rendermode="@PageRenderMode" />
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]" autostart="false"></script>
<script>
Blazor.start({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<body>
<h1 id="ready">Form test cases</h1>
<NamedFormContextNoFormContextLayout />
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]" suppress-error="BL9992"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<body>
<Components.WasmRemoteAuthentication.Routes @rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)" />
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]" autostart="false"></script>
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<body>
<ServerApp @rendermode="@RenderMode.InteractiveServer" />

<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="@Assets["_framework/blazor.web.js"]" autostart="false"></script>
<script>
const suppressEnhancedNavigation = sessionStorage.getItem('suppress-enhanced-navigation') === 'true';
Expand Down
4 changes: 4 additions & 0 deletions src/Components/test/testassets/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
<_Parameter2>true</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

<PropertyGroup>
<WasmBootConfigFileName>dotnet.boot.js</WasmBootConfigFileName>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<body>
<div id="blazor-error-ui">Error</div>
<app>Loading...</app>
<script>window["__DOTNET_INTERNAL_BOOT_CONFIG_SRC"] = "dotnet.boot.js";</script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
(function(){
Expand Down
Loading