Commit Graph

6 Commits

Author SHA1 Message Date
Koen Punt e9eca07f52 Revert "Fix build failure on iOS with pnpm and use_frameworks! (#38158)" (#39177)
Summary:
This partially reverts commit 58adc5e4b9.

Using an absolute path in a podspec is wrong, and causes checksum issues when installs are ran on different systems.

Example:

`pod install --deployment --clean-install` breaks on non-matching checksums on CI because the absolute path is not the same in that environment.

```
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Verifying no changes
[!] There were changes to the lockfile in deployment mode:
SPEC CHECKSUMS:
  React-debug:
    New Lockfile: 419922cde6c58cd5b9d43e4a09805146a7dd13a8
    Old Lockfile: 1ce329843d8f9a9cbe0cdd9de264b20e89586734
  React-NativeModulesApple:
    New Lockfile: a683b0c999e76b7d15ad9d5eaf8b6308e710a93e
    Old Lockfile: f82356d67a137295d098a98a03be5ee35871b5a5
  React-runtimescheduler:
    New Lockfile: 79f8dff11acbe36aaeece63553680d7a8272af96
    Old Lockfile: 16c5282d43a0df50d7c68ebf0218aeeb642a7086
  React-utils:
    New Lockfile: 4fabb3cba786651e35bc41e610b0698fa24cecff
    Old Lockfile: e7e9118d0e85b107bb06d1a5f72ec5db6bddb911
  ReactCommon:
    New Lockfile: af30fb021799e18c85a8e30ce799e15607e82212
    Old Lockfile: f04f86f33c22e05dbf875789ea522ee486dace78
```

And even tho the change fixed an issue with pnpm, the issue it introduces with cocoapods I think is a bigger one.

## Changelog:

[INTERNAL] - Revert commit that makes podfile unstable

Pull Request resolved: https://github.com/facebook/react-native/pull/39177

Test Plan: Tested locally that the hashes are stable

Reviewed By: NickGerleman

Differential Revision: D48773887

Pulled By: cipolleschi

fbshipit-source-id: 96bcdbadc17a24fa9a8669f569d004bee6a03521
2023-09-04 18:20:07 +02:00
evelant fe2964a84c Fix build failure on iOS with pnpm and use_frameworks! (#38158)
Summary:
Fix build failure on iOS with pnpm and use_frameworks! due to cocoapods copying symlinked headers to wrong paths

When using pnpm all packages are symlinked to node_modules/.pnpm to prevent phantom dependency resolution. This causes react-native iOS build to fail because Cocoapods copies headers to incorrect destinations when they're behind symlinks. The fix resolves absolute paths to the header_mappings_dir at pod install time. With absolute paths cocoapods copies the headers correctly.

This commit also adds a few missing header search paths in use_frameworks! mode.

Fixes https://github.com/facebook/react-native/issues/38140

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - Build failure with pnpm and use_frameworks! due to incorrect header paths

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/38158

Test Plan:
1. `pnpm pnpx react-native@latest init AwesomeProject`
2. `cd AwesomeProject`
3. `rm -rf node_modules yarn.lock`
4. `mkdir patches`
5. copy [react-native@0.72.1.patch](https://github.com/facebook/react-native/files/11937570/react-native%400.72.1.patch) to `patches/`
6. Add patch to package.json
```
"pnpm": {
    "patchedDependencies": {
        "react-native@0.72.1": "patches/react-native@0.72.1.patch"
    }
}
```
7. `pnpm install`
8. `cd ios`
9. `NO_FLIPPER=1 USE_FRAMEWORKS=static pod install`
10. `cd ..`
11. `pnpm react-native run-ios`

Hopefully an automated test of building with `pnpm` can be added to CI. I don't know how to make that happen, hopefully someone at facebook can do it.

Reviewed By: dmytrorykun

Differential Revision: D47211946

Pulled By: cipolleschi

fbshipit-source-id: 87640bd3f32f023c43291213b5291a7b990d7e1f
2023-07-10 11:43:46 +01:00
Ruslan Lesiutin c9db994696 fix: added missing InheritParentConfig: true to .clang-tidy configs (#36532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36532

Changelog: [Internal]

added missing `InheritParentConfig: true` to .clang-tidy configs across `ReactAndroid` and `ReactCommon`

was initially flagged by linters in D43977381

Reviewed By: javache

Differential Revision: D44199124

fbshipit-source-id: eb319b60096742edf4da7b6408a4148049a82aa0
2023-03-20 07:05:52 -07:00
Ruslan Shestopalyuk b9c64f3651 Bulk detect/correct (most of the) typos and misspells in RN core code
Summary:
## Changelog:
[Internal] -

While merging a Contributor PR in D43816768, I got curious whether such things as detecting/fixing typos could be automated.

There is a tool called [typos](https://github.com/crate-ci/typos), which, as it turns out, works very well on source code files.

The amount of false positives was minimal, most of the suggestions were valid ones.

And the total amount of typos found and fixed was **more than 300**, which is... quite a bit :)

### Methodology

* Run `typos` separately on `ReactCommon`, `Libraries`, `React`, `ReactAndroid` and `scripts` folders inside `packages/react-native`, e.g.:
```
$ typos -w --config ~/tmp/_typos.toml ~/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid
```

Contents of the `_typos.toml` config file:
```
[default.extend-words]
collapsable = "collapsable"
NDK = "NDK"
inout = "inout"
```

(yeah, it really didn't like the "collapsable" word, for some reason ;))
* Inspect all the changes manually and revert false positives (as mentioned, their amount was minimal)

Note that most of the changes are inside things like comments and error messages, however there are a few among identifier name fixes (`typos` is actually quite smart at understanding naming conventions in code) - I kept the suggestions in cases that are local and not part of a public API. There are also misspelled file name changes in a couple of cases.

Reviewed By: NickGerleman

Differential Revision: D44172494

fbshipit-source-id: 86e27edbbb99e09135e3cdd5d7cea8ffeb8307f4
2023-03-20 02:05:38 -07:00
Tim Gates 342c0beafa docs: Fix a few typos (#36372)
Summary:
##Changelog:
[Internal] -

There are small typos in:
- Libraries/Core/setUpTimers.js
- Libraries/LogBox/Data/LogBoxData.js
- Libraries/Pressability/Pressability.js
- Libraries/Renderer/implementations/ReactFabric-dev.js
- Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
- ReactCommon/react/nativemodule/core/platform/ios/RCTBlockGuard.h

Fixes:
- Should read `snapshot` rather than `snapsho`.
- Should read `symbolication` rather than `sybolication`.
- Should read `polyfilled` rather than `polyfiled`.
- Should read `instance` rather than `instace`.
- Should read `gesture` rather than `gestute`.

Semi-automated pull request generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

Pull Request resolved: https://github.com/facebook/react-native/pull/36372

Reviewed By: cortinico, cipolleschi

Differential Revision: D43816768

Pulled By: rshest

fbshipit-source-id: 1346cb3a26748c41d72a3c388d81713ddf2272ed
2023-03-17 09:35:21 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00