Skip to content

Commit ed54775

Browse files
committed
Merge branch 'main' into release/3.0
2 parents 1c19484 + 8bd2605 commit ed54775

File tree

4 files changed

+12
-52
lines changed

4 files changed

+12
-52
lines changed

CHANGELOG.md

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

1010
_No unreleased changes_
1111

12+
## [3.0.0-pre16] - 2024-11-22
13+
14+
### Changed
15+
- Small optimization when building for AOT by @TimLariviere
16+
17+
### Removed
18+
- Removed `SingleChildBuilder` due to its big impact on AOT compilation compared to the low benefits on development experience by @TimLariviere
19+
1220
## [3.0.0-pre15] - 2024-11-21
1321

1422
### Added
@@ -192,7 +200,8 @@ _No unreleased changes_
192200
### Changed
193201
- Fabulous.XamarinForms & Fabulous.MauiControls have been moved been out of the Fabulous repository. Find them in their own repositories: [https://github.com/fabulous-dev/Fabulous.XamarinForms](https://github.com/fabulous-dev/Fabulous.XamarinForms) / [https://github.com/fabulous-dev/Fabulous.MauiControls](https://github.com/fabulous-dev/Fabulous.MauiControls)
194202

195-
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/3.0.0-pre15...HEAD
203+
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/3.0.0-pre16...HEAD
204+
[3.0.0-pre16]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre16
196205
[3.0.0-pre15]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre15
197206
[3.0.0-pre14]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre14
198207
[3.0.0-pre13]: https://github.com/fabulous-dev/Fabulous/releases/tag/3.0.0-pre13

src/Fabulous/Array.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module ArraySlice =
4949
module Array =
5050
let inline appendOne (v: 'v) (arr: 'v array) =
5151
let res = Array.zeroCreate(arr.Length + 1)
52-
Array.blit arr 0 res 0 arr.Length
52+
res[..arr.Length - 1] <- arr
5353
res[arr.Length] <- v
5454
res
5555

src/Fabulous/Builders.fs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -279,52 +279,3 @@ type AttributeCollectionBuilder<'msg, 'marker, 'itemMarker when 'msg: equality>
279279

280280
res
281281
end
282-
283-
type SingleChildBuilderStep<'msg, 'marker when 'msg: equality> = delegate of unit -> WidgetBuilder<'msg, 'marker>
284-
285-
[<Struct>]
286-
type SingleChildBuilder<'msg, 'marker, 'childMarker when 'msg: equality> =
287-
val WidgetKey: WidgetKey
288-
val Attr: WidgetAttributeDefinition
289-
val AttributesBundle: AttributesBundle
290-
291-
new(widgetKey: WidgetKey, attr: WidgetAttributeDefinition) =
292-
{ WidgetKey = widgetKey
293-
Attr = attr
294-
AttributesBundle = AttributesBundle(StackList.empty(), ValueNone, ValueNone, ValueNone) }
295-
296-
new(widgetKey: WidgetKey, attr: WidgetAttributeDefinition, attributesBundle: AttributesBundle) =
297-
{ WidgetKey = widgetKey
298-
Attr = attr
299-
AttributesBundle = attributesBundle }
300-
301-
member inline this.Yield(widget: WidgetBuilder<'msg, 'childMarker>) =
302-
SingleChildBuilderStep(fun () -> widget)
303-
304-
member inline this.Combine
305-
([<InlineIfLambda>] a: SingleChildBuilderStep<'msg, 'childMarker>, [<InlineIfLambda>] _b: SingleChildBuilderStep<'msg, 'childMarker>)
306-
=
307-
SingleChildBuilderStep(fun () ->
308-
// We only want one child, so we ignore the second one
309-
a.Invoke())
310-
311-
member inline this.Delay([<InlineIfLambda>] fn: unit -> SingleChildBuilderStep<'msg, 'childMarker>) =
312-
SingleChildBuilderStep(fun () -> fn().Invoke())
313-
314-
member inline this.Run([<InlineIfLambda>] result: SingleChildBuilderStep<'msg, 'childMarker>) =
315-
let childAttr = this.Attr.WithValue(result.Invoke().Compile())
316-
317-
let struct (scalars, widgets, widgetCollections, environments) =
318-
this.AttributesBundle
319-
320-
WidgetBuilder<'msg, 'marker>(
321-
this.WidgetKey,
322-
AttributesBundle(
323-
scalars,
324-
(match widgets with
325-
| ValueNone -> ValueSome [| childAttr |]
326-
| ValueSome widgets -> ValueSome(Array.appendOne childAttr widgets)),
327-
widgetCollections,
328-
environments
329-
)
330-
)

src/Fabulous/Components/ComponentContext.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type ComponentContext(initialSize: int) =
4848
if values.Length < count then
4949
let newLength = max (values.Length * 2) count
5050
let newArray = Array.zeroCreate newLength
51-
Array.blit values 0 newArray 0 values.Length
51+
newArray[..values.Length - 1] <- values
5252
values <- newArray
5353

5454
member this.TryGetValue<'T>(key: int) =

0 commit comments

Comments
 (0)