Skip to content

Conversation

@tido64
Copy link
Member

@tido64 tido64 commented Mar 27, 2025

Description

Support more extensions when looking for react-native.config.*

See also #2429

Platforms affected

  • Android
  • iOS
  • macOS
  • visionOS
  • Windows

Test plan

n/a

@tido64 tido64 requested a review from JasonVMo as a code owner March 27, 2025 08:27
@github-actions github-actions bot added platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS platform: Windows This affects Windows platform: visionOS labels Mar 27, 2025
@tido64
Copy link
Member Author

tido64 commented Mar 27, 2025

cc @szymonrybczak

@tido64 tido64 force-pushed the tido/fix-config-locator branch from 81a9347 to 6da53c5 Compare March 27, 2025 09:19
Copy link
Contributor

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

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

😮 Really interesting!

The thing is that if someone will call configureProjects function not directly in react-native.config.* file but through some helper in other file the value inside stacktrace will be wrong, but there's always fallback to default search.

@tido64
Copy link
Member Author

tido64 commented Mar 27, 2025

The thing is that if someone will call configureProjects function not directly in react-native.config.* file but through some helper in other file the value inside stacktrace will be wrong, but there's always fallback to default search.

Hmm... we should probably allow passing in the project root to avoid searching altogether. If we search the whole stack, we could end up in weird places outside the project. None of the alternatives are robust.

@szymonrybczak
Copy link
Contributor

@tido64 you can also leverage root property from react-native config command which is based on nearest package.json IIRC

@tido64
Copy link
Member Author

tido64 commented Mar 27, 2025

@tido64 you can also leverage root property from react-native config command which is based on nearest package.json IIRC

I believe that would cause a loop. react-native config reads a react-native.config.js that calls configureProject() which calls react-native config.

@tido64 tido64 merged commit 3fca9c7 into trunk Mar 27, 2025
30 checks passed
@tido64 tido64 deleted the tido/fix-config-locator branch March 27, 2025 13:41
@tido64 tido64 mentioned this pull request May 26, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS platform: visionOS platform: Windows This affects Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants