Litho (By Facebook) v0.42.0 Release Notes
-
2022-08-15
- Breaking: There are some changes to how we store
ComponentContext
andHasEventDispatcher
onEventHandler
- 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 oneventDispatchInfo.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 ateventDispatchInfo.hasEventDispatcher
. This is also automatically updated for generated EventHandlers.
- Previously the
- Breaking:
com.facebook.litho.widget.EmptyComponentSpec
is removed. Construct acom.facebook.litho.EmptyComponent
directly. In places that require a Builder, useWrapper.create(<context>).delegate(EmptyComponent())
- Breaking:
PoolableContentProvider
renamed toContentAllocator
in RenderCore.RenderUnit
no longer implementsPoolableContentProvider
, instead it should returnContentAllocator
implementation fromgetContentAllocator
method. - Breaking:
StateHandler
has now been replaced byTreeState
inComponentTree
for all state handling. UseComponentTree.acquireTreeState()
andComponentTree.Builder.treeState(...)
to save/restore state across different component trees.
👀 For more details, see the full diff.
- Breaking: There are some changes to how we store