Skip to content

docs: Update conditional code/Xaml to include Skia - #4210

Merged
mergify[bot] merged 3 commits into
unoplatform:masterfrom
robloo:robloo/update-docs
Oct 6, 2020
Merged

mergify[bot] merged 3 commits into
unoplatform:masterfrom
robloo:robloo/update-docs

Conversation

@robloo

@robloo robloo commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #

PR Type

What kind of change does this PR introduce?

  • Documentation content changes

What is the current behavior?

Skia is excluded from condition code and Xaml docs.

What is the new behavior?

Skia is included.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

  • Someone needs to double check the pre-defined prefixes table for conditional Xaml. I added Skia for all entries and made some assumptions (like xamarin should exclude Skia).

@robloo
robloo requested a review from a team October 2, 2020 20:43
@gitpod-io

gitpod-io Bot commented Oct 2, 2020 •

Copy link
Copy Markdown

@jeromelaban

Copy link
Copy Markdown
Member

Thanks @robloo !

Comment thread doc/articles/platform-specific-xaml.md Outdated
| Prefix | Included platforms | Excluded platforms | Namespace | Put in `mc:Ignorable`? |
|---------------|------------------------------------|------------------------------------|-------------------------------------------------------------|------------------------|
| `win` | Windows | Android, iOS, web, macOS, Skia | `http://schemas.microsoft.com/winfx/2006/xaml/presentation` | no |
| `xamarin` | Android, iOS, web, macOS | Windows, Skia | `http:/uno.ui/xamarin` | yes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you sure about this? The xamarin prefix includes Wasm, I would assume it also includes Skia. (Whether it should include them is another subject.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, not sure about that and it was the main assumption I mentioned in other information of the PR. It doesnt make sense for Xamarin to include skia (wasm still uses mono), if that is how it is implemented I can change it though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, I didn't check the PR description properly.

I checked and the definition for "xamarin" hasn't changed, it's a blanket include that's synonymous with "not_win":
https://github.com/unoplatform/uno/blob/master/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props#L41

You're right that it doesn't make sense that it includes Skia, and really IMO it shouldn't include Wasm either (Mono != Xamarin). It'd be a significant breaking change to adjust it, though. (And worse, a silent breaking change in many cases.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, you're right that this doesn't make sense but needs to stay for compatibility. I'll adjust so xamarin is the same as not_win.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I realize skia has just been released a few months ago and isn't documented yet. While we can't really fix Wasm, it is possible to fix Skia in this case to exclude it from Xamarin. If that broke any existing code it would be a very, very small amount using technically undocumented assumptions. It's kind-of now or never to fix this.

Otherwise, I made the updates so xamarin = non_win

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The problem is that 'existing code' includes Uno code that was not specifically written for Skia (or even Wasm), where xamarin was used as a synonym for 'not UWP'.

In the medium term it's just as likely that we move toward a different mechanism for conditional Xaml, in any case, because this approach is quite limited in certain use cases (eg when you want to prefix a type that's not coming from one of the default namespaces; when you want to include >1 and exclude >1 targets, eg iOS && macOS but not Android or WASM).

Comment thread doc/articles/platform-specific-xaml.md Outdated
| `wasm` | ✖ | ✖ | ✖ | ✔ | ✖ | ✖ |
| `macos` | ✖ | ✖ | ✖ | ✖ | ✔ | ✖ |
| `skia` | ✖ | ✖ | ✖ | ✖ | ✖ | ✔ |
| `xamarin` | ✖ | ✔ | ✔ | ✔ | ✔ | ✖ |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same question here

@davidjohnoliver davidjohnoliver added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Oct 6, 2020
@mergify
mergify Bot merged commit ab3f3c9 into unoplatform:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants