Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50448
In preparation for API snapshot generation and README documentation, move into dedicated dir.
Changelog: [Internal]
Reviewed By: iwoplaza
Differential Revision: D72306094
fbshipit-source-id: 3663f9ba9987a59918bae54cfc5a27555b90a9f9
Summary:
In the final XCFramework we no longer need to place resource bundles in a subfolder called Resources - they should be located directly in the framework folder.
This commit fixes this by removing copying to the Resources folder. I also removed a few unneeded tests since we know that we are in a valid folder at this point.
bypass-github-export-checks
## Changelog:
[INTERNAL] - Moved resource bundles up one level
Pull Request resolved: https://github.com/facebook/react-native/pull/50101
Test Plan: Run RNTester with RCT_USE_RN_DEP=1 and verify that it launches
Reviewed By: cortinico
Differential Revision: D71464608
Pulled By: cipolleschi
fbshipit-source-id: 6cfdda0c6785ffeb13c170f9fd2dd9f5b889d490
Summary:
Headers are currently copied into each arch in the final xcframework. This is not necessary and will cause a lot of duplication since these files are the same for all archs.
This commit fixes this by only copying headers when we build the final XCFramework:
- ReactNativeDependencies.podspec: Changed the prepare script to be more resilient to different header structs, since we have multiple ways of packaging our tarballs locally and on the servers
- build.js: Removed copying headers when building frameworks
- compose-framework.js: Added copying headers once to the root of the XCFramework.
- rndependencies.rb: updated docs with correct ENV vars
bypass-github-export-checks
## Changelog:
[INTERNAL] - Changes the header structure in our XCFramework to avoid duplication
Pull Request resolved: https://github.com/facebook/react-native/pull/50085
Test Plan: Run RNTester with RCT_USE_RN_DEPS=1 to use prebuilt RN Deps.
Reviewed By: javache
Differential Revision: D71385183
Pulled By: cipolleschi
fbshipit-source-id: 160d56dea7f61d1b8d0a45b80f6c0789647358e6
Summary:
We had some issues with the Swift package build step where we saw an error message when we included resources and couldn't find out why this was happening.
After systematically going through the generated swift package file and looking for a reason I found a mistake.
When we generate the Package.swift file we pass all compilerFlags from the configuration of the target to both cpp/c flags - which in the case of the folly target ends up being passed to the dependency scanner which isn't too happy about this c++ flag.
The solution was to split `compilerFlags` into `cCompilerFlags` and `cxxCompilerFlags`.
This commit fixes this by:
- split `compilerFlags` into `cCompilerFlags` and `cxxCompilerFlags`.
- Updated configuration with correct settings
- Updated Package.swift generation to use these new flags
- Fixed issue with the copy bundles step that didn't copy the directory in some cases.
## Changelog:
[INTERNAL] - Fixed processing resources in the generated swift package for the RN Dependencies/prebuild
## Test-plan
Test by prebuilding RNDependencies, include the XCFramework in a new app and try to load resource bundles:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
std::string input = "3.1416 xyz ";
double_conversion::DoubleToStringConverter::EcmaScriptConverter();
LOG(INFO) << "Hello from GLOG";
fmt::print("Hello, world from FMT!\n");
BOOST_ASSERT(100 == 100);
double result;
fast_float::from_chars(input.data(), input.data() + input.size(), result);
LOG(INFO) << "Answer :" << result;
NSArray *frameworks = [NSBundle allFrameworks];
for (NSBundle *framework in frameworks) {
NSString *frameworkName = framework.bundleURL.lastPathComponent;
if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
[self loadBundle:framework bundleName:@"ReactNativeDependencies_glog"];
[self loadBundle:framework bundleName:@"ReactNativeDependencies_boost"];
[self loadBundle:framework bundleName:@"ReactNativeDependencies_folly"];
break;
}
}
return YES;
}
- (void) loadBundle:(NSBundle*)framework bundleName: (NSString*)bundleName {
NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
NSURL *bundleURL = [bundle URLForResource:bundleName withExtension:@"bundle"];
NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
if (url == nil) {
LOG(ERROR) << "Could not find PrivacyInfo.xcprivacy in the " << [bundleName UTF8String] << " bundle";
} else {
LOG(INFO) << "Found PrivacyInfo.xcprivacy in " << [bundleName UTF8String] << ".";
}
}
```
Pull Request resolved: https://github.com/facebook/react-native/pull/50050
Reviewed By: javache
Differential Revision: D71316215
Pulled By: cipolleschi
fbshipit-source-id: 53093f962874101f5618997fdac3dd4550768da5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50013
The diff incorporates event-target-shim types that will be referenced by generated TS types to make sure that the public API does not change unexpectedly. The generated tsconfig contains path property which tells Typescript to use copied types instead of the downloaded event-target-shims types.
Changelog:
[internal] - Moved event-target-shim types to react-native package.
Reviewed By: huntie
Differential Revision: D71044389
fbshipit-source-id: b2837cc880a2161f7ff716470fd6eb4644d514e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49970
This change add supports to pass a tarball from a local file to the ReactNativeDependencies podspec, so that we can build React Native using a local copy or the RNDependencies and we can use it also in CI.
## Changelog:
[INTERNAL] - Add support for local tarballs
Reviewed By: cortinico
Differential Revision: D71032641
fbshipit-source-id: d83c96c8c12f3add45f8f5ea15fa0eac06d0bedf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49969
Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.
## Changelog:
[INTERNAL] - Configure folly in a prepare step
Test Plan:
✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities
Reviewed By: javache
Differential Revision: D71032640
Pulled By: cipolleschi
fbshipit-source-id: a34a9b38fa5d5b37a0a193a73659f0d45dd3d660
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50008
The diff adds extraction of triple-slash directives using regex to match and retrieve following reference.
Changelog:
[internal] - Added support for triple-slash directives in generated .d.ts files
Reviewed By: huntie
Differential Revision: D71113674
fbshipit-source-id: 2207d5b455515c44ba585ffecc063914e0818e58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49895
Minor thing, but the fact that these fixture `package.json`s for testing a release script reference real Metro packages and versions always trips me up when I'm updating Metro (grepping, etc).
There's no need for them to mention Metro - any non-RN package is sufficient to test that the script preserves other dependencies. This swaps them for dummy packages.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D70789598
fbshipit-source-id: 32f394bf1f783534b76d260908538d7b5716ef1f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49863
After the creation of the XCFramework, that needs to be signed. After the XCFramework is signed, no further modification can happen or they would break the signature.
## Changelog:
[Internal] - Add function to sign the XCFramework
Reviewed By: cortinico
Differential Revision: D70697279
fbshipit-source-id: c2411ca7d12d4679ba55f124cbb445367b15945a
Summary:
Added a new template `ReactNativeVersion.kt-template.js` to be used to generate the Kotlin template for Android. Updating also the set-rn-artifacts-version script to use this template instead of the Java one.
## Changelog:
[INTERNAL] - Migrate ReactNativeVersion Android template to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49758
Test Plan:
```bash
yarn test-android
yarn android
node ./scripts/releases/set-version.js 1000.0.0
```
Reviewed By: huntie, rshest
Differential Revision: D70486775
Pulled By: cortinico
fbshipit-source-id: 5dd1e0e2ecf4d848dc24e6c47df243a1259ab559
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49775
Upgrading this dependency to match folly and to enable using this for number parsing across Fabric.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D70482373
fbshipit-source-id: 64429595c1126e6a06436701a7562bdf6dd962d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49643
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
Aligns `useAnimatedValue.js` with its manual .d.ts types.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D70096210
fbshipit-source-id: c3cd517eccf1cb68400772ddde6e5891861c927d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49685
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D70237239
fbshipit-source-id: f552490cb6bb721c6163272689ec9b6c68386574
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49666
This change moves the index.js file to the `releases` folder, giving it a meaningful name.
It also rename the prebuild folder to ios-prebuild to be more descriptive.
It finally removes the old scripts that this refactoring supersedes.
bypass-github-export-checks
## Changelog:
[INTERNAL] - Move the infdex.js to the prepare-ios-prebuilds script.
Reviewed By: cortinico
Differential Revision: D70176043
fbshipit-source-id: e0c3f3bd53adf97fa388c37a746d274fd678f690
Summary:
This change refactors the script to prebuild ios dependencies by:
- remove the manually maintained Package.swift
- add script to generate it starting from the configurations that we have
bypass-github-export-checks
## Changelog:
[INTERNAL] - Factor out script to generate Package.swift file
Reviewed By: cortinico
Differential Revision: D70175760
Pulled By: cipolleschi
fbshipit-source-id: a1b0fc6dcdc1860b04ab260697f259c297338f41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49559
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D69849314
fbshipit-source-id: cdaa605ba5361d3349c6dd0e84fd0fbfee263941