Skip to content

Releases: facebook/litho

v0.28.0

05 Jul 11:20
Compare
Choose a tag to compare

Additions

  • new codelabs with README instructions
  • interface for listening for changeset generation in Sections

Fixes

  • cleaning old code

v0.27.0

24 Jun 17:11
Compare
Choose a tag to compare

BREAKING CHANGES

  • PerfEvents:
    • Remove FrameworkLogEvents. EVENT_CREATE_LAYOUT, FrameworkLogEvents. EVENT_CSS_LAYOUT , and FrameworkLogEvents. 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-level EVENT_CALCULATE_LAYOUT_STATE event. The PerfEvent#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)
  • 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 in ComponentTree (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 of collectResults in production and weren't actionable (3107467)

See all changes here: v0.26.0...v0.27.0

v0.26.1

28 May 14:15
v0.26.1
Compare
Choose a tag to compare

Bugfix Release

Picks 513cf91 to fix an issue with the Flipper integration.

Version 0.26.0

13 May 17:51
Compare
Choose a tag to compare

BREAKING CHANGES

  • Fix the lazy State update semantics (de3d938)
  • Rename LayoutHandler to LithoHandler (69cba50) and add DefaultLithoHandler (0d0bb0b)
  • Update Yoga version to 1.14.0 (c16baf6). Fixes #536
  • Release sections' ComponentTrees when RecyclerCollectionComponent 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 using ComponentTree.Builder#isReconciliationEnabled for specific trees
  • Add a replaceAll(List<RenderInfo>) method to RecyclerBinder (#451)
  • Eliminate Gradle deprecated methods (#526)
  • Remove object pooling everywhere
  • Cleanup tests and unused code
  • Update documentation

Bugfixes

See all changes here: v0.25.0...v0.26.0

Version 0.25.0

14 Mar 19:50
Compare
Choose a tag to compare

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 of ViewportManager (9da9d90)

See all changes here: v0.24.0...v0.25.0

Version 0.24.0

18 Feb 14:52
Compare
Choose a tag to compare

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

16 Jan 10:55
v0.23.0
Compare
Choose a tag to compare

BREAKING CHANGES

  • KeyHandlers 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 a MountSpec or SectionSpec (2e27d99).

Bugfixes

See all changes here: v0.22.0...v0.23.0

Version 0.22.0

11 Dec 13:10
Compare
Choose a tag to compare

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 corresponding Transition.create calls to specify a GLOBAL key type.
  • EditTextSpec is now deprecated in favor of TextInputSpec. 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 the setText trigger.
  • shouldClipChildren property on ComponentTree has been removed: use clipChildren common prop on Component instead.
  • We now verify all fields on a *Spec are static and final: 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 in TextInputSpec: 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

22 Nov 20:06
Compare
Choose a tag to compare

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

18 Oct 18:43
Compare
Choose a tag to compare

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