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: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@

<!--
Remove the implicit package reference for Microsoft.AspNetCore.App.Internal.Assets.
Projects within the repo will consume framework assets by importing
Microsoft.AspNetCore.App.Internal.Assets.targets directly
Projects within the repo consume framework assets via ProjectReference and
the StaticWebAssets.Groups.targets convention file.
-->
<Target Name="_RemoveAspNetCoreAppInternalAssetsReference" AfterTargets="ProcessFrameworkReferences">
<ItemGroup>
Expand Down
24 changes: 12 additions & 12 deletions eng/Npm.Workspace.nodeproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\JSInterop\Microsoft.JSInterop.JS\src\dist\tsconfig.tsbuildinfo" />

<!-- Components Web.JS outputs -->
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.server.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.server.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.web.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.web.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.webassembly.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.webassembly.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.server.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.server.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.web.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.web.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.webassembly.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\_framework\blazor.webassembly.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Debug\blazor.webview.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.server.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.server.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.web.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.web.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.webassembly.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.webassembly.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.server.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.server.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.web.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.web.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.webassembly.js" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\_framework\blazor.webassembly.js.map" />
<NpmBuildOutputFiles Include="$(NpmWorkspaceRoot)\src\Components\Web.JS\dist\Release\blazor.webview.js" />

<!-- WebAssembly Authentication outputs -->
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"sdk": {
"version": "11.0.100-preview.5.26227.104",
"version": "11.0.100-preview.6.26277.116",
"paths": [
".dotnet",
"$host$"
],
"errorMessage": "The .NET SDK could not be found, run ./restore.cmd or ./restore.sh first."
},
"tools": {
"dotnet": "11.0.100-preview.5.26227.104",
"dotnet": "11.0.100-preview.6.26277.116",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"
Expand Down
36 changes: 21 additions & 15 deletions src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<Project Sdk="Microsoft.NET.Sdk.Razor" DefaultTargets="Pack">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand All @@ -12,6 +12,10 @@
<IncludeSymbols>false</IncludeSymbols>
<ImplicitUsings>disable</ImplicitUsings>

<StaticWebAssetBasePath>/</StaticWebAssetBasePath>
<!-- SWA Framework Assets: mark all JS files as Framework type during pack -->
<StaticWebAssetFrameworkPattern>**/*.js</StaticWebAssetFrameworkPattern>

<!-- The package doesn't produce any lib or ref assemblies -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
Expand All @@ -21,26 +25,28 @@
<_BlazorJSContentRoot Condition="'$(Configuration)' == 'Release'">$(RepoRoot)src\Components\Web.JS\dist\Release</_BlazorJSContentRoot>
</PropertyGroup>

<ItemGroup Condition="'$(BuildNodeJS)' == 'true'">
<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.web.js" />
<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.server.js" />
<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.webassembly.js" />

<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.web.js.map" />
<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.server.js.map" />
<_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.webassembly.js.map" />
<!-- Include blazor JS files as Content under wwwroot/ so the SWA pipeline discovers them.
ContentRoot points to the JS dist folder so the runtime middleware can serve files directly.
Condition on BuildNodeJS since the files won't exist during No-NodeJS CI builds. -->
<!-- blazor.webassembly.js is provided by Microsoft.AspNetCore.Components.WebAssembly instead.
It flows to Blazor Web Apps through the client project P2P reference chain. -->
<ItemGroup Condition="'$(BuildNodeJS)' != 'false'">
<Content Include="$(_BlazorJSContentRoot)\_framework\blazor.web.js" Link="wwwroot\_framework\blazor.web.js" ContentRoot="$(_BlazorJSContentRoot)\" />
<Content Include="$(_BlazorJSContentRoot)\_framework\blazor.server.js" Link="wwwroot\_framework\blazor.server.js" ContentRoot="$(_BlazorJSContentRoot)\" />
<Content Include="$(_BlazorJSContentRoot)\_framework\blazor.web.js.map" Link="wwwroot\_framework\blazor.web.js.map" ContentRoot="$(_BlazorJSContentRoot)\" />
<Content Include="$(_BlazorJSContentRoot)\_framework\blazor.server.js.map" Link="wwwroot\_framework\blazor.server.js.map" ContentRoot="$(_BlazorJSContentRoot)\" />
</ItemGroup>

<ItemGroup>
<None Include="build\*" Pack="true" PackagePath="%(Identity)" />
<None Include="buildMultiTargeting\*" Pack="true" PackagePath="%(Identity)" />
<None Include="buildTransitive\*" Pack="true" PackagePath="%(Identity)" />
<None Include="@(_BlazorJSFile)" Pack="true" PackagePath="_framework\%(FileName)%(Extension)" />
<StaticWebAssetGroupDefinition Include="BlazorFramework"
Value="enabled" SourceId="$(PackageId)" Order="0"
IncludePattern="**" />
</ItemGroup>

<Target Name="_CheckBlazorJSPath" AfterTargets="ResolveProjectReferences">
<Target Name="_CheckBlazorJSPath" AfterTargets="ResolveProjectReferences" Condition="'$(BuildNodeJS)' != 'false'">
<ItemGroup>
<_MissingBlazorJSFile Include="@(_BlazorJSFile)" Condition="!EXISTS('%(_BlazorJSFile.FullPath)')" />
<_MissingBlazorJSFile Include="$(_BlazorJSContentRoot)\_framework\blazor.web.js" Condition="!EXISTS('$(_BlazorJSContentRoot)\_framework\blazor.web.js')" />
<_MissingBlazorJSFile Include="$(_BlazorJSContentRoot)\_framework\blazor.server.js" Condition="!EXISTS('$(_BlazorJSContentRoot)\_framework\blazor.server.js')" />
</ItemGroup>

<Error
Expand Down
10 changes: 10 additions & 0 deletions src/Assets/StaticWebAssets.Groups.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>

<ItemGroup>
<StaticWebAssetGroup
Condition="('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe') and '$(UsingMicrosoftNETSdkWeb)' == 'true'"
Include="BlazorFramework" Value="enabled"
SourceId="Microsoft.AspNetCore.App.Internal.Assets" />
</ItemGroup>

</Project>

This file was deleted.

72 changes: 0 additions & 72 deletions src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 2 additions & 8 deletions src/Components/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
</PropertyGroup>

<!-- Workaround to add Blazor framework static assets without requiring a package reference -->
<PropertyGroup>
<UseBlazorFrameworkDebugAssets>true</UseBlazorFrameworkDebugAssets>
<BlazorFrameworkStaticWebAssetRoot Condition="'$(Configuration)' == 'Debug'">$(RepoRoot)src\Components\Web.JS\dist\Debug</BlazorFrameworkStaticWebAssetRoot>
<BlazorFrameworkStaticWebAssetRoot Condition="'$(Configuration)' == 'Release'">$(RepoRoot)src\Components\Web.JS\dist\Release</BlazorFrameworkStaticWebAssetRoot>
</PropertyGroup>

<Import Project="$(RepoRoot)\src\Assets\build\Microsoft.AspNetCore.App.Internal.Assets.targets" />
<Import Project="$(RepoRoot)\src\Assets\StaticWebAssets.Groups.targets" />
<Import Project="$(RepoRoot)\src\Components\WebAssembly\WebAssembly\src\StaticWebAssets.Groups.targets" />

</Project>
32 changes: 24 additions & 8 deletions src/Components/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
<Project>
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' and '$(BuildNodeJS)' != 'false'">
<BlazorWebAssemblyJSPath
Condition=" '$(Configuration)' == 'Debug' ">$(RepoRoot)src\Components\Web.JS\dist\Debug\blazor.webassembly.js</BlazorWebAssemblyJSPath>
<BlazorWebAssemblyJSPath
Condition=" '$(Configuration)' != 'Debug' ">$(RepoRoot)src\Components\Web.JS\dist\Release\blazor.webassembly.js</BlazorWebAssemblyJSPath>
<BlazorWebAssemblyJSMapPath>$(BlazorWebAssemblyJSPath).map</BlazorWebAssemblyJSMapPath>
</PropertyGroup>

<!-- blazor.web.js and blazor.server.js are provided by Microsoft.AspNetCore.App.Internal.Assets.
blazor.webassembly.js is provided by Microsoft.AspNetCore.Components.WebAssembly.
No need to set BlazorWebAssemblyJSPath for the Wasm SDK to resolve it separately. -->
<!-- Add Assets.Internal reference in .targets so TargetFrameworkIdentifier is available.
Exclude netstandard projects (analyzers, generators, tasks), Wasm projects
(which provide their own JS via the Components.WebAssembly package), and
source-only builds (Assets.Internal is excluded from source-build). -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'">
<Reference Include="Microsoft.AspNetCore.App.Internal.Assets" PrivateAssets="All" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />

<!-- After ResolveReferences.targets (imported above) converts Reference to ProjectReference
at evaluation time (which drops all custom metadata), re-apply metadata at evaluation
time so it is always in effect for every build phase (Build, Publish, Razor, etc.):
- ReferenceOutputAssembly=false: don't try to resolve/copy the DLL (the project uses
CopyBuildOutputToOutputDirectory=false so no DLL exists in the output directory)
- Private=false: don't copy to consuming project output
- PrivateAssets=all: don't flow as a dependency to consuming packages -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'">
<ProjectReference Update="$(RepoRoot)src\Assets\Microsoft.AspNetCore.App.Internal.Assets.csproj"
ReferenceOutputAssembly="false"
Private="false"
PrivateAssets="all" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Components/Web.JS/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const __dirname = path.dirname(__filename);

export default createBaseConfig({
inputOutputMap: {
'blazor.server': './src/Boot.Server.ts',
'blazor.web': './src/Boot.Web.ts',
'blazor.webassembly': './src/Boot.WebAssembly.ts',
'_framework/blazor.server': './src/Boot.Server.ts',
'_framework/blazor.web': './src/Boot.Web.ts',
'_framework/blazor.webassembly': './src/Boot.WebAssembly.ts',
'blazor.webview': './src/Boot.WebView.ts',
},
dir: __dirname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
Expand All @@ -13,6 +13,9 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- TODO: Address Native AOT analyzer warnings https://github.com/dotnet/aspnetcore/issues/45473 -->
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>

<StaticWebAssetBasePath>/</StaticWebAssetBasePath> <!-- SWA Framework Assets: mark all JS files as Framework type during pack -->
<StaticWebAssetFrameworkPattern>**/*.js</StaticWebAssetFrameworkPattern>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,6 +26,9 @@
<Reference Include="Microsoft.Extensions.Logging" />
<Reference Include="Microsoft.Extensions.Diagnostics" />
<Reference Include="Microsoft.JSInterop.WebAssembly" />
<!-- This project provides blazor.webassembly.js itself; remove the Assets.Internal
reference added by Directory.Build.props to avoid duplicate SWA entries. -->
<Reference Remove="Microsoft.AspNetCore.App.Internal.Assets" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -59,12 +65,24 @@
</ItemGroup>

<PropertyGroup>
<BlazorWebAssemblyJSFile Condition=" '$(Configuration)' == 'Debug' ">..\..\..\Web.JS\dist\Debug\blazor.webassembly.js</BlazorWebAssemblyJSFile>
<BlazorWebAssemblyJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\..\Web.JS\dist\Release\blazor.webassembly.js</BlazorWebAssemblyJSFile>
<_BlazorWasmJSContentRoot Condition="'$(Configuration)' == 'Debug'">$(RepoRoot)src\Components\Web.JS\dist\Debug</_BlazorWasmJSContentRoot>
<_BlazorWasmJSContentRoot Condition="'$(Configuration)' == 'Release'">$(RepoRoot)src\Components\Web.JS\dist\Release</_BlazorWasmJSContentRoot>
</PropertyGroup>

<!-- Include blazor.webassembly.js as Content under wwwroot/ so the SWA pipeline discovers it.
ContentRoot points to the JS dist folder so the runtime middleware can serve files directly. -->
<ItemGroup Condition="'$(BuildNodeJS)' != 'false'">
<Content Include="$(_BlazorWasmJSContentRoot)\_framework\blazor.webassembly.js" Link="wwwroot\_framework\blazor.webassembly.js" ContentRoot="$(_BlazorWasmJSContentRoot)\" />
<Content Include="$(_BlazorWasmJSContentRoot)\_framework\blazor.webassembly.js.map" Link="wwwroot\_framework\blazor.webassembly.js.map" ContentRoot="$(_BlazorWasmJSContentRoot)\" />
</ItemGroup>

<ItemGroup>
<StaticWebAssetGroupDefinition Include="BlazorWebAssembly"
Value="enabled" SourceId="$(PackageId)" Order="0"
IncludePattern="**" />
</ItemGroup>

<ItemGroup>
<Content Include="$(BlazorWebAssemblyJSFile)" Pack="true" PackagePath="build\$(DefaultNetCoreTargetFramework)\" LinkBase="build\$(DefaultNetCoreTargetFramework)\" />
<Content Include="targets\*.props" Pack="true" PackagePath="build\$(DefaultNetCoreTargetFramework)\" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<ItemGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true'">
<StaticWebAssetGroup Include="BlazorWebAssembly"
Value="enabled"
SourceId="Microsoft.AspNetCore.Components.WebAssembly" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project>
<PropertyGroup>
<BlazorWebAssemblyJSPath>$(MSBuildThisFileDirectory)blazor.webassembly.js</BlazorWebAssemblyJSPath>
<BlazorRoutingEnableRegexConstraint Condition="'$(BlazorRoutingEnableRegexConstraint)' == ''">false</BlazorRoutingEnableRegexConstraint>
</PropertyGroup>

Expand Down
Loading
Loading