-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate core Rx libs into single library/package #199
Comments
I've heard this complaint constantly in my libraries that use Rx, +:100: to having a single library. There's no non-bananas use-case to have version X of Rx-Interfaces and version Y of Rx-Core |
Agree with @paulcbetts that Would Platform Services disappear in the .NET Standard world? I have thought before that the packages could be stripped back to I obviously don't want to have to pull Xaml/WPF/UWP/SL/Winform dependencies for Console/Web/Server applications or libraries. |
Like @LeeCampbell I always pull in Rx-Linq and have never seen any benefit with to separating Rx-Linq, Rx-Core and Rx-Interfaces so I am in favour of these being merged. My instinct would be to keep the UI specific libraries separate as I only use these when necessary. |
What's the name of the WPF package now? TIA |
Looks like the right one, thank you. I would suggest to put a verbose description on all the available packages or at least in the readme.md of this repo. |
@raffaeler would you be interested in submitting a PR to do this? There's a list of the nuspec files for |
When writing these tests I thought that it would be cool to factor out all the various xDisposable classes. They are definitely useful even outside the Rx context. |
There's a possible case where we might want to keep the Interfaces library separated. Some operators in Ix.Async should have an overload that takes an IScheduler, e.g. AsyncEnumerable.ToObservable. It's synchronous counterpart in Rx (to convert IEnumerable to IObservable) has an overload that schedules calls to MoveNext. I agree that the use of scheduling a synchronous operation (IEnumerator.MoveNext) is more obvious than the use of scheduling an asynchronous operation (IAsyncEnumerator.MoveNext), however, it might still be useful. |
I'm still on the fence about this one. I can't seem to convince myself that the separation is necessary, nor that it makes sense to change it at this point. What's the benefit of separate libraries? Core and Linq seem like a nice organizational separation, and in fact Core is 113 KB while Linq is 693 KB. Core provides types that implement the Rx contracts over the native The Interfaces library seems like a nice separation too, until you notice that it's only 24 KB. But more importantly, these interfaces have the Rx contracts on them implicitly; it's not like some program can interoperate over those interfaces with a third-party API, where one uses them with Rx's strict contracts and the other does whatever it wants. Therefore, perhaps Interfaces should be merged with Core, even if still separated from Linq and PlatformServices. So what's the benefit of creating one library out of the Interfaces, Core, Linq and PlatformServices? It's to ease some people's fears that Rx is "big and heavy". And who are these people? I haven't run into that problem yet. And so what if they think that? They're wrong, unless they actually think that ~1 MB is large and heavy for a small set of libraries that implements a stable, mathematically sound, reactive programming paradigm with complete implementations for LINQ Standard Operators and expression trees. -- I figured somebody had to try and at least defend the separation, otherwise we're not being totally honest :-) |
I myself also used to add Rx-Linq to everything and it was just fine, so I'm all for unification of Core and Linq with one or two exceptions:
If anyone can see the necessity of using the Rx scheduler interfaces in Ix or elsewhere, these should probably be left separated. I can see the point about Rx's strict contracts but don't think that package layout will keep anybody from using any interfaces as he or she pleases. After all, isn't that good design, separating interfaces from implementations? So I would vote for: Interfaces+Disposables+(Reactive.Core&Linq) or Interfaces+Disposables+Schedulers+(Reactive.Core&Linq). |
We've talked a bunch here about how to structure things, and I worry about things going more side-tracked without resolving this. Things like "Disposables should be a standalone thing" and "Schedulers should be available in Ix.NET" are very interesting proposals, on top of what we were originally discussing. If I help organize some sort of RFC-esque process not unlike the I mostly want to do this so:
Thoughts? |
Here's a justification for doing this... Implemeting #205, while solving the issue caused by loading an earlier assembly version, has caused lots of confusion and pain. Here's sample of issues related here: And those are just the people who bothered to report issues. Consolidating into a single As to the other ideas about a separate disposables or schedulers, library, we can do that for the next version. The goal here is a fairly quick release that solves the pain above. The downside here is that it's a breaking change (hence the major version increment) because you can't use a binding redirect out of this. We'll be introducing a new dll, so you can use v3 and v4 SxS, but a common library that needs v3 won't "just work" with v4...at least not easily. If this is a show-stopper, we might be able to create a compatibility package that includes TypeForwarders. Extracting schedulers and disposables in the future could be made non-breaking by way of TypeForwarders. |
Unless we have significant reasons to avoid it, I'm also 👍 for doing this with v4 |
Looks like there's a few options for tooling for creating a set of TypeForwarders. This would ensure compat between v3 and v4: https://github.com/dotnet/buildtools/tree/master/src/GenFacades There'd be a |
A quick update - I have an early cut at this here in the v4.0-proto branch: It combines most of the libraries into System.Reactive and targets netstandard 1.3, net45, net46 and uap10.0. There’s very few differences between the platforms these days. The main difference with uap over netstandard is support for the winrt bits and no thread/threadpool. Xamarin gets netstandard 1.3. net45 and net46 are mostly the same as netstandard 1.3 with the addition of the platform-specific bits there (forms/wpf/remoting). The only diff between 4.5 and 4.6 is support for TaskCompletionSource.TrySetCanceled(CancellationToken). Net45 doesn’t support that; the others do. The two libs that are separate are:
I still need to re-wire packaging, signing and the test projects. I also have not yet actually moved the files to minimize merge/rebasing issues until we're ready. |
This is now complete and available on the MyGet feed |
I'm trying to use System.Reactive in a UWP app but it adds 9MB to a 30MB app which is a problem as we are highly space constrained. Is my best bet to stick with v3? |
Right now the core of Rx is split into many smaller libraries. There were many reasons why this was done for 2.0 but today it seems like extra complexity and provides a negative perception of Rx as "big and heavy".
Further, most people don't really download "just the interfaces" or just bits and pieces as evidenced by these recent download stats from NuGet.org:
The above table show that most people download all of the core libraries together with a few people skipping the meta-package (Rx-Main).
This proposal is to take the core libraries and combine them into a single dll and package (System.Reactive). With
xproj
and whatever that morphs into with MSBuild, cross-compiling many libraries is much easier than it was in the past, so it's easy to light-up as much as possible per platform.The text was updated successfully, but these errors were encountered: