Releases: facebook/litho
Releases · facebook/litho
v0.28.0
v0.27.0
BREAKING CHANGES
- PerfEvents:
- Remove
FrameworkLogEvents. EVENT_CREATE_LAYOUT
,FrameworkLogEvents. EVENT_CSS_LAYOUT
, andFrameworkLogEvents. EVENT_COLLECT_RESULTS
: these are replaced by the sub-spans"start_create_layout"
/"end_create_layout"
,"start_measure"
/"end_measure"
, and"start_collect_results"
/"end_collect_results"
under the existing top-levelEVENT_CALCULATE_LAYOUT_STATE
event. ThePerfEvent#markerPoint
API can be used to log these sub-spans (b859605) - Remove
FrameworkLogEvents.PREPARE_MOUNT
without replacement: this didn't provide much value (4917370) - Remove
FrameworkLogEvents.DRAW
without replacement: this was not free to maintain and didn't provide much value (9e548cb)
- Remove
- Default Range Ratio: The default range ratio for Sections/
RecyclerBinder
is changed from 4 screens worth of content in either direction to 2. This should improve resource usage with minimal effects on scroll performance. (9b4fe95) ComponentsSystrace.provide
:ComponentsSystrace
now assumes an implementation will be provided before any other litho operations occur (457a20f)
Improvements
ComponentsLogger
implementations can now return null for event types they don't care about (4075eb7)- Add
RecyclerCollectionEventsController#requestScrollBy
(0146857) - Preliminary Robolectric v4 support (4c2f657, etc.)
- More efficient code generation for state updates in Components and Sections (8c5c7e3, etc.)
Bugfixes
- Remove usage of API 19+
Objects
class in cached value API (aabb24a) - Unset Components scope when creating a new
ComponentContext
inComponentTree
(05f11a7) - Fix perf logging for dirty mounts (3ad8bfb)
- Fix crash when
@OnCalculateCachedValue
takes no args (2a0f524) - Reduce number of systrace markers in
collectResults
: these were skewing they perceived size ofcollectResults
in production and weren't actionable (3107467)
See all changes here: v0.26.0...v0.27.0
v0.26.1
Version 0.26.0
BREAKING CHANGES
- Fix the lazy State update semantics (de3d938)
- Rename
LayoutHandler
toLithoHandler
(69cba50) and addDefaultLithoHandler
(0d0bb0b) - Update Yoga version to
1.14.0
(c16baf6). Fixes #536 - Release sections'
ComponentTree
s whenRecyclerCollectionComponent
is detached (8893049) - Only enable incremental mount if parent incremental mount is enabled (c88a660)
Improvements
- EXPERIMENTAL: Make state updates faster by only recreating the subtrees which are being updated and reuse (read clone) the untouched subtrees while calculating a new layout. You can try in out by setting
ComponentsConfiguration.isReconciliationEnabled
flag globally or usingComponentTree.Builder#isReconciliationEnabled
for specific trees - Add a
replaceAll(List<RenderInfo>)
method toRecyclerBinder
(#451) - Eliminate Gradle deprecated methods (#526)
- Remove object pooling everywhere
- Cleanup tests and unused code
- Update documentation
Bugfixes
- Fix Robolectric tests (a92018a)
See all changes here: v0.25.0...v0.26.0
Version 0.25.0
BREAKING CHANGES
- Migrated support lib dependencies to AndroidX (de3097b)
- Remove
DisplayListDrawable
(29f42fa) and other displaylist related features - Remove
References
API (b1aa39a)
Improvements
- Remove object pooling for most internal objects
- Replace powermock-reflect with internal Whitebox implementation (ad899e4)
- Enable Gradle incremental AnnotationProcessing (a864b5a)
- Allow TextInput to accept null inputBackground (d1fd03b)
- Update documentation
Bugfixes
- Suppress focus temporarily while mounting (d93e2e0)
- When clearing press state, also cancel pending input events (451e8b4)
- Fix visibilityChanged event
MountState
calculations (66d65fe) - Fix thread safety issue of
ViewportChanged
listeners ofViewportManager
(9da9d90)
See all changes here: v0.24.0...v0.25.0
Version 0.24.0
BREAKING CHANGES
- The default for state updates has changed from sync to async. At Facebook this meant we ran a codemod script on the codebase and changed all state update methods to the explicit Sync variant (Sync is just appended to the end of the state update call), then changed the default. The reason for this is to not change existing behavior in case it breaks something, since there are many callsites. The script is committed and available at https://github.com/facebook/litho/blob/master/scripts/codemod-state-update-methods.sh . We recommend using it if you have any concerns about state update calls automatically becoming async. As a reminder, when you add a @OnUpdateState method, it generates three methods: updateState, updateStateSync, and updateStateAsync. Previously updateState == updateStateSync. Now, updateState == updateStateAsync
Version 0.23.0
BREAKING CHANGES
KeyHandler
s now get registered in EndToEnd tests (9836497). This is a an edge-case but potentially behavior-changing.
Improvements
- New support for Cached Values.
isEquivalentTo
now uses reflection for size reasons unless the target is aMountSpec
orSectionSpec
(2e27d99).
Bugfixes
- Fix potential NPE in RecyclerEventsController.
See all changes here: v0.22.0...v0.23.0
Version 0.22.0
BREAKING CHANGES
transitionKey
has changed default scope from GLOBAL to LOCAL: This means a transition key is local to the spec where it was declared and can only be reference from that spec. To restore previous behavior, 1) set.transitionKeyType
to GLOBAL on your Component when you set a.transitionKey
, and 2) update the correspondingTransition.create
calls to specify a GLOBAL key type.EditTextSpec
is now deprecated in favor ofTextInputSpec
.TextInputSpec
fixes bugs that could cause loss of text while typing and allows text to be preserved when scrolled off screen. Interface has changed slightly,text
can no longer be provided as a prop but now must be set on the main thread using thesetText
trigger.shouldClipChildren
property onComponentTree
has been removed: useclipChildren
common prop onComponent
instead.- We now verify all fields on a *Spec are
static
andfinal
: this is to prevent correctness issues we've seen with using mutable, non-thread-safe data in specs. Use @State instead if necessary.
Improvements
- Re-enable systrace blocks for async state update names: faa9a0a
Bugfixes
- Fix crash in
TextDrawable
: eb3fbc9 - Fix
ComponentContext
leak inTextInputSpec
: 8bb9d76 - Fix incorrect handling of aspect ratio when combined with flex-stretch in Yoga: 6a9328d
See all changes here: v0.21.0...v0.22.0
Version 0.21.0
New Features
- Add getAndroidContext method in ComponentContext
- Introducing the Equivalence interface
- Add fading edge support to VerticalScrollSpec
- Support Hiding Top or Bottom Rounded Corners for CardSpec
- Make TextInputSpec dynamically re-measure itself
- Add multiline to the TextInputSpec
- Add TextWatcher support to TextInputSpec
- Add Comparable Drawable
- Add DefaultComparableDrawable
Improvements
- Raise background thread to high priority when it's running a layout
- Add accessibility role for Header in bucket headers
- Replaced default constructors with member assignments in YGConfig
- Synchronize outside of for loops in RecyclerBinder to improve performance
- Cache isAccessibilityEnabled Value
- Use the generated Comparable types for the reflective isEquivalentTo method
- Measure TextInputSpec height based on underlying EditText height
- Report FATAL error when encounter transition key duplication instead of throwing an exception
- Change ComponentContext to not extend Context
- Schedule async layouts in parallel with initRange layout
- Boost thread that is running LayoutStateFuture
- Add dispatchOnFocusedVisibleEvent to ComponentTestHelper
- Lazy init border color drawable
Bugfixes
- Fix temporary enabling/disabling child clipping for animations
- Fix releasing drawable order
- Fix setting bounds to DLDrawable with underlying MatrixDrawable
- Fix selecting a position before mounting a circular recycler and it either resets to middle or does not allow user to scroll to the left
- Don't recursively calculate layout for released LayoutStateFutures
- Never wrap RippleDrawables into DisplayListDrawables
- Check if tree is valid before recomputing async layout
Version 0.20.0
New Features
- Add API to request scroll to position that includes snapping in
RecyclerCollectionComponent
- Track crashes in stacktraces across threads.
- Add ability to turn LithoView debug overlay mode to see whether layout was calculated on UI thread (green) or BG thread (red)
Improvements
- Change traverse direction to backward if list is laid out from end in
RecyclerBinder
- Include accessibility services like SelectToSpeak in
isAccessibilityEnabled
check - Allow chaining of
RecyclerBinderConfiguration
setters - Add Litho architecture overview in the docs
- Only find visible area for mounting if attached
- Add clipChildren prop to the
Component.Builder
- Simplify displaylist handling and remove prefetching
- Added Builder methods to
RecyclerBinderConfiguration
- Add disable clipping props to
CardSpec
Bugfixes
ComponentHost
should not delay press state of children- Fix
LayoutStateFuture
thread safety - Fix zero division crash in
RecyclerBinder
- Re-create DisplayList in
LayoutState
when device rotates - Unmount sticky header when hiding it
- Fix the order in which the drawable is unmounted and released in
DrawableComponent