Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Move to Portable Libraries #217

Merged
merged 33 commits into from

4 participants

@paulcbetts
Owner

In ReactiveUI 5.0, support is being dropped for WP7.x and .NET 4.0, meaning that it makes more sense now to move to Portable Libraries.

Reorganize All The Things

Now that certain types have moved around in .NET 4.5 (most notably, ICommand is now in mscorlib), this becomes a more compelling proposition. Mainly:

  1. RxUI.Xaml now becomes more like RxUI.Cocoa or RxUI.Android - only providing platform-specific helpers.
  2. All of the commanding stuff moves into RxUI.Core
  3. ReactiveUI.Routing goes away, its stuff moves into RxUI.Core and RxUI.Xaml

TODO:

  • - Move ReactiveUI Core to PLib
  • - Reorganize everything
  • - Fix MakeRelease.ps1 to build Portable packages
@paulcbetts
Owner

@jlaanstra Can I rebase away these unrelated commits?

@jlaanstra
Owner

@xpaulbettsx you can certainly do that. Some commits are from changes I made myself to ReactiveUI. Although 353ae7d, dc29cfc and 2746e56 might be interesting to include.

@paulcbetts
Owner

@jlaanstra Agree, I'll cherry-pick them into a new PR

jlaanstra added some commits
@jlaanstra jlaanstra Work in progress portable library.
ReactiveCommand and ReactiveAsyncCommand moved to RxUI-Core
5399c97
@jlaanstra jlaanstra Renamed ReactiveUI_Portable to ReactiveUI.
Added _Net40 to .Net 4.0 projects.
Moved Validation.cs into RxUI-Xaml.
Updated projects to reference the Portable Library.
Lazy in its own file.
Linked Command classes and Interfaces into RxUI-Xaml for .Net 4.0
82fc6c8
@jlaanstra jlaanstra Fixed compile errors.
Fixed InternalsVisibleTo.
Temporarily handle unit test detection by returning false.
Change the namespace for PropertyChanging classes to work around namespace collision on .Net45. Need to think about the best way to handle this.
c5acf5b
@paulcbetts
Owner

Force-pushing away these commits, update your branch by running:

git checkout portable
git fetch
git reset origin/portable

For reference, the previous HEAD was 2823f2b

@paulcbetts paulcbetts referenced this pull request
Merged

Ship ReactiveUI 5.0 #219

4 of 8 tasks complete
jlaanstra added some commits
@jlaanstra jlaanstra Fix broken project files. 42809cb
@jlaanstra jlaanstra Move RxUI-Routing into RxUI-Core and RxUI-Xaml.
Move Validation back to RxUI-Core.
Validation classes are not available on WP and therefore currently cause compile errors.
c095e49
@jlaanstra
Owner

Validation classes such as ValidationAttribute and ValidationContext are not available in Portable Class Libraries.
I would like to propose some sort of syntax instead, which looks like WhenAny:

this.ValidationFor(x => x.SomeProperty, value => value != null, "error message");

What do you think?

@wendazhou
Owner

Validation is delicate in any case. The WPF Validation class is very much coupled with the binding system, and replacing it means replacing it wholesale (with creating our own adorners etc.). For example try googling "validation without binding", most solutions involve creating a fake binding or something similar. Yuck.

Maybe we could try an extensible validation framework? Portable and extensible side in the portable library, plug in from ReactiveUI.Xaml / ReactiveUI.Cocoa / ReactiveUI.Android

