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

Avalonia.FuncUI v1.0 release #222

Closed
4 of 11 tasks
sleepyfran opened this issue Oct 19, 2022 · 29 comments
Closed
4 of 11 tasks

Avalonia.FuncUI v1.0 release #222

sleepyfran opened this issue Oct 19, 2022 · 29 comments
Labels
chore Package upgrades, CI improvements and the like

Comments

@sleepyfran
Copy link
Member

sleepyfran commented Oct 19, 2022

Opening this issue to track the work needed before we release the non-pre-release version of v0.6

Before release

Since 4564a6d the DSL project lives inside of the main FuncUI package and upgrading from a previous version that has the a package reference to the DSL makes all this funky errors where half of the imports seem unused and all the controls stop working:
image

The fix is, of course, to remove the package reference to the DSL but I think we should make this clearer to the user.

After release

  • Create documentation for new inline components
  • Party? 🎉
@sleepyfran sleepyfran added the chore Package upgrades, CI improvements and the like label Oct 19, 2022
@JaggerJo
Copy link
Member

Like the Party 🎉 part of it 😁

@JaggerJo
Copy link
Member

I can deprecate the DSL package shortly before we plan to release the new version 👍

@JaggerJo
Copy link
Member

I'm not happy at all with the documentation situation right now. 🙃

@sleepyfran
Copy link
Member Author

I'm not happy at all with the documentation situation right now. 🙃

Yeah, actually I just realized that we have the GitBook under the Avalonia's domain up and working, I'll add another task here to sunset the current one we have (https://avaloniacommunity.github.io/Avalonia.FuncUI.Docs/) and add the one under Avalonia's domain to the README. What else do you think we should do to improve it? I'm all up for making the docs better, it's true that we're lacking a bit here.

@JaggerJo
Copy link
Member

Yes exactly, that's a good first step! (copying our docs over) 👍

I think we have a lot of good stuff in the docs, but it could use some polishing.

Getting started:
I don't think templates should be recommended that much.
I personally prefer to install some packages and pasting a few lines of code.
Might be just me tho.

Why? Needing templates implies complexity and for FuncUI all you really need is this (and the view could be reduced to a lot less code):

namespace Examples.CounterApp

open Avalonia
open Avalonia.Controls
open Avalonia.Controls.ApplicationLifetimes
open Avalonia.FuncUI
open Avalonia.FuncUI.DSL
open Avalonia.Layout
open Avalonia.Themes.Fluent
open Avalonia.FuncUI.Hosts

module Views =
    let counter =
        Component
            (fun ctx ->
                let state = ctx.useState 0

                DockPanel.create [
                    DockPanel.children [
                        Button.create [
                            Button.dock Dock.Bottom
                            Button.onClick (fun _ -> state.Current - 1 |> state.Set)
                            Button.content "-"
                            Button.horizontalAlignment HorizontalAlignment.Stretch
                        ]
                        Button.create [
                            Button.dock Dock.Bottom
                            Button.onClick (fun _ -> state.Current + 1 |> state.Set)
                            Button.content "+"
                            Button.horizontalAlignment HorizontalAlignment.Stretch
                        ]
                        TextBox.create [
                            TextBox.dock Dock.Bottom
                            TextBox.onTextChanged (
                                (fun text ->
                                    let isNumber, number = System.Int32.TryParse text
                                    if isNumber then number |> state.Set)
                            )
                            TextBox.text (string state.Current)
                            TextBox.horizontalAlignment HorizontalAlignment.Stretch
                        ]
                        TextBlock.create [
                            TextBlock.dock Dock.Top
                            TextBlock.fontSize 48.0
                            TextBlock.verticalAlignment VerticalAlignment.Center
                            TextBlock.horizontalAlignment HorizontalAlignment.Center
                            TextBlock.text (string state.Current)
                        ]
                    ]
                ])

type MainWindow() =
    inherit HostWindow()
    do
        base.Title <- "Counter Example"
        base.Height <- 400.0
        base.Width <- 400.0
        base.Content <- Main.view

type App() =
    inherit Application()

    override this.Initialize() =
        this.Styles.Add (FluentTheme(baseUri = null, Mode = FluentThemeMode.Dark))

    override this.OnFrameworkInitializationCompleted() =
        match this.ApplicationLifetime with
        | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime ->
            let mainWindow = MainWindow()
            desktopLifetime.MainWindow <- mainWindow
        | _ -> ()

module Program =

    [<EntryPoint>]
    let main(args: string[]) =
        AppBuilder
            .Configure<App>()
            .UsePlatformDetect()
            .UseSkia()
            .StartWithClassicDesktopLifetime(args)

@Numpsy
Copy link
Collaborator

Numpsy commented Nov 13, 2022

Hi,

As I mentioned in #232, it looks like version 11 of Avalonia.Web only supports .NET 7.0, so I guess that the FuncUI WebAssembly sample will need to be the same - and that would also mean that the CI builds would need changing to use the .NET 7 SDK rather than 6 - so, is that possible/acceptable? (I'm not sure if the github build pipelines have the new SDK available by default yet though)

@Numpsy
Copy link
Collaborator

Numpsy commented Jan 10, 2023

fyi, the Avalonia change at AvaloniaUI/Avalonia#9553 has removed a load of interfaces that FuncUI uses, apparently in favour of just using the base classes instead, which is an ever so slightly breaking change over here.

I had a quick go at changing the lib to just use the base clases instead of interfaces and the control catalogue seems to still run, but I didn't check anything beyond that

@sleepyfran
Copy link
Member Author

fyi, the Avalonia change at AvaloniaUI/Avalonia#9553 has removed a load of interfaces that FuncUI uses, apparently in favour of just using the base classes instead, which is an ever so slightly breaking change over here.

I had a quick go at changing the lib to just use the base clases instead of interfaces and the control catalogue seems to still run, but I didn't check anything beyond that

Oh, boy. Thanks for the heads up! I guess a search and replace of I.* should do the trick 😆 Adding that to the checklist

@Numpsy
Copy link
Collaborator

Numpsy commented Jan 23, 2023

Small nit about the nuget packages - the package description fields shown on nuget.org are just 'Package Description' - I think it'd look nicer if there were something useful there?

image

@Numpsy
Copy link
Collaborator

Numpsy commented Jan 29, 2023

On the subject of nuget packages - anyone have any opinions on adding SourceLink to the build?

@JaggerJo
Copy link
Member

On the subject of nuget packages - anyone have any opinions on adding SourceLink to the build?

Great idea!

@Numpsy
Copy link
Collaborator

Numpsy commented Feb 1, 2023

It looks like another breaking change has been made in Avalonia - the change at AvaloniaUI/Avalonia#10112 has moved ItemsRepeater into a separate nuget package, which breaks the bindings in the core FuncUI library.

So - what would the preferred approach to handling that change be?

@JaggerJo
Copy link
Member

JaggerJo commented Feb 1, 2023

Looks like we can get rid of the bindings.

@Numpsy
Copy link
Collaborator

Numpsy commented Mar 31, 2023

Hmm, I went to update to the new preview10 release and Visual Studio wasn't listing it as an update, and it seems that nuget thinks that preview10 is older than preview9 :-(

image

@JaggerJo
Copy link
Member

JaggerJo commented Apr 2, 2023

ahh, yeah :D everything after the - is string sorted. Changed the version to preview9.1

@JaggerJo JaggerJo closed this as completed Apr 2, 2023
@JaggerJo JaggerJo reopened this Apr 2, 2023
@Numpsy
Copy link
Collaborator

Numpsy commented Apr 25, 2023

I see that Avalonia 11 preview 7 was released over night, with another set of breaking changes to the Items/ItemsSource properties (we can but hope that's the last ones).

I'll try to have a go with it, and see how many changes there are

@JaggerJo
Copy link
Member

I see that Avalonia 11 preview 7 was released over night, with another set of breaking changes to the Items/ItemsSource properties (we can but hope that's the last ones).

I'll try to have a go with it, and see how many changes there are

Thanks for the ongoing effort, really appreciate it.

@Numpsy
Copy link
Collaborator

Numpsy commented May 31, 2023

Avalonia 11 has finally hit a release candidate build: AvaloniaUI/Avalonia#11593

@luojunyuan
Copy link

I get exception after upgrading to rc1

Unhandled exception. System.MethodAccessException: Attempt by method 'Avalonia.FuncUI.VirtualDom.VirtualDom.updateRoot(Avalonia.Controls.IContentControl, Microsoft.FSharp.Core.FSharpOption`1<IView>, Microsoft.FSharp.Core.FSharpOption`1<IView>)' to access method 'Avalonia.Controls.IContentControl.get_Content()' failed.
   at Avalonia.FuncUI.VirtualDom.VirtualDom.updateRoot(IContentControl host, FSharpOption`1 last, FSharpOption`1 next)

@Numpsy
Copy link
Collaborator

Numpsy commented Jun 2, 2023

The currently released FuncUI packages don't work with RC1 due to breaking API changes on the Avalonia side, it needs the changes in #308 to work

@JaggerJo
Copy link
Member

Think we should use a version > 1 for the next release.

@sleepyfran sleepyfran changed the title Avalonia.FuncUI v0.6 release Avalonia.FuncUI v1.0 release Jun 19, 2023
@Numpsy
Copy link
Collaborator

Numpsy commented Jun 20, 2023

Is it possible to get an RC1 compatible nuget package published? (I've been hung up on updating some things because I was waiting for an RC1 compatible build of TreeDataGrid, and that just dropped)

@JaggerJo
Copy link
Member

Is it possible to get an RC1 compatible nuget package published? (I've been hung up on updating some things because I was waiting for an RC1 compatible build of TreeDataGrid, and that just dropped)

Published a new version. If you'd be interested I could make you a co-maintainer. You have contributed quite a lot in the past - might make things easier.

@Numpsy
Copy link
Collaborator

Numpsy commented Jun 21, 2023

Published a new version. If you'd be interested I could make you a co-maintainer. You have contributed quite a lot in the past - might make things easier.

I don't mind doing that, though I never know how much time I'll have to look at things

@Numpsy
Copy link
Collaborator

Numpsy commented Jun 21, 2023

Does there need to be an updated version of the diagnostics package?

@JaggerJo
Copy link
Member

Published a new version. If you'd be interested I could make you a co-maintainer. You have contributed quite a lot in the past - might make things easier.

I don't mind doing that, though I never know how much time I'll have to look at things

Sent you an invitation.

Does there need to be an updated version of the diagnostics package?

We've never even released it under the new Avalonia.FuncUI.* name. If there is demand we could definitely auto release that package with FuncUI "core" versions.

@JaggerJo JaggerJo reopened this Jun 21, 2023
@Numpsy
Copy link
Collaborator

Numpsy commented Jul 5, 2023

AvaloniaUI/Avalonia#12041

@JaggerJo
Copy link
Member

JaggerJo commented Jul 6, 2023

I guess it's time to ship it 🚀

@JordanMarr
Copy link
Collaborator

Congrats on the release! You guys have been working hard. 👏

@JaggerJo JaggerJo closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Package upgrades, CI improvements and the like
Projects
None yet
Development

No branches or pull requests

5 participants