Skip to content

[expo-modules-core] Rework compose integration.#40653

Merged
aleqsio merged 5 commits intomainfrom
@aleqsio/rework-compose-integration
Nov 17, 2025
Merged

[expo-modules-core] Rework compose integration.#40653
aleqsio merged 5 commits intomainfrom
@aleqsio/rework-compose-integration

Conversation

@aleqsio
Copy link
Copy Markdown
Contributor

@aleqsio aleqsio commented Oct 27, 2025

Why

@lukmccall Suggested to move the compose integration to a more compose-like approach:

From:

View(BottomSheetView::class)

To:

View("BottomSheetView") { props ->

How

Introduced a new ComposeFunctionHolder that is used for all compose views that only have composables, no custom classes. Also handles setting props by copying data classes.

For now requires DSL for events to whitelist them in RN, we should drop that requirement soon.

Test Plan

Tested in BareExpo.

Checklist

@aleqsio aleqsio requested review from Kudo and lukmccall October 27, 2025 16:37
@github-actions
Copy link
Copy Markdown
Contributor

Subscribed to pull request

File Patterns Mentions
packages/expo-modules-core/** @Kudo, @lukmccall
packages/expo-ui/** @behenate, @douglowder

Generated by CodeMention

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 27, 2025
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Oct 27, 2025

The Pull Request introduced fingerprint changes against the base commit: ccdf9c5

Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoAutolinkingIos"
      ],
      "hash": "8b3409faecdc902e17e07b6ca0073b1cf77ea86b"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoAutolinkingIos"
      ],
      "hash": "e29780a14f0893d8077140da997b3a8efe61c949"
    }
  },
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-ui/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "258385016726ec1163bf8ea1569fcca1dad0a892"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-ui/android",
      "reasons": [
        "expoAutolinkingAndroid"
      ],
      "hash": "460db4cad2570128bda3948b3ecab04c57f322f7"
    }
  }
]

Generated by PR labeler 🤖

@aleqsio aleqsio requested a review from lukmccall October 28, 2025 13:03
@@ -114,3 +127,42 @@ abstract class ExpoComposeView<T : ComposeProps>(
super.addView(view, index, params)
}
}

class ExpoViewComposableScope(val view: ComposeFunctionHolder<*>) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we make the view private or at least internal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not really, we use the EventDispatcher defined below in other modules, and it's inline so it needs to have view as public as well.

@expo-bot
Copy link
Copy Markdown
Collaborator

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.:
- Rework compose integration. ([#40653](https://github.com/expo/expo/pull/40653) by [@aleqsio](https://github.com/aleqsio))
Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against ced8586

@aleqsio aleqsio merged commit d2fee2e into main Nov 17, 2025
13 of 14 checks passed
@aleqsio aleqsio deleted the @aleqsio/rework-compose-integration branch November 17, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants