Skip to content

[ui] Add scoped compose modifiers, move testID to modifiers.#39155

Merged
aleqsio merged 9 commits intomainfrom
@aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers
Oct 8, 2025
Merged

[ui] Add scoped compose modifiers, move testID to modifiers.#39155
aleqsio merged 9 commits intomainfrom
@aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers

Conversation

@aleqsio
Copy link
Copy Markdown
Contributor

@aleqsio aleqsio commented Aug 26, 2025

Why

This PR does a few things:

  • removes the Modifier argument passed to each compose Content function by EMC – it was used only for testID and we now can ship testID as just another modifier.
  • adds the testID modifier
  • adds a way to access scoped modifiers when nesting Compose views and adds weight + matchParentSize + animateContentSize modifier for row and column

TODO: Add more scoped modifiers.

How

We persist different scopes inside the ComposableScope object and pass it down hierarchy.

Test Plan

Tested in bare expo if the weight applies correctly.

Checklist

Copy link
Copy Markdown
Contributor Author

aleqsio commented Aug 26, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Aug 26, 2025
@aleqsio aleqsio marked this pull request as ready for review August 26, 2025 13:15
@aleqsio aleqsio force-pushed the @aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers branch from 56b8476 to 2d23808 Compare August 26, 2025 13:15
@aleqsio aleqsio requested a review from Kudo August 26, 2025 13:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 26, 2025

Subscribed to pull request

File Patterns Mentions
packages/expo-maps/** @jakex7, @alanjhughes
packages/expo-mesh-gradient/** @jakex7
packages/expo-modules-core/** @Kudo, @lukmccall
packages/expo-ui/** @behenate, @douglowder

Generated by CodeMention

@aleqsio aleqsio requested a review from lukmccall August 26, 2025 13:15
@aleqsio aleqsio changed the title Add scoped compose modifiers, move testId to modifiers. [ui] Add scoped compose modifiers, move testId to modifiers. Aug 26, 2025
@aleqsio aleqsio changed the title [ui] Add scoped compose modifiers, move testId to modifiers. [ui] Add scoped compose modifiers, move testID to modifiers. Aug 26, 2025
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Sep 11, 2025

The Pull Request introduced fingerprint changes against the base commit: 774e20b

Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-maps/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "86a2f8d880ecda4a128e54d6b59ccaac8cd4e4f9"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-maps/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "6ec46a89b277a9ab7899197bcc729208e9289a58"
    }
  },
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-mesh-gradient/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "cab8eb4f4c3df4cd3925de031fa1c07d5cdaad33"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-mesh-gradient/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "8c24a7c98653a1939fb9d74c9a27481cea8b46a9"
    }
  },
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid"
      ],
      "hash": "2c4e28a931b3e961220933cb7720caa4918acbe5"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid"
      ],
      "hash": "78a5b155f0956fa4f2613a47f2da71bbc85d43cc"
    }
  },
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-ui/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "9daf05ef74f7976a1aa9dea9072369820833f723"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-ui/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "d4ba336f173455cec2013f0eaaed1c1320c141e8"
    }
  }
]

Generated by PR labeler 🤖

Comment thread packages/expo-maps/android/src/main/java/expo/modules/maps/GoogleMapsView.kt Outdated
Comment thread packages/expo-ui/android/src/main/java/expo/modules/ui/ExpoUIModule.kt Outdated
Copy link
Copy Markdown
Contributor

@Kudo Kudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like the ComposableScope concept

for testID, i was thinking about to pass it through testID prop. because that would more align with react-native view paradigm

@aleqsio
Copy link
Copy Markdown
Contributor Author

aleqsio commented Sep 18, 2025

@Kudo I think it's not that used, and treating that as a special case makes our native code more complicated. We can always add a modifier based on prop in JS land.

@aleqsio aleqsio force-pushed the @aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers branch from 449a382 to baf155b Compare October 6, 2025 12:44
@aleqsio aleqsio force-pushed the @aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers branch from baf155b to 409e55a Compare October 8, 2025 12:06
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Oct 8, 2025

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog, e.g.:
- Add scoped compose modifiers, move testID to modifiers. ([#39155](https://github.com/expo/expo/pull/39155) by [@aleqsio](https://github.com/aleqsio))
Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 409e55a

@aleqsio aleqsio merged commit b20d9f9 into main Oct 8, 2025
11 of 13 checks passed
@aleqsio aleqsio deleted the @aleqsio/08-26-add_scoped_compose_modifiers_move_testid_to_modifiers branch October 8, 2025 12:16
doombladeoff pushed a commit to doombladeoff/expo that referenced this pull request Oct 9, 2025
)

Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com>
@Kudo Kudo added the published Changes from the PR have been published to npm label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: fingerprint changed bot: suggestions ExpoBot has some suggestions published Changes from the PR have been published to npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants