Skip to content

XAML xmlns simplifications #29298

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

XAML xmlns simplifications #29298

wants to merge 13 commits into from

Conversation

StephaneDelcroix
Copy link
Contributor

this is a merge of #28909, #28969, #29203 and #29181

it's probably easier to review independent PRs, but merging them is a nightmare

@Copilot Copilot AI review requested due to automatic review settings May 2, 2025 20:50
@StephaneDelcroix StephaneDelcroix requested a review from a team as a code owner May 2, 2025 20:50
Copy link
Contributor

@Copilot 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 simplifies and unifies the XAML XML namespace definitions across multiple target platforms by updating the XmlnsDefinitionAttribute constructor signature and adding support for implicit XMLNS declarations. Key changes include:

  • Changing constructor parameters for XmlnsDefinitionAttribute from (string xmlNamespace, string clrNamespace) to (string xmlNamespace, string target) across PublicAPI files.
  • Introducing a new AllowImplicitXmlnsDeclarationAttribute and updating related XAML parsing tasks.
  • Adjustments to error messages and XML namespace management in build tasks.

Reviewed Changes

Copilot reviewed 39 out of 43 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Shipped.txt Updated XmlnsDefinitionAttribute signature.
src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt Added AllowImplicitXmlnsDeclarationAttribute and related members.
src/Controls/src/Core/PublicAPI/net-windows/*.txt Updated public API definitions to reflect the new signature and attribute.
src/Controls/src/Core/PublicAPI/net-tizen/*.txt Updated public API definitions uniformly for Tizen.
src/Controls/src/Core/PublicAPI/net-maccatalyst/*.txt Updated public API definitions uniformly for MacCatalyst.
src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt Updated iOS public API definitions.
src/Controls/src/Core/PublicAPI/net-android/*.txt Updated Android public API definitions.
src/Controls/src/Core/Properties/AssemblyInfo.cs Added a new XmlnsPrefix for xaml.
src/Controls/src/Core/AllowImplicitXmlnsDeclarationAttribute.cs Introduced new attribute for implicit XMLNS declarations.
src/Controls/src/Build.Tasks/XmlTypeExtensions.cs Adjusted XML namespace handling and error messaging.
src/Controls/src/Build.Tasks/XamlTask.cs and XamlCTask.cs Updated parsing logic to work with the new implicit XMLNS functionality.
Files not reviewed (4)
  • Microsoft.Maui-vscode.sln: Language not supported
  • src/Controls/docs/Microsoft.Maui.Controls/XmlnsDefinitionAttribute.xml: Language not supported
  • src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Shipped.txt: Language not supported
  • src/Controls/src/Core/PublicAPI/net/PublicAPI.Shipped.txt: Language not supported
Comments suppressed due to low confidence (1)

src/Controls/src/Build.Tasks/XmlTypeExtensions.cs:51

  • The error message contains a duplicated phrase ('Can't add assembly') which may confuse users. Consider removing the duplicate to clarify the message.
throw new BuildException(BuildExceptionCode.InvalidXaml, null, null, $"Protected Xmlns {attribute.XmlNamespace}. Can't add assembly  Can't add assembly {attribute.Target}/{attribute.AssemblyName}.");

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.

XAML xmlns simplifications
1 participant