Skip to content
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

[12.0] Avoid Reactive types in the public API #8

Open
maxkatz6 opened this issue Nov 2, 2024 · 3 comments · May be fixed by #9
Open

[12.0] Avoid Reactive types in the public API #8

maxkatz6 opened this issue Nov 2, 2024 · 3 comments · May be fixed by #9
Labels
enhancement New feature or request

Comments

@maxkatz6
Copy link
Contributor

maxkatz6 commented Nov 2, 2024

There are several places, where API expects developer to work with System.Reactive library.
Most of these references come from CompositeDisposable type. Such as:
https://github.com/wieslawsoltes/Avalonia.Xaml.Behaviors/blob/master/src/Avalonia.Xaml.Interactions.Custom/Core/DisposingBehavior.cs#L30

It's possible to keep the same functionality by replacing this method definition with:

-protected abstract void OnAttached(CompositeDisposable disposables);
+protected abstract IDisposable OnAttached();

Where it's up to the implementation details to know what's behind IDisposable.
This is a breaking change, so can only be considered in 12.0.

@wieslawsoltes wieslawsoltes added the enhancement New feature or request label Nov 2, 2024
@wieslawsoltes
Copy link
Owner

There are several places, where API expects developer to work with System.Reactive library. Most of these references come from CompositeDisposable type. Such as: https://github.com/wieslawsoltes/Avalonia.Xaml.Behaviors/blob/master/src/Avalonia.Xaml.Interactions.Custom/Core/DisposingBehavior.cs#L30

It's possible to keep the same functionality by replacing this method definition with:

-protected abstract void OnAttached(CompositeDisposable disposables);
+protected abstract IDisposable OnAttached();

One issue is that OnAttached would conflict with existing OnAtatched that did not have any parameters.

We would need something like:

protected abstract IDisposable OnAttachedOverride();

@wieslawsoltes
Copy link
Owner

Another issue is DisposingBehavior was inherited by AttachedToVisualTreeBehavior that stored disposable to use later by OnAttachedToVisualTree

@wieslawsoltes wieslawsoltes linked a pull request Nov 3, 2024 that will close this issue
@wieslawsoltes
Copy link
Owner

@maxkatz6 I opened draft PR to see what it would take to do #9 if you have any input it would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants