Skip to content

Conversation

@mattleibow
Copy link
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

The TS compiler automatically includes the JS files as content, but we want it as embedded files.

Issues Fixed

Fixes #32683

The TS compiler automatically includes the JS files as content, but we want it as embedded files.

Fixes #32683
Copilot AI review requested due to automatic review settings November 20, 2025 23:53
Copilot finished reviewing on behalf of mattleibow November 20, 2025 23:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the TypeScript compiler was automatically including generated JavaScript files as Content items, when they should be embedded as resources in the assembly. The fix ensures that HybridWebView.js (generated from HybridWebView.ts) is properly embedded rather than included as content.

Key Changes

  • Moved TypeScript compilation settings to Directory.Build.props for global availability
  • Added MSBuild target override to prevent TypeScript compiler from including JS files as Content
  • Added explicit <None Remove> directive to exclude the generated JS file from content inclusion

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Directory.Build.props Moved TypeScript compiler configuration from Core.csproj to make settings globally available
Directory.Build.targets Added GetTypeScriptOutputForPublishing target override to prevent JS files from being included as Content
src/Core/src/Core.csproj Removed TypeScript configuration (moved to Directory.Build.props) and added <None Remove> to exclude HybridWebView.js from content
src/TestUtils/src/Microsoft.Maui.IntegrationTests/WindowsTemplateTest.cs Added integration test to verify the fix works with Microsoft.Identity.Client packages

Assert.IsTrue(DotnetInternal.New("maui", projectDir, DotNetCurrent),
$"Unable to create template maui. Check test output for errors.");

// .NET 9 and later was Unpackaged, so we need to remove the line
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

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

This comment is misleading. The test is adding package references to reproduce issue #32683, not removing the WindowsPackageType property. Consider updating it to something like:

// Add Microsoft.Identity.Client packages to test that JS files are properly embedded
Suggested change
// .NET 9 and later was Unpackaged, so we need to remove the line
// Add Microsoft.Identity.Client packages to test that JS files are properly embedded

Copilot uses AI. Check for mistakes.
@jfversluis
Copy link
Member

jfversluis commented Nov 24, 2025

@mattleibow this keeps failing the build. The Copilot suggestion looks valid, so applied that... 🤞

@mattleibow
Copy link
Member Author

@jfversluis Thanks! I am now mirroring the packages to hopefully get it all green.

Copy link

@DevDachi DevDachi left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this!

@jfversluis
Copy link
Member

@DevDachi did you actually test the artifacts from this build?

@jfversluis jfversluis changed the base branch from main to inflight/current November 25, 2025 12:05
@jfversluis jfversluis merged commit be3a641 into inflight/current Nov 25, 2025
62 checks passed
@jfversluis jfversluis deleted the dev/fix-ts branch November 25, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[.Net 10] [Windows] Build failure when using Identity.Client.Desktop.WinUI3 nuget

4 participants