square / square/wire

Compose immutable annotations

Open
#2,127 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

When displaying UI using Jetpack Compose, data model must have @Immutable annotation to achieve the best performance: https://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutable

Could you add an option to include such annotation on all generated wire classes?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code-generation entry point for Wire classes and any existing options that add annotations. Add an option for generated classes to receive Jetpack Compose's @Immutable annotation, then verify that generated output includes it when enabled and omits it when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.