Skip to content

More API alignments and do symbol matching in UWPSyncGenerator - #7249

Closed
Youssef1313 wants to merge 1 commit into
unoplatform:feature/breaking-changesfrom
Youssef1313:more-sync-gen-updates
Closed

Youssef1313 wants to merge 1 commit into
unoplatform:feature/breaking-changesfrom
Youssef1313:more-sync-gen-updates

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): Part of #2240

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@Youssef1313
Youssef1313 requested a review from a team September 30, 2021 10:05
@gitpod-io

gitpod-io Bot commented Sep 30, 2021

Copy link
Copy Markdown

Comment thread src/Uno.UWPSyncGenerator/Generator.cs Resolved
@Youssef1313
Youssef1313 marked this pull request as draft September 30, 2021 10:43
@Youssef1313 Youssef1313 changed the title More API alignments and add do symbol matching in UWPSyncGenerator More API alignments and do symbol matching in UWPSyncGenerator Sep 30, 2021
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from 431ebc9 to acd614b Compare October 7, 2021 18:20
@Youssef1313
Youssef1313 marked this pull request as ready for review October 7, 2021 18:20
@Youssef1313
Youssef1313 marked this pull request as draft October 8, 2021 04:09
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from 5d8bb39 to d4b653a Compare October 8, 2021 13:24
@Youssef1313
Youssef1313 marked this pull request as ready for review October 11, 2021 18:03
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from e51be4d to 8fa01b6 Compare October 12, 2021 10:29
@Youssef1313 Youssef1313 reopened this Oct 12, 2021
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch 2 times, most recently from 173adbb to d8fdda6 Compare October 14, 2021 10:14
@Youssef1313

Copy link
Copy Markdown
Member Author

@ebariche Would you be able to get to this one soon?

@Youssef1313

Copy link
Copy Markdown
Member Author

@ebariche @jeromelaban I see api-alignments was recently merged into master (#7390). Do we want to get this PR in too?

@jeromelaban
jeromelaban changed the base branch from feature/api-alignments to master November 3, 2021 18:28
@jeromelaban

Copy link
Copy Markdown
Member

Let's see how to merge this in master.

@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from d8fdda6 to 2964efc Compare February 6, 2022 12:57
@Youssef1313

Copy link
Copy Markdown
Member Author

I resolved the conflicts. Let's see if this will pass CI. Please ping me if CI failed and I forgot to check.

@jeromelaban

Copy link
Copy Markdown
Member

The CI failed indeed:
image

@Youssef1313

Copy link
Copy Markdown
Member Author

I'll investigate.

@jeromelaban
jeromelaban marked this pull request as draft February 8, 2022 13:36
@Youssef1313

Youssef1313 commented Feb 8, 2022 •

Copy link
Copy Markdown
Member Author

@jeromelaban I think I found the root cause:

Here, in a non-generated file, ProtectedCursor is of type InputCursor:

public UI.Input.InputCursor ProtectedCursor
{
get;
set;
}

However, after I run convert to WinUI tree script, I got:

		public  global::Windows.UI.Core.CoreCursor ProtectedCursor
		{
			get
			{
				throw new global::System.NotImplementedException("The member CoreCursor UIElement.ProtectedCursor is not implemented in Uno.");
			}
			set
			{
				global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Microsoft.UI.Xaml.UIElement", "CoreCursor UIElement.ProtectedCursor");
			}
		}

So basically code generation is seeing a different return type than what's already exists in source.

The weird thing is that Microsoft API reference is saying it's InputCursor.

However, there is a document in WinUI repo that mentions CoreCursor:

https://github.com/microsoft/microsoft-ui-xaml-specs/blob/master/active/UIElement/ElementCursor.md#api-pages

I'll skip this property for now.

GitHub
API spec repository for the Windows UI Library (WinUI) - microsoft-ui-xaml-specs/ElementCursor.md at master · microsoft/microsoft-ui-xaml-specs

@Youssef1313
Youssef1313 marked this pull request as ready for review February 8, 2022 14:22
@jeromelaban

Copy link
Copy Markdown
Member

Nice work! It's likely that it's a difference between the uap and the net5 targets for some reason. We need to upgrade to a later version of the API set, likely when 1.1 will be released.

/// Disables scrolling.
/// </summary>
Auto,
Disabled,

@nickrandolph nickrandolph Sep 7, 2022 •

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.

Given the order is set to intentionally give the same values as the UWP/WinUI enum with the same name, I'd suggest actually assigning the values to make it explicit. Also might be worth referencing the docs, so that someone doesn't change order - https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollbarvisibility?view=winrt-22621

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@nickrandolph The generator is now supposed to ensure correct values.

All enums should have the same values as Windows, and there are a lot. I think it's not worth adding a comment to every enum if we have an automated solution.

NoWrap,
Wrap,
WrapWholeWords,
NoWrap = 1,

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.

/// Updates the target property when the binding is created. Changes to the source object can also propagate to the target.
/// </summary>
OneWay,
OneWay = 1,

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.

public TimeSpan Duration;

public RepeatBehaviorType Type { get; set; }
public RepeatBehaviorType Type;

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.

Should we disable the code analysis checks for public fields to avoid these warnings?
image

OpenIfExists,
ReplaceExisting,
GenerateUniqueName,
ReplaceExisting,

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.

@jeromelaban
jeromelaban marked this pull request as draft September 7, 2022 12:24
@jeromelaban

Copy link
Copy Markdown
Member

This PR will create breaking changes, let's add it to the rollup issue.

@Youssef1313
Youssef1313 changed the base branch from master to feature/breaking-changes March 12, 2023 18:22
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from bcbd368 to e237787 Compare March 12, 2023 18:22
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform labels Mar 12, 2023
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch 2 times, most recently from 7603eb4 to f799504 Compare March 13, 2023 20:15
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Mar 14, 2023
@Youssef1313

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jeromelaban
jeromelaban force-pushed the feature/breaking-changes branch from fbe92e0 to c4968a5 Compare March 30, 2023 18:27
@jeromelaban
jeromelaban force-pushed the feature/breaking-changes branch 2 times, most recently from d5fe12a to d5f223d Compare May 1, 2023 13:28
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch 2 times, most recently from 3ff58a5 to 7db3d11 Compare May 11, 2023 12:02
@github-actions github-actions Bot removed platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/build Categorizes an issue or PR as relevant to build infrastructure labels May 11, 2023
@Youssef1313
Youssef1313 force-pushed the more-sync-gen-updates branch from 7db3d11 to def04e5 Compare May 11, 2023 12:10
@Youssef1313

Copy link
Copy Markdown
Member Author

superseded by #12261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants