Skip to content

Conversation

michaelstonis
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
There are no event bindings for Xamarin.Essentials today

What is the new behavior (if this is a feature change)?
This adds the ability to provide event binding for Xamarin.Essentials

What might this PR break?
Not likely anything, but there were some changes to the event binding program.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:
I would potentially consider this a first pass. Everything in the Essentials world is a static class, so binding the same way we did before is not possible. Right now, the extensions are added to object, so as soon as you do a using Xamarin.Essentials;, every object is going to have these extension methods available. I don't love this, but I really couldn't think of a better approach.

@michaelstonis michaelstonis requested a review from a team July 5, 2018 22:45
@dnfclas
Copy link

dnfclas commented Jul 5, 2018

CLA assistant check
All CLA requirements met.

<PackageReference Include="Serilog" Version="1.5.14" />
<PackageReference Include="NuGet.Core" Version="2.14.0" />
</ItemGroup>
<ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

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

This formatting seems a bit inconsistent with the others, e.g. indent off by one

Directory.GetFiles(packageUnzipPath,
"Xamarin.Essentials.dll", SearchOption.AllDirectories);

var latestVersion = xamarinForms.Last();//x => x.Contains("netstandard2.0"));
Copy link
Member

Choose a reason for hiding this comment

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

is the x.contains needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I had it pinned at netstandard2.0, but then had to switch it to try to just get the last one. I am going to pin it at netstandard2.0.

{"Windows.Foundation.EventHandler`2", "EventHandler"}
};

private static string RenameBogusWinRTTypes(string typeName)
Copy link
Member

Choose a reason for hiding this comment

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

Given this is only being used for Xamarin.Essentials, do we need this slightly odd bodge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to kick it all out for now.


var garbageNamespaceList = new[]
{
"Windows.UI.Xaml.Data",
Copy link
Member

Choose a reason for hiding this comment

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

Likewise, are these namespaces sensible to exclude?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same, I am cleaning all of the, seemingly, non-relevant stuff out of here.

@olevett
Copy link
Member

olevett commented Jul 11, 2018

Thanks @michaelstonis!

@ghuntley not sure who has the ability to push this out as an extra nuget package, is this something you could help with?

@Mrnikbobjeff
Copy link

I would suggest tabling this until this has been delt with in their repository. I reckon this would break existing code.

@michaelstonis
Copy link
Contributor Author

I will keep an eye on the Essentials package and update this once they finalize their event structure.

@Mrnikbobjeff
Copy link

@michaelstonis The event structure has been finalized. That block has been cleared.

@michaelstonis
Copy link
Contributor Author

As soon as they release a new nuget with these in them, I will get this updated.

@glennawatson
Copy link
Contributor

glennawatson commented Aug 2, 2018

They released a new version a couple days ago https://www.nuget.org/packages/Xamarin.Essentials

Xamarin.Essentials: a kit of essential API's for your apps

@michaelstonis
Copy link
Contributor Author

Cool. I am on it.

This also required changing the framework to netstandard 1.0, but I have no idea why
This now matches the standard event format. One thing that was immediately bad about the last implementation is that it caused a lot of chaff in intellisense, since every object would have these extensions. I changed this to not be extension methods, but just static instances that can be called from wherever and the experience is far better this way. I am open to reverting it though.
"Xamarin.Essentials.dll", SearchOption.AllDirectories);

var latestVersion = xamarinForms.First(x => x.Contains("netstandard2.0"));
var latestVersion = xamarinForms.First(x => x.Contains("netstandard1.0"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if it's worthwhile not putting the version in?

XamForms,
UWP,
Winforms
Winforms,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be fun doing TVOS who wins first :)

<PackageReference Include="NuGet.Core" Version="2.14.0" />
</ItemGroup>
<ItemGroup>
<None Update="XamarinEssentialsTemplate.mustache">
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is None, other mustache above is Content, can we keep them the same type and put them into the same ItemGroup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can do!

@glennawatson
Copy link
Contributor

BTW @michaelstonis I think you just need to do a conflict resolve on the files at the moment to get this ready for finishing the PR, and very minor minor comments in review. Then I think we are ready to pull.

@glennawatson
Copy link
Contributor

Hey @olevett you mentioned we might need a new NuGet package for the events? Should I get Oren/Geoffrey to help out?

Merge remote-tracking branch 'upstream/master' into feature/xamarin-essentials-events
fix-up Tizen base platform implementation
@michaelstonis michaelstonis requested a review from a team August 7, 2018 00:36
@michaelstonis michaelstonis requested review from a team August 7, 2018 00:36
@glennawatson glennawatson added this to the vNext milestone Aug 7, 2018
@glennawatson glennawatson merged commit 6fa6de2 into reactiveui:master Aug 7, 2018
@glennawatson
Copy link
Contributor

Thanks @michaelstonis

@glennawatson glennawatson modified the milestones: vNext, 8.4.4 Aug 9, 2018
glennawatson pushed a commit that referenced this pull request Mar 23, 2019
Provides functionality to generate event mapping for Xamarin.Essentials
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants