Skip to content

Commit 8913b48

Browse files
authored
Merge pull request #1072 from fabulous-dev/revert-1071-improve-memo-reuse
Revert "Include Memo.KeyData in CanReuseMemo"
2 parents 2bae3c3 + ed15dc1 commit 8913b48

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

CHANGELOG.md

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

1010
_No unreleased changes_
1111

12-
## [2.4.2] - 2024-03-04
13-
14-
### Changed
15-
- Include Memo.KeyData in CanReuseMemo by @TimLariviere (https://github.com/fabulous-dev/Fabulous/pull/1071)
16-
1712
## [2.4.1] - 2024-01-29
1813

1914
### Added
@@ -60,8 +55,7 @@ _No unreleased changes_
6055
### Changed
6156
- 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)
6257

63-
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/2.4.2...HEAD
64-
[2.4.2]: https://github.com/fabulous-dev/Fabulous/releases/tag/2.4.2
58+
[unreleased]: https://github.com/fabulous-dev/Fabulous/compare/2.4.1...HEAD
6559
[2.4.1]: https://github.com/fabulous-dev/Fabulous/releases/tag/2.4.1
6660
[2.4.0]: https://github.com/fabulous-dev/Fabulous/releases/tag/2.4.0
6761
[2.3.2]: https://github.com/fabulous-dev/Fabulous/releases/tag/2.3.2

src/Fabulous.Tests/APISketchTests/APISketchTests.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ module MemoTests =
445445
instance.ProcessMessage(SetMemoPart 99)
446446

447447
// rerendered because of memo key changed
448-
let memoLabel = find<TestLabel> tree "memo" :> IText
449448
Assert.AreEqual(2, renderCount)
450449
Assert.AreEqual("99", memoLabel.Text)
451450

@@ -535,11 +534,11 @@ module MemoTests =
535534

536535
let labelAgain = find<TestLabel> tree "label"
537536

538-
// not same instance
539-
Assert.AreNotSame(label, labelAgain)
537+
// same instance
538+
Assert.AreSame(label, labelAgain)
540539

541540
// just changes text but kept the same color
542-
Assert.AreEqual([ TextSet "two"; ColorSet "blue" ], labelAgain.changeList)
541+
Assert.AreEqual([ TextSet "one"; ColorSet "blue"; TextSet "two" ], label.changeList)
543542

544543

545544

src/Fabulous/Memo.fs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ module Memo =
5959
| _ -> failwith "Memo widget cannot have extra attributes"
6060

6161
let internal canReuseMemoizedWidget prev next =
62-
let prevMemoData = getMemoData prev
63-
let currMemoData = getMemoData next
64-
65-
prevMemoData.MarkerType = currMemoData.MarkerType
66-
&& prevMemoData.KeyData = currMemoData.KeyData
62+
(getMemoData prev).MarkerType = (getMemoData next).MarkerType
6763

6864
let internal MemoAttribute: SimpleScalarAttributeDefinition<MemoData> =
6965
{ Key = MemoAttributeKey

0 commit comments

Comments
 (0)