Jetpack Compose internals
$34.99
Minimum price
$49.99
Suggested price

Jetpack Compose internals

About the Book

This book explores the guts of Jetpack Compose, the brand new library by Google and the Android team that will become the future of Android UI. Dedicating time now to learn about its internals in-depth will yield powerful skills to write modern and efficient Android apps in the future.

If you are interested in other use cases of Jetpack Compose rather than Android, this book has got you covered also. Jetpack Compose internals is very focused on exploring the compiler and runtime from a generic perspective, making the overall experience very agnostic of the target platform. The book also provides a chapter dedicated to diverse use cases for Jetpack Compose, which exposes a few really interesting examples over code.

Jetpack Compose and Android are trademarks of Google LLC and this book is not endorsed by or affiliated with Google in any way.

About the Author

Jorge Castillo
Jorge Castillo

Jorge is a Google Developer Expert (GDE) for Android and Kotlin that has been traditionally very active in the Android community.

About the Contributors

Andrei Shikov
Andrei Shikov

Software Engineer

Andrei wrote the chapter about "Advanced Compose runtime use cases", one of the most interesting chapters in the book. It showcases how to create client libraries that leverage all the power of the Compose runtime.

Table of Contents

  • Prelude
    • Why to read this book
    • What this book is not about
    • What this book is about
    • Keep the sources close
    • Code snippets and examples
  • 1. Composable functions
    • The nature of Composable functions
    • Composable function properties
    • Calling context
    • Idempotent
    • Free of side effects
    • Restartable
    • Fast execution
    • Positional memoization
    • Similarities with suspend functions
    • Composable functions are colored
    • Composable function types
  • 2. The Compose compiler
    • A Kotlin compiler plugin
    • Compose annotations
    • Registering Compiler extensions
    • Kotlin Compiler version
    • Static analysis
    • Static Checkers
    • Call checks
    • Type checks
    • Declaration checks
    • Diagnostic suppression
    • Runtime version check
    • Code generation
    • The Kotlin IR
    • Lowering
    • Inferring class stability
    • Enabling live literals
    • Compose lambda memoization
    • Injecting the Composer
    • Comparison propagation
    • Default parameters
    • Control flow group generation
    • Klib and decoy generation
  • 3. The Compose runtime
    • The slot table and the list of changes
    • The slot table in depth
    • The list of changes
    • The Composer
    • Feeding the Composer
    • Modeling the Changes
    • Optimizing when to write
    • Writing and reading groups
    • Remembering values
    • Recompose scopes
    • SideEffects in the Composer
    • Storing CompositionLocals
    • Storing source information
    • Linking Compositions via CompositionContext
    • Accessing the current State snapshot
    • Navigating the nodes
    • Keeping reader and writer in sync
    • Applying the changes
    • Performance when building the node tree
    • How changes are applied
    • Attaching and drawing the nodes
    • Composition
    • Creating a Composition
    • The initial Composition process
    • Applying changes after initial Composition
    • Additional information about the Composition
    • The Recomposer
    • Spawning the Recomposer
    • Recomposition process
    • Concurrent recomposition
    • Recomposer states
  • 4. Compose UI
  • 5. State snapshot system
    • What snapshot state is
    • Concurrency control systems
    • Multiversion concurrency control (MCC or MVCC)
    • The Snapshot
    • The snapshot tree
    • Snapshots and threading
    • Observing reads and writes
    • MutableSnapshots
    • GlobalSnapshot and nested snapshots
    • StateObjects and StateRecords
    • Reading and writing state
    • Removing or reusing obsolete records
    • Change propagation
    • Merging write conflicts
  • 6. Smart Recomposition
  • 7. Effects and effect handlers
    • Introducing side effects
    • Side effects in Compose
    • What we need
    • Effect Handlers
    • Non suspended effects
    • Suspended effects
    • Third party library adapters
  • 8. The Composable lifecycle
  • 9. Advanced Compose Runtime use cases
    • Compose runtime vs Compose UI
    • Composition of vector graphics
    • Building vector image tree
    • Integrating vector composition into Compose UI
    • Managing DOM with Compose
    • Standalone composition in the browser
    • Conclusion

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$10,782,676writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub