Litho (By Facebook) v0.41.0 Release Notes
-
2021-11-18
- Breaking: Delete
@FromBind
inter stage prop. Replace existing usages with@State AtomicReference<?>
instead. Create a@State AtomicReference<?>
for theComponent
; set that value for theAtomicReference
in@OnBind
, and get from it in@OnUnbind
or other lifecycle methods. - Breaking: Add
ComponentTree
inHandle
so thatHandle
can be used across component trees, i.e. throughout Sections. Remove static references ofHandle
as that can lead to memory leaks since it holds reference toComponentTree
now, insteadHandle
should be used via@State
in Spec API oruseState
in Kotlin API. - Breaking: Remove
@OnShouldCreateLayoutWithNewSizeSpec
API. We hope to provide replacements for it in the future, please let us know if you were relying on it. - Breaking: Add new
ComponentTree
parameter toErrorEventHandler.onError()
method. - Breaking: Add UI thread call assertion to
ComponentTree.release()
method. - Breaking: Make
getErrorHandler
,getHandle
,getId
, andgetKey
package-private forComponent
andSection
. This is for compatibility with the Kotlin API. - Breaking: Make most
Component
/ComponentLifecycle
non-lifecycle methods (e.g.onCreateLayout
,onMount
, etc) final as they are not meant to be overridden. - Breaking: Remove
checkNeedsRemeasure
,useVisibilityExtension
,useInternalNodesForLayoutDiffing
,hostHasOverlappingRendering
,inheritPriorityFromUiThread
,interruptUseCurrentLayoutSource
,ignoreDuplicateTransitionKeysInLayout
,onlyProcessAutogeneratedTransitionIdsWhenNecessary
,ignoreStateUpdatesForScreenshotTest
,computeRangeOnSyncLayout
andthreadPoolForBackgroundThreadsConfig
configuration parameters fromComponentsConfiguration
. These configs were used for experimentation and respective experiments were successfully shipped and therefore they are no longer needed. - Breaking: Remove stale
ThreadPoolDynamicPriorityLayoutHandler
andLayoutPriorityThreadPoolExecutor
classes. - Breaking: Rename
LithoHandler
toRunnableHandler
andDefaultLithoHandler
toDefaultHandler
. - Breaking: Move
RunnableHandler
,FutureInstrumenter
, andHandlerInstrumenter
to core RenderCore artifact. - Breaking:
Component
andComponentLifecycle
are now merged as one class (Component
).ComponentLifecycle
is now removed. AnywhereComponentLifecycle
was directly referenced should be changed toComponent
. Generated components now extendSpecGeneratedComponent
which extendsComponent
.onCreateLayout
/onCreateLayoutWithSizeSpec
methods have been moved toSpecGeneratedComponent
- Direct subclasses of
Component
should implementrender
method instead - New: Almost all lifecycle methods are now covered by the
@OnError
lifecycle API. It's encouraged that high-level Specs implement@OnError
callbacks in order to gracefully handle errors that may arise in their descendant Specs. - New: Allow passing
@TreeProp
to@OnCalculateCachedValue
methods
👀 For more details, see the full diff.
- Breaking: Delete