Also, I do think that validation should be with the binding, maybe an extension of the binding syntax. After all, it does modify what the binding needs to do significantly (we don't want to set the value of the binding if it fails validation), though I still quite like your syntax. We would have to intercept the property setting in this case I think.

@wendazhou
Owner

Also, just thought about that, you really want validation to be expressed on ViewModel side rather than view side actually. System.ComponentMode.DataAnnotations is not available on portable class library for WP, roll our own?

@wendazhou
Owner

And I just noticed that I said something inexact

After all, it does modify what the binding needs to do significantly

This is not true in the current IDataErrorInfo/INotifyDataErrorInfo framework that we have, as we set the property anyways and notify the error. Personally I think it would be better if the binding system didn't set the property in the case of a validation failure, but just reported the error so as to preserve the ViewModel invariants.

@paulcbetts
Owner

Maybe we could try an extensible validation framework? Portable and extensible side in the portable library, plug in from ReactiveUI.Xaml / ReactiveUI.Cocoa / ReactiveUI.Android

Now this is the kind of thinking I can get behind :)

Also, I do think that validation should be with the binding, maybe an extension of the binding syntax.

I'll have to think about how to do this elegantly - the binder is already super complicated as-is with type conversion and binding hooks.

@jlaanstra
Owner

The WPF Validation class seems to be pure UI based and not coupled to INotifyDataErrorInfo. Although it is of course the case that currently only Xaml Bindings work with INotifyDataErrorInfo.

@paulcbetts
Owner

While I'd be perfectly happy to kill all validation with :fire:, other people are super excited about it. It probably belongs in the New™ ReactiveUI.Xaml.

@jlaanstra jlaanstra Validation framework rebuilt on top of INotifyDataErrorInfo.
TODO: Add hooks for ValidationAttribute on supported platforms.
TODO: Tests
1a02145
@wendazhou wendazhou referenced this pull request
Closed

Rxui5 validation #225

jlaanstra and others added some commits
@jlaanstra jlaanstra Rename Validation to ReactiveValidatedObject.
Enable ValidationObservable.
6b11cee
@jlaanstra jlaanstra Make the ReactiveValidatedObjectTest run successfully with the rewrit…
…ten Validation.
9afa7b8
@jlaanstra jlaanstra Fix coding style to comply with style guidelines in CONTRIBUTING.md 12ffe77
@jlaanstra jlaanstra Removed backing field conventions.
Removed old WP7 stuff.
0a67c61
@niik niik Support property changes in derived collections
Adds support for updating derived collections when items in the source
collection changes (INPC). Changes to source items can result in items
being added to or removed from the derived collection as well as items
changing places (due to new sort conditions).

In order to make this possible I've moved all of the synchronization logic
into the RDC class itself and the class has been split into two parts. The
RDC<T> class is exposed to callers of CreateDerivedCollection (for
backwards compatibility and sanity) and RDC<TSource,TValue> which contains
the magic ingredient TSource (the type of the source collection items).

In order to support all scenarios of value and reference types, orderers
and no orderers filters and what not RDC now maintains a map between the
item indices and their corresponding indices in the source collection
allowing it to track and map changes in the origin collection to their
projected counterparts regardless of type and value/reference type
changes.

Also supports items existing in multiple places in the source collection
whether or not the selector is an identity function or if they're mapped
to value types.

This is a breaking change for the following reasons:
  * RDC constructor no longer accepts an IDisposable
  * RDC is now explicitly read only (modifying a derived collection makes
    no sense and now it's enforced. All modifying methods throws and the
    IsReadOnly property is set to true.

TODO:
  * CreateCollection is currently broken. I don't think it will be hard to
    fix it but I want to get some feedback on this change first.
  * One possible performance optimization would be to maintain an inverse
    map of source indices to destination indices which would allow for
    quicker lookups. Needs to be measured and weighed against increase
    complexity. Could also enable binary search for reverse lookup.
  * Another possible perf gain is to use binary search for
    positionForNewItem.
c46236c
@niik niik Getting rid of awkward reset overload
ReactiveDerivedCollection needs to override the implementation of Reset
while still being able to use SuppressChangeNotification. My previous
hack to allow this needs to be killed with fire so I'm adding
publishResetNotification to ReactiveCollection. It's not ideal but at
least it's better than the previous version.
08faf15
@niik niik Proper IDisposable implementation for RDC d7b3453
@niik niik Remove unused method param, consolidate methods e577bab
@niik niik Renaming internalInsert, removing unused method e32d411
@niik niik Make the strongly typed Add method virtual 1c395b5
@niik niik Make RDC base class readonly
Move all throwing read-only methods into RDC<T> and expose internal
read/write methods to implementing classes.
1ebba6e
@niik niik Re-enable CreateCollection
Moving logic into internal helper class based on
ReactiveDerivedCollection<T>.
c1c3147
@niik niik Typo a5aa5cc
@niik niik Reformat to fit in < 120 chars 2136776
@niik niik Make RDC private fields read only 31f7e08
@niik niik Avoid potentially wasteful compare call 181c289
@niik niik Adhere to coding conventions b08a0e6
@paulcbetts paulcbetts Fix up RxColl test c8a0e4f
@jlaanstra jlaanstra Simplify unit test detection and design mode detection.
Remove old platform directives.
Move UnitTestDetector and DesignModeDetector to their own files.
8b94898
@jlaanstra jlaanstra Remove obsolete #if's. Remove VariadicTemplates for WP7. 713978b
@paulcbetts paulcbetts Merge branch 'rxui5-master' into portable
Conflicts:
	ReactiveUI.Tests/ReactiveCollectionTest.cs
	ReactiveUI/ReactiveCollectionMixins.cs
8e04ce1
@paulcbetts paulcbetts Fix package generation script 032883f
@paulcbetts paulcbetts merged commit d07b3fc into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 21, 2013
  1. @jlaanstra @paulcbetts

    Work in progress portable library.

    jlaanstra authored paulcbetts committed
    ReactiveCommand and ReactiveAsyncCommand moved to RxUI-Core
  2. @jlaanstra @paulcbetts

    Renamed ReactiveUI_Portable to ReactiveUI.

    jlaanstra authored paulcbetts committed
    Added _Net40 to .Net 4.0 projects.
    Moved Validation.cs into RxUI-Xaml.
    Updated projects to reference the Portable Library.
    Lazy in its own file.
    Linked Command classes and Interfaces into RxUI-Xaml for .Net 4.0
  3. @jlaanstra @paulcbetts

    Fixed compile errors.

    jlaanstra authored paulcbetts committed
    Fixed InternalsVisibleTo.
    Temporarily handle unit test detection by returning false.
    Change the namespace for PropertyChanging classes to work around namespace collision on .Net45. Need to think about the best way to handle this.
  4. @paulcbetts
  5. @jlaanstra

    Fix broken project files.

    jlaanstra authored
  6. @jlaanstra

    Move RxUI-Routing into RxUI-Core and RxUI-Xaml.

    jlaanstra authored
    Move Validation back to RxUI-Core.
    Validation classes are not available on WP and therefore currently cause compile errors.
Commits on Mar 25, 2013
  1. @jlaanstra

    Validation framework rebuilt on top of INotifyDataErrorInfo.

    jlaanstra authored
    TODO: Add hooks for ValidationAttribute on supported platforms.
    TODO: Tests
Commits on Mar 27, 2013
  1. @paulcbetts
  2. @paulcbetts
  3. @paulcbetts

    RIP Silverlight and WP7

    paulcbetts authored
  4. @paulcbetts
Commits on Mar 29, 2013
  1. @jlaanstra

    Rename Validation to ReactiveValidatedObject.

    jlaanstra authored
    Enable ValidationObservable.
  2. @jlaanstra
Commits on Mar 30, 2013
  1. @jlaanstra
  2. @jlaanstra

    Removed backing field conventions.

    jlaanstra authored
    Removed old WP7 stuff.
Commits on Apr 1, 2013
  1. @niik @paulcbetts

    Support property changes in derived collections

    niik authored paulcbetts committed
    Adds support for updating derived collections when items in the source
    collection changes (INPC). Changes to source items can result in items
    being added to or removed from the derived collection as well as items
    changing places (due to new sort conditions).
    
    In order to make this possible I've moved all of the synchronization logic
    into the RDC class itself and the class has been split into two parts. The
    RDC<T> class is exposed to callers of CreateDerivedCollection (for
    backwards compatibility and sanity) and RDC<TSource,TValue> which contains
    the magic ingredient TSource (the type of the source collection items).
    
    In order to support all scenarios of value and reference types, orderers
    and no orderers filters and what not RDC now maintains a map between the
    item indices and their corresponding indices in the source collection
    allowing it to track and map changes in the origin collection to their
    projected counterparts regardless of type and value/reference type
    changes.
    
    Also supports items existing in multiple places in the source collection
    whether or not the selector is an identity function or if they're mapped
    to value types.
    
    This is a breaking change for the following reasons:
      * RDC constructor no longer accepts an IDisposable
      * RDC is now explicitly read only (modifying a derived collection makes
        no sense and now it's enforced. All modifying methods throws and the
        IsReadOnly property is set to true.
    
    TODO:
      * CreateCollection is currently broken. I don't think it will be hard to
        fix it but I want to get some feedback on this change first.
      * One possible performance optimization would be to maintain an inverse
        map of source indices to destination indices which would allow for
        quicker lookups. Needs to be measured and weighed against increase
        complexity. Could also enable binary search for reverse lookup.
      * Another possible perf gain is to use binary search for
        positionForNewItem.
  2. @niik @paulcbetts

    Getting rid of awkward reset overload

    niik authored paulcbetts committed
    ReactiveDerivedCollection needs to override the implementation of Reset
    while still being able to use SuppressChangeNotification. My previous
    hack to allow this needs to be killed with fire so I'm adding
    publishResetNotification to ReactiveCollection. It's not ideal but at
    least it's better than the previous version.
  3. @niik @paulcbetts

    Proper IDisposable implementation for RDC

    niik authored paulcbetts committed
  4. @niik @paulcbetts

    Remove unused method param, consolidate methods

    niik authored paulcbetts committed
  5. @niik @paulcbetts

    Renaming internalInsert, removing unused method

    niik authored paulcbetts committed
  6. @niik @paulcbetts

    Make the strongly typed Add method virtual

    niik authored paulcbetts committed
  7. @niik @paulcbetts

    Make RDC base class readonly

    niik authored paulcbetts committed
    Move all throwing read-only methods into RDC<T> and expose internal
    read/write methods to implementing classes.
  8. @niik @paulcbetts

    Re-enable CreateCollection

    niik authored paulcbetts committed
    Moving logic into internal helper class based on
    ReactiveDerivedCollection<T>.
  9. @niik @paulcbetts

    Typo

    niik authored paulcbetts committed
  10. @niik @paulcbetts

    Reformat to fit in < 120 chars

    niik authored paulcbetts committed
  11. @niik @paulcbetts

    Make RDC private fields read only

    niik authored paulcbetts committed
  12. @niik @paulcbetts

    Avoid potentially wasteful compare call

    niik authored paulcbetts committed
  13. @niik @paulcbetts

    Adhere to coding conventions

    niik authored paulcbetts committed
  14. @paulcbetts

    Fix up RxColl test

    paulcbetts authored
Commits on Apr 2, 2013
  1. @jlaanstra

    Simplify unit test detection and design mode detection.

    jlaanstra authored
    Remove old platform directives.
    Move UnitTestDetector and DesignModeDetector to their own files.
  2. @jlaanstra
Commits on Apr 4, 2013
  1. @paulcbetts

    Merge branch 'rxui5-master' into portable

    paulcbetts authored
    Conflicts:
    	ReactiveUI.Tests/ReactiveCollectionTest.cs
    	ReactiveUI/ReactiveCollectionMixins.cs
  2. @paulcbetts
Something went wrong with that request. Please try again.