Skip to content

Make CharacterReader internal. #19123

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

Merged
merged 3 commits into from
Jun 26, 2025
Merged

Conversation

grokys
Copy link
Member

@grokys grokys commented Jun 25, 2025

What does the pull request do?

Makes Avalonia.Utilities.CharacterReader internal for v12 as the TODO12 comment there suggests. By extension, make the static classes which define extension methods on it internal.

To do this, I had to make Avalonia.Base's internals visible to Avalonia.Designer.HostApp, as that has a dependency on it, and exclude StringCompatibilityExtensions from there as the one from Avalonia.Base is now visible

To do this I had to add string overloads to a few internal APIs which took a CharacterReader in Avalonia.Markup and Avalonia.Markup.Xaml - these assemblies have their internals exposed to Avalonia.Markup.Xaml.Loader.

What is the current behavior?

There is a TODO12 comment on CharacterReader saying to make it not public.

What is the updated/expected behavior with this PR?

It is now not public.

Breaking changes

Code depending on CharacterReader or one of its extension methods will now fail to compile.

And by extension, make the static classes which define extension methods on it internal.

To do this, I had to make Avalonia.Base's internals visible to Avalonia.Designer.HostApp, as that has a dependency on it, and exclude `StringCompatibilityExtensions` from there as the one from Avalonia.Base is now visible.
grokys added 2 commits June 25, 2025 17:05
Exposing Avalonia.Base's internals to Avalonia.Designer.HostApp caused an issue with the dependency on `StringCompatibilityExtensions` - because the hostapp is loaded into the target app and `StringCompatibilityExtensions` is conditionally compiled, you ended up with it being loaded into an app which does not have `StringCompatibilityExtensions`.

Instead, add `string` overloads of the internal APIs which take a `CharacterReader` so that they can be called even when `CharacterReader` isn't available.
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0057279-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM!

@MrJul MrJul added this pull request to the merge queue Jun 26, 2025
Merged via the queue into master with commit 3cc0275 Jun 26, 2025
11 checks passed
@MrJul MrJul deleted the refactor/characterreader-internal branch June 26, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants