Skip to content

Commit

Permalink
Merge pull request #69 from fabulous-dev/clean-mvu-component
Browse files Browse the repository at this point in the history
Update to .NET 9.0 and cleanly separate MVU and Component specific modifiers
  • Loading branch information
TimLariviere authored Nov 14, 2024
2 parents 6413752 + 97a0c3e commit f33f868
Show file tree
Hide file tree
Showing 213 changed files with 5,234 additions and 4,242 deletions.
5 changes: 3 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"fantomas": {
"version": "6.2.3",
"version": "6.3.16",
"commands": [
"fantomas"
]
],
"rollForward": false
}
}
}
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ env:
TEMPLATE_PROJ: templates/Fabulous.MauiControls.Templates.proj
TEMPLATE_PKG: nupkgs/Fabulous.MauiControls.Templates
NUPKG_FOLDER: nupkgs
XCODE_PATH: /Applications/Xcode_15.2.app/Contents/Developer
XCODE_PATH: /Applications/Xcode_16.0.app/Contents/Developer

jobs:
build:
runs-on: macos-13
runs-on: macos-15
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Use correct Xcode version
run: sudo xcode-select -s ${XCODE_PATH}
- name: Install dotnet workload
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ on: pull_request
env:
SLN_FILE: Fabulous.MauiControls.NoSamples.sln
CONFIG: Release
XCODE_PATH: /Applications/Xcode_15.0.1.app/Contents/Developer
XCODE_PATH: /Applications/Xcode_16.0.app/Contents/Developer

jobs:
pull_request:
runs-on: macos-13
runs-on: macos-15
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup .NET
- name: Setup .NET for Fantomas
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Check code formatting
run: |
dotnet tool restore
dotnet fantomas --check src samples templates
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.x
- name: Use correct Xcode version
run: sudo xcode-select -s ${XCODE_PATH}
- name: Install dotnet workload
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ env:
CONFIG: Release
SLN_FILE: Fabulous.MauiControls.NoSamples.sln
TEMPLATE_PROJ: templates/Fabulous.MauiControls.Templates.proj
XCODE_PATH: /Applications/Xcode_15.0.1.app/Contents/Developer
XCODE_PATH: /Applications/Xcode_16.0.app/Contents/Developer

jobs:
release:
runs-on: macos-13
runs-on: macos-15
environment: nuget
steps:
- name: Checkout sources
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Use correct Xcode version
run: sudo xcode-select -s ${XCODE_PATH}
- name: Install dotnet workload
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

_No unreleased changes_

## [9.0.0-pre1] - 2024-11-14

### Added
- Added HybridWebView widget
- Added TitleBar widget
- Added PointerGestureRecognizer widget
- Added hideSoftInputOnTapped modifier on ContentPage widget

### Changed
- Upgraded to .NET MAUI 9.0.0
- Upgraded to Fabulous 3.0.0-pre10
- Removed custom TimeSelected event from TimePicker widget to use the standard TimeSelected event from MAUI

### Removed
- Removed MainPage support on Application widget

## [8.1.0-pre21] - 2024-11-08

### Fixed
Expand Down Expand Up @@ -260,7 +276,8 @@ Essentially v2.8.1 and v8.0.0 are similar except for the required .NET version.
### Changed
- Fabulous.MauiControls has moved from the Fabulous repository to its own repository: [https://github.com/fabulous-dev/Fabulous.MauiControls](https://github.com/fabulous-dev/Fabulous.MauiControls)

[unreleased]: https://github.com/fabulous-dev/Fabulous.MauiControls/compare/8.1.0-pre21...HEAD
[unreleased]: https://github.com/fabulous-dev/Fabulous.MauiControls/compare/9.0.0-pre1...HEAD
[9.0.0-pre1]: https://github.com/fabulous-dev/Fabulous.MauiControls/releases/tag/9.0.0-pre1
[8.1.0-pre21]: https://github.com/fabulous-dev/Fabulous.MauiControls/releases/tag/8.1.0-pre21
[8.1.0-pre20]: https://github.com/fabulous-dev/Fabulous.MauiControls/releases/tag/8.1.0-pre20
[8.1.0-pre19]: https://github.com/fabulous-dev/Fabulous.MauiControls/releases/tag/8.1.0-pre19
Expand Down
18 changes: 9 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Fabulous" Version="3.0.0-pre9" />
<PackageVersion Include="Fabulous" Version="3.0.0-pre10" />
<PackageVersion Include="FsCheck.NUnit" Version="2.16.6" />
<PackageVersion Include="FSharp.Core" Version="8.0.200" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="FSharp.Core" Version="9.0.100" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="FSharp.Maui.WinUICompat" Version="1.1.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="8.0.14" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
</ItemGroup>

</Project>
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ let update msg model =
| Decrement -> { model with Count = model.Count - 1 }
let view model =
Application(
ContentPage(
VStack(spacing = 16.) {
Image("fabulous.png")
Label($"Count is {model.Count}")
Button("Increment", Increment)
Button("Decrement", Decrement)
Application() {
Window() {
ContentPage() {
VStack(spacing = 16.) {
Image("fabulous.png")
Label($"Count is {model.Count}")
Button("Increment", Increment)
Button("Decrement", Decrement)
}
}
)
)
}
}
```

## Getting Started
Expand Down
84 changes: 43 additions & 41 deletions samples/Calculator/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -106,47 +106,49 @@ module App =
.background(orange)
.textColor(Colors.Black)

Application(
ContentPage(
(Grid(rowdefs = [ Star; Star; Star; Star; Star; Star ], coldefs = [ Star; Star; Star; Star ]) {
View
.Label(display model)
.font(size = 48.0, attributes = FontAttributes.Bold)
.background(Colors.Black)
.textColor(Colors.White)
.alignEndTextHorizontal()
.centerTextVertical()
.gridColumnSpan(4)

mkNumberButton 7 1 0
mkNumberButton 8 1 1
mkNumberButton 9 1 2
mkNumberButton 4 2 0
mkNumberButton 5 2 1
mkNumberButton 6 2 2
mkNumberButton 1 3 0
mkNumberButton 2 3 1
mkNumberButton 3 3 2

(mkNumberButton 0 4 0).gridColumnSpan(3)

mkOperatorButton "÷" Divide 1 3
mkOperatorButton "×" Multiply 2 3
mkOperatorButton "-" Subtract 3 3
mkOperatorButton "+" Add 4 3
(mkButton "A" Clear 5 0).background(gray).textColor(Colors.White)
(mkButton "." Equals 5 1).background(orange).textColor(Colors.Black)

(mkButton "=" Equals 5 2)
.background(orange)
.gridColumnSpan(2)
.textColor(Colors.White)
})
.rowSpacing(1.0)
.columnSpacing(1.0)
.background(gray)
)
)
Application() {
Window() {
ContentPage(
(Grid(rowdefs = [ Star; Star; Star; Star; Star; Star ], coldefs = [ Star; Star; Star; Star ]) {
View
.Label(display model)
.font(size = 48.0, attributes = FontAttributes.Bold)
.background(Colors.Black)
.textColor(Colors.White)
.alignEndTextHorizontal()
.centerTextVertical()
.gridColumnSpan(4)

mkNumberButton 7 1 0
mkNumberButton 8 1 1
mkNumberButton 9 1 2
mkNumberButton 4 2 0
mkNumberButton 5 2 1
mkNumberButton 6 2 2
mkNumberButton 1 3 0
mkNumberButton 2 3 1
mkNumberButton 3 3 2

(mkNumberButton 0 4 0).gridColumnSpan(3)

mkOperatorButton "÷" Divide 1 3
mkOperatorButton "×" Multiply 2 3
mkOperatorButton "-" Subtract 3 3
mkOperatorButton "+" Add 4 3
(mkButton "A" Clear 5 0).background(gray).textColor(Colors.White)
(mkButton "." Equals 5 1).background(orange).textColor(Colors.Black)

(mkButton "=" Equals 5 2)
.background(orange)
.gridColumnSpan(2)
.textColor(Colors.White)
})
.rowSpacing(1.0)
.columnSpacing(1.0)
.background(gray)
)
}
}

let program =
Program.stateful (fun () -> Initial) update
Expand Down
10 changes: 5 additions & 5 deletions samples/Calculator/Calculator.fsproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>TicTacToe</RootNamespace>
<UseMaui>true</UseMaui>
Expand All @@ -24,8 +24,8 @@

<TargetPlatformIdentifier Condition=" $(TargetPlatformIdentifier) == '' ">$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>

<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetPlatformIdentifier) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
Expand Down
16 changes: 2 additions & 14 deletions samples/Components/HelloComponent/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,9 @@ open Microsoft.Maui.Hosting

open type Fabulous.Maui.View

module App =
module App =
let view () =
Component("root") {
Application() {
Window() {
ContentPage() {
(VStack() {
Label("Hello Component")
.centerTextHorizontal()
})
.centerVertical()
}
}
}
}
Component("root") { Application() { Window() { ContentPage() { (VStack() { Label("Hello Component").centerTextHorizontal() }).centerVertical() } } } }

let createMauiApp () =
MauiApp.CreateBuilder().UseFabulousApp(view).Build()
8 changes: 4 additions & 4 deletions samples/Components/HelloComponent/HelloComponent.fsproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-android;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net9.0-ios;net9.0-android;net9.0-maccatalyst</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand All @@ -22,8 +22,8 @@

<TargetPlatformIdentifier Condition=" $(TargetPlatformIdentifier) == '' ">$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>

<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetPlatformIdentifier) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetPlatformIdentifier) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
Expand Down
Loading

0 comments on commit f33f868

Please sign in to comment.