Skip to content

Don't check in blazor.*.js files #45883

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

Closed
wants to merge 7 commits into from
Closed
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
18 changes: 0 additions & 18 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ stages:
-arch arm
-sign
-pack
-noBuildNodeJS
-noBuildJava
-binaryLog
/p:DotNetSignType=$(_SignType)
Expand Down Expand Up @@ -392,7 +391,6 @@ stages:
-n $(Build.Repository.Name)
-o $(Build.ArtifactStagingDirectory)/sourceIndex/
displayName: Process binary log into indexable sln
installNodeJs: false
installJdk: false
artifacts:
- name: Windows_arm_Logs
Expand All @@ -415,14 +413,12 @@ stages:
--arch arm64
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-MacOS_arm64.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
artifacts:
- name: MacOS_arm64_Logs
path: artifacts/log/
Expand All @@ -445,14 +441,12 @@ stages:
buildArgs:
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-MacOS_x64.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
artifacts:
- name: MacOS_x64_Logs
path: artifacts/log/
Expand All @@ -479,7 +473,6 @@ stages:
--arch x64
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
$(_BuildArgs)
Expand All @@ -499,7 +492,6 @@ stages:
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
displayName: Build RPM installers
installNodeJs: false
artifacts:
- name: Linux_x64_Logs
path: artifacts/log/
Expand All @@ -523,14 +515,12 @@ stages:
--arch arm
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-Linux_arm.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
artifacts:
- name: Linux_arm_Logs
path: artifacts/log/
Expand All @@ -556,7 +546,6 @@ stages:
--arch arm64
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
$(_BuildArgs)
Expand All @@ -570,7 +559,6 @@ stages:
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
displayName: Build RPM installers
installNodeJs: false
artifacts:
- name: Linux_arm64_Logs
path: artifacts/log/
Expand All @@ -596,14 +584,12 @@ stages:
--os-name linux-musl
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-Linux_musl_x64.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
disableComponentGovernance: true
artifacts:
- name: Linux_musl_x64_Logs
Expand Down Expand Up @@ -631,14 +617,12 @@ stages:
--os-name linux-musl
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-Linux_musl_arm.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
artifacts:
- name: Linux_musl_arm_Logs
path: artifacts/log/
Expand All @@ -665,14 +649,12 @@ stages:
--os-name linux-musl
--pack
--all
--no-build-nodejs
--no-build-java
-p:OnlyPackPlatformSpecificPackages=true
-p:AssetManifestFileName=aspnetcore-Linux_musl_arm64.xml
$(_BuildArgs)
$(_PublishArgs)
$(_InternalRuntimeDownloadArgs)
installNodeJs: false
artifacts:
- name: Linux_musl_arm64_Logs
path: artifacts/log/
Expand Down
2 changes: 2 additions & 0 deletions .azure/pipelines/jobs/default-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ jobs:
displayName: Install Node 16.x
inputs:
versionSpec: 16.x
- script: node --version
displayName: Check node version
- ${{ if and(eq(parameters.installJdk, 'true'), eq(parameters.agentOs, 'Windows')) }}:
- powershell: ./eng/scripts/InstallJdk.ps1
displayName: Install JDK 11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,14 @@
<BlazorServerJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\Web.JS\dist\Release\$(BlazorServerJSFilename)</BlazorServerJSFile>
</PropertyGroup>

<!-- blazor.server.js should exist after Microsoft.AspNetCore.Components.Web.JS.npmproj builds. Fall back if not. -->
<Target Name="_CheckBlazorServerJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorServerJSFile)') ">
<Warning Text="'$(BlazorServerJSFile)' does not exist. Falling back to checked-in copy." />
<PropertyGroup>
<BlazorServerJSFile>..\..\Web.JS\dist\Release\$(BlazorServerJSFilename)</BlazorServerJSFile>
</PropertyGroup>
<!-- blazor.server.js should exist after Microsoft.AspNetCore.Components.Web.JS.npmproj builds. -->
<Target Name="_CheckBlazorServerJSPath" AfterTargets="ResolveProjectReferences" Condition=" '$(BuildNodeJS)' != 'false' and !EXISTS('$(BlazorServerJSFile)') ">
<Error Text="'$(BlazorServerJSFile)' does not exist. Build with NodeJS enabled." />
</Target>

<Target Name="_AddEmbeddedBlazor" AfterTargets="_CheckBlazorServerJSPath">
<ItemGroup>
<EmbeddedResource Include="$(BlazorServerJSFile)" LogicalName="_framework/$(BlazorServerJSFilename)" />
<EmbeddedResource Include="$(BlazorServerJSFile)" LogicalName="_framework/$(BlazorServerJSFilename)" Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is the file we're deleting, it won't exist unless you build nodeJs. Maybe it'd be better to condition on the file existing, in case a dev follows a NodeJs build with a NoBuildNodeJs build.

<EmbeddedResource Include="$(BlazorServerJSFile).map" LogicalName="_framework/$(BlazorServerJSFilename).map" Condition="Exists('$(BlazorServerJSFile).map')" />
</ItemGroup>
</Target>
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Web.JS/dist/.gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions src/Components/Web.JS/dist/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.js
1 change: 0 additions & 1 deletion src/Components/Web.JS/dist/Release/blazor.server.js

This file was deleted.

1 change: 0 additions & 1 deletion src/Components/Web.JS/dist/Release/blazor.webview.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@
<BlazorWebViewJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
</PropertyGroup>

<!-- blazor.webview.js should exist after Microsoft.AspNetCore.Components.Web.JS.npmproj builds. Fall back if not. -->
<Target Name="_CheckBlazorWebViewJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorWebViewJSFile)') ">
<Warning Text="'$(BlazorWebViewJSFile)' does not exist. Falling back to checked-in copy." />
<PropertyGroup>
<BlazorWebViewJSFile>..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
</PropertyGroup>
<!-- blazor.webview.js should exist after Microsoft.AspNetCore.Components.Web.JS.npmproj builds. -->
<Target Name="_CheckBlazorWebViewJSPath" AfterTargets="ResolveProjectReferences" Condition=" '$(BuildNodeJS)' != 'false' and !EXISTS('$(BlazorWebViewJSFile)') ">
<Error Text="'$(BlazorWebViewJSFile)' does not exist. Build with NodeJS enabled." />
</Target>

<Target Name="_AddEmbeddedBlazorWebView" BeforeTargets="_CalculateEmbeddedFilesManifestInputs" DependsOnTargets="_CheckBlazorWebViewJSPath">
<ItemGroup>
<EmbeddedResource Include="blazor.modules.json" LogicalName="_framework/blazor.modules.json" />
<EmbeddedResource Include="$(BlazorWebViewJSFile)" LogicalName="_framework/$(BlazorWebViewJSFilename)" />
<EmbeddedResource Include="$(BlazorWebViewJSFile)" LogicalName="_framework/$(BlazorWebViewJSFilename)" Condition="'$(BuildNodeJS)' != 'false' and '$(BuildingInsideVisualStudio)' != 'true'" />
<EmbeddedResource Include="$(BlazorWebViewJSFile).map" LogicalName="_framework/$(BlazorWebViewJSFilename).map" Condition="Exists('$(BlazorWebViewJSFile).map')" />
</ItemGroup>
</Target>
Expand Down