Skip to content
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

Raise a warning when platform-specific XAML namespace declaration has invalid URI #15021

Open
MartinZikmund opened this issue Jan 10, 2024 · 9 comments
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Comments

@MartinZikmund
Copy link
Member

Current behavior

From Cheesebaron on X:

Trying to get SkiaSharp running on @unoplatform. Works fine in the Skia GTK project, but when running on Android or iOS, doesn't draw anything. The repro is below. Very simply added SkiaSharp and SkiaSharp.Views.Uno.WinUI to the shared project. Only when hot reload kicks in the Canvas is invalidated and draws. This happens on Mobile. With GTK, it seems to work and draws initially.

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

https://github.com/Cheesebaron/UnoSkia

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@MartinZikmund MartinZikmund added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Jan 10, 2024
@MartinZikmund
Copy link
Member Author

Please also validate the behavior against WinUI implementation

@jeromelaban
Copy link
Member

If this behavior is hot reload related, it's not fixed yet and may need to have 8.0.101 to work properly (it's still pending inhttps://github.com/unoplatform/uno.check/pull/223)

@ramezgerges ramezgerges self-assigned this Jan 10, 2024
@ramezgerges
Copy link
Contributor

The repro uses xmlns:skia="using:SkiaSharp.Views.Windows". The skia namespace is used by the XAML generator to make add platform-specific controls. Use any other name instead of skia to avoid this problem. Remaining to skia2 fixed the problem (thanks @Youssef1313 for noticing this).

@MartinZikmund
Copy link
Member Author

@ramezgerges @Youssef1313 @jeromelaban I think it might make sense to detect this and warn the user:

  1. Warn if any of our "default prefixes" is used with a different URI than what is defined in https://platform.uno/docs/articles/platform-specific-xaml.html#available-prefixes
  2. Or warn specifically for the combination of "xmlns:skia" and "using:SkiaSharp.XYZ"

What do you think?

@MartinZikmund MartinZikmund reopened this Jan 11, 2024
@Youssef1313
Copy link
Member

@MartinZikmund That would be a duplicate of #14004 I think.

We could treat xmlns:any_platform="using:... as a CLR namespace instead of a conditional xmlns.

@Cheesebaron
Copy link

Cheesebaron commented Jan 11, 2024

Thanks for looking into this! As you say, after changing the xmlns to something else, it works now.

@jeromelaban
Copy link
Member

Raising a warning if the xmlns does not match the original name could be useful, indeed.

@MartinZikmund MartinZikmund changed the title Skia Canvas is not invalidated on Mobile Raise a warning when platform-specific XAML namespace declaration has invalid URI Jan 15, 2024
@ramezgerges
Copy link
Contributor

@MartinZikmund should we close this in favour of #15064?

@MartinZikmund
Copy link
Member Author

@ramezgerges this is a bit different than the other I think - this is to validate the URI matches, so it would apply even to prefixes like "android:" etc. The other is for usage of Skia and wasm secifically on non cross runtime libraries

@ramezgerges ramezgerges removed their assignment Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/skia ✏️ Categorizes an issue or PR as relevant to Skia
Projects
None yet
Development

No branches or pull requests

5 participants