Skip to content

Conversation

@jkoritzinsky
Copy link
Contributor

@jkoritzinsky jkoritzinsky commented Aug 8, 2017

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Support for a .NET Core non-crashing build.

What is the current behavior? (You can also link to an open issue here)
Any .NET Core usage of ReactiveUI will crash.

What is the new behavior (if this is a feature change)?
A .NET Core build will not crash upon load. The user must supply a scheduler for the RxApp.MainThreadScheduler depending on their platform.

What might this PR break?
Nothing.

Please check if the PR fulfills these requirements

Other information:

Fixes #1417

@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.573% when pulling e134808 on jkoritzinsky:netcore into 91433b1 on reactiveui:develop.

@jkoritzinsky
Copy link
Contributor Author

@ghuntley Can you take a look when you have a chance?

Copy link
Member

@olevett olevett left a comment

Choose a reason for hiding this comment

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

Thanks for this 👍

Couple of questions/thoughts but nothing major!

{
public void Register(Action<Func<object>, Type> registerFunction)
{
RxApp.TaskpoolScheduler = TaskPoolScheduler.Default;
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little wary of this for a couple of reasons

I'd be interested to know if there are problems if this line is omitted, or if it's fine without. I think I'd keep the PlatformRegistrations class however as it adds some value on it's own.

I also think it might be worth wiring up an IPlatformOperations even if it just returns null, as I think there are cases it would cause a warning to be logged otherwise (@ghuntley may disagree though...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • It looks like it is. Should I remove that setting from all of the platforms?
  • I'll set it to DefaultScheduler.Instance

The only place that logs a warning about a missing IPlatformOperations looks to be in RoutedViewHost, which is only available in builds using the Platforms/windows-common files.

Copy link
Member

Choose a reason for hiding this comment

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

I think don't worry about removing it everywhere for now, I think separate issue (smaller scope = nicer to review :))

Don't worry about the PlatformOperations then, does look like we shouldn't be hitting it at all :)

</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<Compile Include="Platforms\netcoreapp1.0\**\*.cs" />
Copy link
Member

Choose a reason for hiding this comment

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

Related to this, I'd add an additional PropertyGroup to Directory.build.targets for netcoreapp. I think it might make sense to define the NETFX_CORE constant there too, but can't remember what exactly that includes off the top of my head. Will double check when I get the chance.

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'll add the PropertyGroup, but I can't add the NETFX_CORE define since that define currently backs all usings of the Windows.UI.* namespaces.

Copy link
Member

Choose a reason for hiding this comment

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

That seems fine then, might be we want to make NETFX_CORE two separate defines in future, but don't think it should be in scope for this change.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.573% when pulling 730ff8b on jkoritzinsky:netcore into 91433b1 on reactiveui:develop.

@olevett olevett merged commit c1285aa into reactiveui:develop Aug 26, 2017
ghuntley pushed a commit that referenced this pull request Nov 6, 2017
glennawatson pushed a commit that referenced this pull request Mar 23, 2019
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants