Skip to content

Migrate Arguments to Kotlin#52457

Closed
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:refactor/Arguments
Closed

Migrate Arguments to Kotlin#52457
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:refactor/Arguments

Conversation

@mateoguzmana
Copy link
Copy Markdown
Collaborator

@mateoguzmana mateoguzmana commented Jul 6, 2025

Summary:

Migrate com.facebook.react.bridge.Arguments to Kotlin.

Changelog:

[Android][Changed] - Migrated com.facebook.react.bridge.Arguments to Kotlin.

Test Plan:

yarn test-android
yarn android

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 6, 2025
@mateoguzmana mateoguzmana marked this pull request as ready for review July 7, 2025 07:38
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 7, 2025
Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Just one nit for now, but I'll do a deeper review 👍

public fun createMap(): WritableMap = WritableNativeMap()

@JvmStatic
public fun fromJavaArgs(args: Array<Any?>): WritableNativeArray {
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.

This should probably be a:

Suggested change
public fun fromJavaArgs(args: Array<Any?>): WritableNativeArray {
public fun fromJavaArgs(vararg args: Any?): WritableNativeArray {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Been trying to use vararg here, but not with much luck. Once I do this change, I get a crash for a missing Object handler: java.lang.RuntimeException: Cannot convert argument of type class [Ljava.lang.Object; and amending the consumers of this class to try to make it happy doesn't seem to work either, I think it changes the logic

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.

@mateoguzmana when is the crash happening? Upon startup?

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.

Ok I was able to circumvent this. If all is good, I should be able to merge it with the vararg syntax

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, happens upon startup indeed.

Ok I was able to circumvent this. If all is good, I should be able to merge it with the vararg syntax

Ah awesome!

facebook-github-bot pushed a commit that referenced this pull request Jul 8, 2025
Summary:
This came out of #52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.

## Changelog:

[INTERNAL] - Clean up unnecessary test setup for Android tests

Pull Request resolved: #52471

Test Plan:
```sh
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D77926887

Pulled By: javache

fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D78353290.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 19, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico merged this pull request in 2534aea.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mateoguzmana in 2534aea

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants