Skip to content

Commit 90fe2e7

Browse files
committed
Update to Fabulous 2.4.0
1 parent 4dc1b92 commit 90fe2e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+108
-93
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"fantomas": {
6-
"version": "5.2.0",
6+
"version": "6.2.3",
77
"commands": [
88
"fantomas"
99
]

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Check code formatting
1919
run: |
2020
dotnet tool restore
21-
dotnet fantomas --check -r src samples templates
21+
dotnet fantomas --check src samples templates
2222
- name: Restore
2323
run: dotnet restore ${SLN_FILE}
2424
- name: Build

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Release
22
on:
33
push:
4-
tags: ['[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-preview.[0-9]+']
4+
tags: ['[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-pre[0-9]+']
55
paths-ignore: [ 'docs/**' ]
66

77
permissions: write-all

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
No unreleased changes.
1111

12+
## [2.4.0] - 2023-11-22
13+
14+
### Changed
15+
- Updated to Fabulous 2.4.0
16+
1217
## [2.3.0] - 2023-06-30
1318

1419
### Changed
@@ -45,7 +50,8 @@ No unreleased changes.
4550
### Changed
4651
- Fabulous.XamarinForms has moved from the Fabulous repository to its own repository: [https://github.com/fabulous-dev/Fabulous.XamarinForms](https://github.com/fabulous-dev/Fabulous.XamarinForms)
4752

48-
[unreleased]: https://github.com/fabulous-dev/Fabulous.XamarinForms/compare/2.3.0...HEAD
53+
[unreleased]: https://github.com/fabulous-dev/Fabulous.XamarinForms/compare/2.4.0...HEAD
54+
[2.4.0]: https://github.com/fabulous-dev/Fabulous.XamarinForms/releases/tag/2.4.0
4955
[2.3.0]: https://github.com/fabulous-dev/Fabulous.XamarinForms/releases/tag/2.3.0
5056
[2.2.0]: https://github.com/fabulous-dev/Fabulous.XamarinForms/releases/tag/2.2.0
5157
[2.1.4]: https://github.com/fabulous-dev/Fabulous.XamarinForms/releases/tag/2.1.4

Directory.Packages.props

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageVersion Include="Fabulous" Version="2.3.2" />
9-
<PackageVersion Include="FsCheck.NUnit" Version="2.16.5" />
10-
<PackageVersion Include="FSharp.Android.Resource" Version="1.0.4" />
11-
<PackageVersion Include="FSharp.Core" Version="7.0.300" />
12-
<PackageVersion Include="FSharp.Data" Version="6.2.0" />
13-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
14-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
15-
<PackageVersion Include="NUnit" Version="3.13.3" />
8+
<PackageVersion Include="Fabulous" Version="2.4.0" />
9+
<PackageVersion Include="FsCheck.NUnit" Version="2.16.6" />
10+
<PackageVersion Include="FSharp.Android.Resource" Version="1.1.1" />
11+
<PackageVersion Include="FSharp.Core" Version="8.0.100" />
12+
<PackageVersion Include="FSharp.Data" Version="6.3.0" />
13+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
14+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
15+
<PackageVersion Include="NUnit" Version="3.14.0" />
1616
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
1717
<PackageVersion Include="Plugin.Permissions" Version="6.0.1" />
1818
<PackageVersion Include="sqlite-net-pcl" Version="1.8.116" />
1919
<PackageVersion Include="Xamarin.CommunityToolkit" Version="2.0.6" />
20-
<PackageVersion Include="Xamarin.Essentials" Version="1.7.6" />
21-
<PackageVersion Include="Xamarin.Forms" Version="5.0.0.2578" />
22-
<PackageVersion Include="Xamarin.Forms.Maps" Version="5.0.0.2578" />
20+
<PackageVersion Include="Xamarin.Essentials" Version="1.8.0" />
21+
<PackageVersion Include="Xamarin.Forms" Version="5.0.0.2622" />
22+
<PackageVersion Include="Xamarin.Forms.Maps" Version="5.0.0.2622" />
2323
<PackageVersion Include="Xamarin.Forms.PancakeView" Version="2.3.0.759" />
2424
<PackageVersion Include="Xam.Plugin.Media" Version="6.0.2" />
2525
</ItemGroup>

Fabulous.XamarinForms.sln

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution Files", "_Solutio
4848
README.md = README.md
4949
CHANGELOG.md = CHANGELOG.md
5050
LICENSE.md = LICENSE.md
51-
.gitignore = .gitignore
52-
pull_request.yml = .github/workflows/pull_request.yml
53-
build.yml = .github/workflows/build.yml
54-
release.yml = .github/workflows/release.yml
51+
.gitignore = .gitignore
52+
pull_request.yml = .github/workflows/pull_request.yml
53+
build.yml = .github/workflows/build.yml
54+
release.yml = .github/workflows/release.yml
55+
Directory.Packages.props = Directory.Packages.props
56+
Directory.Build.props = Directory.Build.props
5557
EndProjectSection
5658
EndProject
5759
Global

src/Fabulous.XamarinForms/Attributes.fs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ module AppTheme =
2121
[<Struct>]
2222
type ValueEventData<'data, 'eventArgs> =
2323
{ Value: 'data
24-
Event: 'eventArgs -> obj }
24+
Event: 'eventArgs -> MsgValue }
2525

2626
module ValueEventData =
27-
let create (value: 'data) (event: 'eventArgs -> obj) = { Value = value; Event = event }
27+
let create (value: 'data) (event: 'eventArgs -> 'msg) =
28+
{ Value = value
29+
Event = event >> box >> MsgValue }
2830

2931
/// Xamarin Forms specific attributes that can be encoded as 8 bytes
3032
module SmallScalars =
@@ -225,7 +227,7 @@ module Attributes =
225227
// Set the new event handler
226228
let handler =
227229
EventHandler<'args>(fun _ args ->
228-
let r = curr.Event args
230+
let (MsgValue r) = curr.Event args
229231
Dispatcher.dispatch node r)
230232

231233
node.SetHandler(name, ValueSome handler)

src/Fabulous.XamarinForms/Fabulous.XamarinForms.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
-->
141141
<PackageReference Include="FSharp.Core" VersionOverride="7.0.0" PrivateAssets="All" />
142142
<PackageReference Include="Xamarin.Forms" VersionOverride="5.0.0.1874" />
143-
<PackageReference Include="Fabulous" VersionOverride="[2.3.0, 2.4.0)" />
143+
<PackageReference Include="Fabulous" VersionOverride="[2.4.0, 2.5.0)" />
144144
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
145145
</ItemGroup>
146146
</Project>

src/Fabulous.XamarinForms/Views/Application.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ type ApplicationModifiers =
100100
/// Dispatch a message when the application starts
101101
[<Extension>]
102102
static member inline onStart(this: WidgetBuilder<'msg, #IApplication>, onStart: 'msg) =
103-
this.AddScalar(Application.Start.WithValue(onStart))
103+
this.AddScalar(Application.Start.WithValue(MsgValue onStart))
104104

105105
/// Dispatch a message when the application is paused by the OS
106106
[<Extension>]
107107
static member inline onSleep(this: WidgetBuilder<'msg, #IApplication>, onSleep: 'msg) =
108-
this.AddScalar(Application.Sleep.WithValue(onSleep))
108+
this.AddScalar(Application.Sleep.WithValue(MsgValue onSleep))
109109

110110
/// Dispatch a message when the application is resumed by the OS
111111
[<Extension>]
112112
static member inline onResume(this: WidgetBuilder<'msg, #IApplication>, onResume: 'msg) =
113-
this.AddScalar(Application.Resume.WithValue(onResume))
113+
this.AddScalar(Application.Resume.WithValue(MsgValue onResume))
114114

115115
/// Link a ViewRef to access the direct Application instance
116116
[<Extension>]

src/Fabulous.XamarinForms/Views/Cells/EntryCell.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module EntryCellBuilders =
4141
WidgetBuilder<'msg, IEntryCell>(
4242
EntryCell.WidgetKey,
4343
EntryCell.Label.WithValue(label),
44-
EntryCell.TextWithEvent.WithValue(ValueEventData.create text (fun args -> onTextChanged args.NewTextValue |> box))
44+
EntryCell.TextWithEvent.WithValue(ValueEventData.create text (fun (args: TextChangedEventArgs) -> onTextChanged args.NewTextValue))
4545
)
4646

4747
[<Extension>]
@@ -54,32 +54,32 @@ type EntryCellModifiers =
5454
this.AddScalar(EntryCell.LabelColor.WithValue(AppTheme.create light dark))
5555

5656
/// <summary>Set the horizontal text alignment</summary>
57-
/// param name="alignment">The horizontal text alignment</summary>
57+
/// <param name="alignment">The horizontal text alignment</param>
5858
[<Extension>]
5959
static member inline horizontalTextAlignment(this: WidgetBuilder<'msg, #IEntryCell>, alignment: TextAlignment) =
6060
this.AddScalar(EntryCell.HorizontalTextAlignment.WithValue(alignment))
6161

6262
/// <summary>Set the vertical text alignment</summary>
63-
/// param name="alignment">The vertical text alignment</summary>
63+
/// <param name="alignment">The vertical text alignment</param>
6464
[<Extension>]
6565
static member inline verticalTextAlignment(this: WidgetBuilder<'msg, #IEntryCell>, alignment: TextAlignment) =
6666
this.AddScalar(EntryCell.VerticalTextAlignment.WithValue(alignment))
6767

6868
/// <summary>Set the keyboard</summary>
69-
/// param name="keyboard">The keyboard type</summary>
69+
/// <param name="keyboard">The keyboard type</param>
7070
[<Extension>]
7171
static member inline keyboard(this: WidgetBuilder<'msg, #IEntryCell>, keyboard: Keyboard) =
7272
this.AddScalar(EntryCell.Keyboard.WithValue(keyboard))
7373

7474
/// <summary>Set the placeholder text</summary>
75-
/// param name="placeholder">The placeholder</summary>
75+
/// <param name="placeholder">The placeholder</param>
7676
[<Extension>]
7777
static member inline placeholder(this: WidgetBuilder<'msg, #IEntryCell>, placeholder: string) =
7878
this.AddScalar(EntryCell.Placeholder.WithValue(placeholder))
7979

8080
[<Extension>]
8181
static member inline onCompleted(this: WidgetBuilder<'msg, #IEntryCell>, onCompleted: 'msg) =
82-
this.AddScalar(EntryCell.OnCompleted.WithValue(onCompleted))
82+
this.AddScalar(EntryCell.OnCompleted.WithValue(MsgValue onCompleted))
8383

8484
/// <summary>Link a ViewRef to access the direct EntryCell control instance</summary>
8585
[<Extension>]

0 commit comments

Comments
 (0)