migrating-to-modifier-node
CommunityMigrate to persistent Node-based modifiers.
System Documentation
What problem does it solve?
Traditional custom modifiers in Compose often rely on Modifier.composed { }, which allocates a new composable scope on every recomposition and prevents hoisting, leading to poorer performance. This skill provides a migration path to Modifier.Node, enabling persistent nodes with in-place updates and explicit lifecycle management for draw, layout, semantics, and input behaviors.
Core Features & Use Cases
- Convert Modifier.composed factories into data class Elements and Node implementations.
- Leverage specialized interfaces like DrawModifierNode, LayoutModifierNode, SemanticsModifierNode, PointerInputModifierNode, CompositionLocalConsumerModifierNode, and more to express behaviors.
- Use onAttach/onDetach/onReset and the built-in coroutineScope to manage lifecycles and async work.
- Control invalidation with shouldAutoInvalidate and explicit invalidateDraw/invalidateMeasurement/invalidatePlacement.
- Support multi-behavior modifiers via DelegatingNode, reducing single-node complexity.
Quick Start
Identify every Modifier.composed factory in the module and replace it with a data class Element and a Node implementing the corresponding interfaces.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: migrating-to-modifier-node Download link: https://github.com/skydoves/compose-performance-skills/archive/main.zip#migrating-to-modifier-node Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.