Summary:
Changelog: [Internal]
in this diff, we add a function that allows us to retrieve screen scale. enforcing thread safety will be dependent on the consumer to make sure it's used on main thread.
i'd like for this to be a more temporary solution, i think we should have a more scalable screen solution for consumers to handle the gambit of uiscreen use cases.
Reviewed By: sammy-SC
Differential Revision: D31163909
fbshipit-source-id: 78104e9ef982b47c60697461141afb4b06eede72
Summary:
Changelog:
[iOS][changed] - fixed inaccurate comment
while looking around, i saw this comment for RCTScreenSize that says it's called on app start - i looked around and also put a breakpoint here, and this assumption doesn't seem accurate anymore. just updating the comment for clarity.
Reviewed By: sammy-SC
Differential Revision: D31136182
fbshipit-source-id: 5f02a1a9fd95e16495bb79b3645b5f4e3bc1d9c9
Summary:
Otherwise known as "commitlies," these are per-commit releases that do not get published to npm. They can be downloaded from Circle CI's artifacts pane on the relevant "build_npm_package" job.
If `--dry-run` flag is passed to `publish-npm.js`, it will perform the same steps as a `--nightly` but it will stop short of publishing the nightly to npm. The tarball for the release will be available in the `build/` directory.
Commitlies are implemented by triggering a `--dry-run` publish step on any commit that is not tagged as an open source release (e.g. `/v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/`).
Changelog:
[Internal]
Reviewed By: sota000
Differential Revision: D31177828
fbshipit-source-id: 7d4f79e1ed15718a177d2cb8fc620d5fb860ccf9
Summary:
Uses `enableZ` trick to ensure that Skia doesn't try to reorder the views based on elevation. Unfortunately, it only helps for some cases, but the proper fix would require reimplementing `ViewGroup` completely to remove its internal logic of reordering based on Z coordinate.
Changelog: [Android][Fixed] Ensure elevated views are behind sticky header in FlatList
Reviewed By: cortinico
Differential Revision: D30700566
fbshipit-source-id: d2c59b22332922c610f4f2d415df34e81f5a33c5
Summary:
The generate script file was removed but the package.json file was never update.
I'm doing it here.
Changelog:
[Internal] [Changed] - Removed extra missing script from package.json
Reviewed By: ShikaSD
Differential Revision: D31171736
fbshipit-source-id: 5b9474651d10374ccbb0b06f2c83bc34da01a179
Summary:
This diff adds a `package.json` inside `react-native-gradle-plugin`
so it can be distributed and used inside the `template/` project
similarly to what we do with the `react-native-codegen` package.
Changelog:
[Internal] [Added] - Setup a package inside `react-native-gradle-plugin`
Reviewed By: fkgozali
Differential Revision: D31081980
fbshipit-source-id: 9a9ad696ee6db01666bae75255616fd20aadd243
Summary:
This diff fixes a bug with `GenerateCodegenArtifactsTask` that was causing
two generators to be called one after the other (first the JS and then the Java one).
Now they're mutually exclusive.
Changelog:
[Internal] [Changed] - Fix GenerateCodegenArtifactsTask calling two generators with Java enabled
Reviewed By: ShikaSD
Differential Revision: D31169379
fbshipit-source-id: 668d8e440ad6b3f06654f29c5cbc344ef82c4b9c
Summary:
Changelog: [Internal]
Add a path calculation method to TouchTargetHelper to avoid relying on the view hierarchy ourselves and better support virtual touch targets.
Reviewed By: JoshuaGross
Differential Revision: D30993410
fbshipit-source-id: 17577c815413ab0f03bcb6a2140ea1d4c9fd694a
Summary:
This file was placed in the wrong package. I'm moving it.
Changelog:
[Internal] [Changed] - Move `PathUtilsTest.kt` to the correct package
Reviewed By: motiz88
Differential Revision: D31168890
fbshipit-source-id: 59d09b5fd329b776bd2800921889281a116c26ee
Summary:
Adding tests for the `GenerateCodegenSchemaTask`.
Plus fixing a bug where `delete()` was used instead of `deleteRecursively` causing
the files inside the output folder to don't be properly cleaned up.
Changelog:
[Internal] [Changed] - Add unit tests for GenerateCodegenSchemaTask
Reviewed By: ShikaSD
Differential Revision: D31142346
fbshipit-source-id: 69bb026fa2c64d91193a153fdc99c9b5d0a9e1ff
Summary:
This Diff is adding some tests for BuildCodegenCLITask.
Plus I found a bug in how we pass the input/output relative to `codegenDir`
so I'm fixing the properties to use `by lazy{}`.
Moreover the `output` was not correctly annotated with `OutputDirectories`,
fixing it here.
Changelog:
[Internal] [Changed] - Add unit tests for BuildCodegenCLITask
Reviewed By: ShikaSD
Differential Revision: D31109599
fbshipit-source-id: bec75b216e8cef18072179c89c3223ee2bad74e3
Summary:
Since we moved several classes from the older Java plugin to standalone files,
we can now remove the old `CodegenPlugin.java` class and have a single plugin class.
Changelog:
[Internal] [Changed] - Merge `CodegenPlugin` with `ReactAppPlugin`
Reviewed By: ShikaSD
Differential Revision: D31080558
fbshipit-source-id: c4b005f8648ab62a71cb5bee22c06ae5272ecc44
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32228
This setups a step on Circle to
test the Android template with the head of `main` of react-native to make
sure we're not actually breaking the Android template.
Changelog:
[General] [Added] - Test the Android template on CircleCI
Reviewed By: ShikaSD
Differential Revision: D31018850
fbshipit-source-id: 6f0abc9e0c22ef61e1aa79b513c70065ace5088e
Summary:
This is the last task from the Codegen Plugin that is exported to
its own Task file and converted to Kotlin.
Changelog:
[Internal] [Changed] - Export `GenerateCodegenArtifactTask` to its own task.
Reviewed By: ShikaSD
Differential Revision: D31054781
fbshipit-source-id: 6787065b497570fb312310e3d9f4120f0629f374
Summary:
The `react-native-codegen` package handles the generation of native code artifacts for modules and components in the new React Native architecture.
This change moves the dependency from being an application-level dependency to being a direct dependency of the `react-native` package.
Changelog:
[General] Move react-native-codegen dependency to react-native root package.json
Reviewed By: yungsters
Differential Revision: D31129619
fbshipit-source-id: dfa0df589c4dbca70dde6db0208485431e304809
Summary:
There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow.
This also restrict the version number change check to the specific files for better reliability
Changelog: [Internal]
Reviewed By: sota000
Differential Revision: D31160139
fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd
Summary:
To ensure consistency of RNTester Podfile.lock:
* introduce a script to run `pod install` on the current commit
* have the script check the exact CocoaPods version to use for consistency
* have version bump script run this automatically to keep it up-to-date with the version change
To validate, have this change in `0.66-stable` branch, then try:
```
./scripts/bump-oss-version.js 0.66.0-rc.5
```
This automatically ran `pod install` which produced the Podfile.lock update.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D31132867
fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90
Summary:
nowadays, we could only specify metro server by either dev settings or building time ip.txt.
this pr adds a new way to specify metro server programmatically which makes rn launcher or testing more feasible.
## Changelog
[Internal] [iOS] [Added] - Propose to connect metro server programmatically
Pull Request resolved: https://github.com/facebook/react-native/pull/31828
Test Plan:
just exposing a public interface for RCTPackagerConnection without much code change.
test to call this interface success locally.
Reviewed By: sammy-SC
Differential Revision: D30878774
Pulled By: yungsters
fbshipit-source-id: 5f1d6a4835a983abde7e095d20153e4ba2146a61
Summary:
This pull request aims to remove iOS 11 version check which is no longer needed.
The minimum iOS deployment target for React Native is `iOS 11` but we still have iOS 11 version check like below.
```
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
if (available(iOS 11.0, *)) {
```
> React Native apps may target iOS 11.0 and Android 5.0 (API 21) or newer.
ref: https://github.com/facebook/react-native#-requirements
------
If there is a team motivation to remove the deprecated methods and classes before iOS 10, I can continue the work in this pull request or in the continuing pull requests.
We have deprecated warnings for these in the project.
- `UIUserNotificationSettings`
- `UILocalNotification`
- `topLayoutGuide` and `bottomLayoutGuide`
- `automaticallyAdjustsScrollViewInsets`
## Changelog
[iOS] [Changed] - Remove iOS 11 version check
Pull Request resolved: https://github.com/facebook/react-native/pull/32151
Reviewed By: sammy-SC
Differential Revision: D30877917
Pulled By: yungsters
fbshipit-source-id: d903ea5d557beeb65ef87bfce572e4db3532b3c5
Summary:
to open possibilities for some DX enhancement, the pr introduces `DevSupportManagerFactory` customization. applications could implement a different DevSupportManager in ReactNativeHost.
## Changelog
[Internal] [Added] - Support custom DevSupportManager
Pull Request resolved: https://github.com/facebook/react-native/pull/31841
Test Plan: this pr just introduces some new interfaces and should not break existing functionalities.
Reviewed By: RSNara
Differential Revision: D30878134
Pulled By: yungsters
fbshipit-source-id: ccdf798caa322b07a876da8312b97002da057388
Summary:
Having mavenLocal specified as part of the build is creating confusion as stale artifacts could be used inside the build.
This Diff is attempting to remove. Developers that need it for local development can still re-add it.
Changelog:
[Internal] [Changed] - Remove mavenLocal()
Reviewed By: ShikaSD
Differential Revision: D31057038
fbshipit-source-id: 90335047a0ba5a537ce347e4c1592bfe756d4135
Summary:
When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails.
References:
* https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox
* https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method
## Changelog
[iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios`
Pull Request resolved: https://github.com/facebook/react-native/pull/32243
Test Plan:
1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install`
2. `cd AwesomeProject`
3. `yarn install`
4. `pod install --project-directory=ios`
This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0.
5. `npx react-native run-ios`
The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834.
6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)`
7. Re-run `pod install --project-directory=ios`
8. Re-run `npx react-native run-ios`
The iOS app should now run successfully.
Reviewed By: sota000
Differential Revision: D31089656
Pulled By: fkgozali
fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23
Summary:
Just a fix of a typo
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D31076782
fbshipit-source-id: 192de92ba080a565acd67e038b370917ea9fcddc
Summary:
Try to reuse currentActivity when the new context from "mReactInstanceDevHelper.getCurrentActivity()" is null to fix "Unable to launch redbox because react activity is not available..."
Changelog:
[Android][Fixed] - Fix currentActivity being null when launching Redbox
Reviewed By: philIip
Differential Revision: D30942434
fbshipit-source-id: faf03390adc545376f3cec223eac5a16bf8233ea
Summary:
`isPackagerRunning` check on iOS makes a http request to packager's /status endpoint to check if it's alive... The problem is if the packager can't be reached, but doesn't error out immediately. This can happen, for example, if running the app on device, and host computer's firewall doesn't allow a :8081 connection. In that case, the request will never succeed or fail until default timeout of 60s. It makes debugging the underlying issue quite unbearable. It's hard for me to imagine a legitimate packager connection that wouldn't respond in less than a second, so I propose a conservative timeout of 10s
## Changelog
[iOS] [Fixed] - Don't hang app for 60s if packager can't be reached
Pull Request resolved: https://github.com/facebook/react-native/pull/31367
Test Plan: Checked my app in dev mode to see if packager connects properly.
Reviewed By: sammy-SC
Differential Revision: D30912047
Pulled By: charlesbdudley
fbshipit-source-id: 110743dc45b9cc7d30e49f79ce3b0d5986f7aebd
Summary:
Previous iterations of this diff that were reverted: D30678341 (https://github.com/facebook/react-native/commit/800945982fae92c859f4525e777d016bb61b138b), D30868627 (https://github.com/facebook/react-native/commit/abd0f387cd9b60887d5d8ad986e7cbda7a49ec40).
With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.
While I'm here, drop the third `p` in `get_application_apppletvos_flags()` as
it's driving me insane.
Note - This puts get_visibility_option() on all Apple builds. I believe this is
the right thing to do as everything except macOS static libraries already do it,
and it shouldn't affect binaries.
Changelog: [Internal]
Reviewed By: mzlee, jdonald
Differential Revision: D31024459
fbshipit-source-id: be85296cda3612836c1c74632dc52f6e3f89512e
Summary:
Similarly to the previous diff, this is moving another small part of the codegen
to its own Kotlin separate task. I've used the Gradle idiomatic APIs and added a couple of tests.
Changelog:
[Internal] [Changed] - Export `GenerateCodegenSchemaTask` to its own task.
Reviewed By: ShikaSD
Differential Revision: D31017274
fbshipit-source-id: f0d288a63883e92a9d725eb3bf695a3aa77f9030
Summary:
Changelog: [Internal]
Previously, the `accessibilityHint` value isn't passed through the underlying component so that the voice over system doesn't announce it. This diff fixes that.
Reviewed By: sammy-SC
Differential Revision: D31017275
fbshipit-source-id: 1bf5a5e36fdfed2a199986b82684a40e18325ba1
Summary:
This diff moves `BuildCodegenCLITask` from being inlined to have its own task definition
I've also cleaned up the task body and refactored a bit how we do the CLI invocation.
Changelog:
[Internal] [Changed] - Export `BuildCodegenCLITask` to its own task class
Reviewed By: ShikaSD
Differential Revision: D31016610
fbshipit-source-id: 8407fc2a62ea473daa775196925c1b9b6f4f2f4b
Summary:
Fix the `find-node.sh` call in `react-native-xcode.sh` script
## Related issue
https://github.com/facebook/react-native/issues/32168
## Changelog
[iOS] [Fixed] - Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script
Pull Request resolved: https://github.com/facebook/react-native/pull/32227
Test Plan: • Run an Xcode build which uses the `scripts/react-native-xcode.sh` in the JS Bundle build phase.
Reviewed By: TheSavior
Differential Revision: D31022043
Pulled By: GijsWeterings
fbshipit-source-id: 10aafd595c3a3a87c22f385ca4f61756f67e9b9d
Summary:
Changelog: [Internal]
Small optimization, we can avoid evaluating some properties if `formsStackingContext` is already set, because the end-result is always true.
Reviewed By: sammy-SC
Differential Revision: D30990925
fbshipit-source-id: 08f500aa4b75446a6c644e8821f84dbfccbfebb6