Skip to content

Breaking API changes that have to be done before next major release #3538

Closed

Description

@kekekeks

This is a tracking issue

While Avalonia is ready for use, we can't really claim that it's 1.0 when we know that certain areas have to be changed in incompatible ways to work properly on various platforms and in various environments.

There will most likely be 0.10, 0.11 and probably 0.12 releases, but for widespread Avalonia adoption we need a promise of long-term API stability.

After 1.0 we'll still be allowed to deprecate things, but we'll have to keep a compatibility layer for several releases after a feature was deprecated.

So one of the goals in 2020 and probably the start of 2021 would be to focus on such "breaking-change-prone" areas so we could finally release the long awaited 1.0.

Public API contract note

Everything with Impl suffix is considered a private implementation detail without any API/ABI compatibility guarantees whatsoever (BTW, we need to add a wrapper for IClipboardImpl, it's been years already). Those can change in any way even in minor version releases.

Stuff in platform backens other than XXXPlatformOptions and UseXXX is also not considered to be a stable API. If we need something platform-specific, we still need an API that's not bound to a platform backend. So in general platform backends shouldn't have any public types, unless those are required to setup/configure the backend.

Solution-wide internal APIs

We are likely to have some helper methods or classes, that are reusable in the code base, but don't necessary have to be included in the public API contract. So we probably need some kind of Cecil-based post-processing, that would:

  1. transform
[InternalApi]
public Something()

to

internal Something()
  1. add [InternalsVisibleTo] attributes

That would ensure that project-private APIs wont be leaked, but non-public API parts would be still hidden.

Another way is to transform [Internal] to [Obsolete("This API is considered to be private to Avalonia and can be changed in incompatible way at any time")].

Known areas that would cause breaking changes:

Things to investigate:

  • Changes needed for Wayland protocol support (preferably with a prototype)
  • Changes needed for iOS/Android support (aside from ones listed in the roadmap)

Activity

  1. pinned this issue on Feb 11, 2020
  2. unpinned this issue on Feb 14, 2020
  3. pinned this issue on Feb 14, 2020
  4. Shayan-To commented on Nov 10, 2020

    @Shayan-To

    Is Avalonia using / going to use Microsoft.Extensions packages for configurations, dependency injection, etc.?

  5. kekekeks commented on Nov 10, 2020

    @kekekeks
    MemberAuthor

    The generic host model provided by Microsoft.Extensions isn't really suitable for Avalonia needs, unfortunately

    Dependency injection should be managed managed by MVVM framework (Prism, ReactiveUI, etc), not the UI toolkit.

  6. koalarcoder commented on Jun 3, 2021

    @koalarcoder

    when will we have 1.0 version,thank you

  7. fubar-coder commented on Nov 11, 2021

    @fubar-coder

    Regarding internal APIs: Microsoft uses special "ref" assemblies (e.g. for Microsoft.Extensions.Configuration.Abstractions). This allows a very fine control regarding the API to be exposed.

    EDIT: This also means that you can still have "internal" code which is defined as public, but is not available when consumed via nuget.

  8. added this to the 11.0 milestone on Feb 21, 2022
  9. robloo commented on Mar 16, 2022

    @robloo
    Contributor

    I think ContextMenu should now be removed as it is better replaced with ContextFlyout which can host a MenuFlyout. This moves from the WPF way of doing things to the UWP way which is better generalized and more powerful.

  10. kekekeks commented on Mar 16, 2022

    @kekekeks
    MemberAuthor

    IIRC we've decided to keep ContextMenu as a legacy but still supported API to simplify porting from WPF

  11. robloo commented on Mar 16, 2022

    @robloo
    Contributor

    IIRC we've decided to keep ContextMenu as a legacy but still supported API to simplify porting from WPF

    I know when Flyout was implemented and ContextMenu was marked as obsolete there was some uproar. ContextMenu was quickly un-obsoleted. I hope that isn't the permanent plan though.

  12. jogibear9988 commented on Apr 2, 2022

    @jogibear9988

    You could also declare the classes as "internal" and use them from other assemblies via:
    https://github.com/aelij/IgnoresAccessChecksToGenerator

    aelij uses this in roslynpad to access internals of roslyn

  13. unpinned this issue on Apr 9, 2022
  14. CollinAlpert commented on May 30, 2022

    @CollinAlpert
    Contributor

    I just noticed the TextBlocks for DatePicker are called DayText, MonthText and YearText. For TimePicker however, they are called MinuteTextBlock and HourTextBlock. Maybe this is something which should be unified for the next major release.

  15. maxkatz6 commented on May 30, 2022

    @maxkatz6
    Member

    @CollinAlpert it's just a x:Name properties? Yes, it can be changed with no problems, if you want to create a PR.

  16. CollinAlpert commented on May 30, 2022

    @CollinAlpert
    Contributor

    @maxkatz6 it's also a TemplatePart, so some users might use it in styling. That would break if the name changes.

  17. robloo commented on May 30, 2022

    @robloo
    Contributor

    @CollinAlpert If its a template part I recommend adding the PART_ prefix as well while you are at it. Otherwise, I'll get to it later.

  18. robloo commented on Sep 11, 2022

    @robloo
    Contributor

    Roll-up of some things I think should be addressed:

    • Finally mark ContextMenu as [Obsolete] by flyout. Remove this in 12.0 or something altogether with the menu rewrites.
    • Items vs ItemsSource breaking change
    • Parents clipping children by default with the new composition render (I think this is supported just not enabled by default). UWP different from WPF here and UWP/WinUI is a lot more intuitive.
  19. changed the title [-]Breaking API changes that have to be done before 1.0 release[/-] [+]Breaking API changes that have to be done before next major release[/+] on Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions