Litho (By Facebook) v0.40.1-SNAPSHOT Release Notes

  • ๐Ÿš€ release-date

    • 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 to ErrorEventHandler.onError() method.
    • Breaking: Add UI thread call assertion to ComponentTree.release() method.
    • Breaking: Make getErrorHandler, getHandle, getId, and getKey package-private for Component and Section. 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 and threadPoolForBackgroundThreadsConfig configuration parameters from ComponentsConfiguration. These configs were used for experimentation and respective experiments were successfully shipped and therefore they are no longer needed.
    • Breaking: Remove stale ThreadPoolDynamicPriorityLayoutHandler and LayoutPriorityThreadPoolExecutor classes.
    • Breaking: Rename LithoHandler to RunnableHandler and DefaultLithoHandler to DefaultHandler.
    • Breaking: Move RunnableHandler, FutureInstrumenter, and HandlerInstrumenter to core RenderCore artifact.
    • 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.
    • Breaking: Component and ComponentLifecycle are now merged as one class (Component). ComponentLifecycle is now removed. Anywhere ComponentLifecycle was directly referenced should be changed to Component. Generated components now extend SpecGeneratedComponent which extends Component.
      • onCreateLayout/onCreateLayoutWithSizeSpec have been moved to SpecGeneratedComponent. Direct subclasses of Component should implement render() instead.
    • New: Allow passing @TreeProp to @OnCalculateCachedValue methods
    • Breaking: Deletes @FromBind inter stage prop. Replace existing usages with @State AtomicReference<?> instead. Create a @State AtomicReference<?> for the Component; set that value for the AtomicReference in @OnBind, and get from it in @OnUnbind or other lifecycle methods.
    • Breaking: Add ComponentTree in Handle so that Handle can be used across component trees. Remove static references of Handle as that can lead to memory leaks since it hold reference to ComponentTree now, instead Handle should be used via @State or useState in Kotlin.

    ๐Ÿ‘€ For more details, see the full diff.