Litho (By Facebook) v0.42.0 Release Notes

  • 2022-08-15

    • Breaking: There are some changes to how we store ComponentContext and HasEventDispatcher on EventHandler - these changes only affect manually-constructed EventHandlers and will present as a compile error. They don't affect ones generated by the annotation processor for @OnEvent:
      • Previously the ComponentContext was stored as param[0]. It's now stored on eventDispatchInfo.componentContext and all other params should be shifted by one (so index 1 is now index 0) - you only need to do anything here if you were manually constructing EventHandlers - generated EventHandlers from @OnEvent are automatically updated.
      • Previously the HasEventDispatcher was stored directly on the EventHandler. It's not stored at eventDispatchInfo.hasEventDispatcher. This is also automatically updated for generated EventHandlers.
    • Breaking: com.facebook.litho.widget.EmptyComponentSpec is removed. Construct a com.facebook.litho.EmptyComponent directly. In places that require a Builder, use Wrapper.create(<context>).delegate(EmptyComponent())
    • Breaking: PoolableContentProvider renamed to ContentAllocator in RenderCore. RenderUnit no longer implements PoolableContentProvider, instead it should return ContentAllocator implementation from getContentAllocator method.
    • Breaking: StateHandler has now been replaced by TreeState in ComponentTree for all state handling. Use ComponentTree.acquireTreeState() and ComponentTree.Builder.treeState(...) to save/restore state across different component trees.

    👀 For more details, see the full diff.