Compare commits

..
Author SHA1 Message Date
Nicola Corti 735130c8c9 remove extra spaces 2025-09-11 16:54:50 +01:00
Gabriel Donadel 01295c60ba [RN][Changelog] Add changelog for v0.81.3 2025-09-10 00:01:36 -03:00
31 changed files with 155 additions and 401 deletions
-1
View File
@@ -19,7 +19,6 @@ on:
jobs:
create_release:
if: github.repository == 'facebook/react-native'
runs-on: ubuntu-latest
steps:
- name: Checkout
+3 -6
View File
@@ -23,7 +23,6 @@ jobs:
prepare_hermes_workspace:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
@@ -51,8 +50,8 @@ jobs:
- name: Build HermesC Apple
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
@@ -76,7 +75,7 @@ jobs:
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
@@ -102,7 +101,6 @@ jobs:
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
@@ -147,7 +145,6 @@ jobs:
build_android:
runs-on: 8-core-ubuntu
if: github.repository == 'facebook/react-native'
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
@@ -9,7 +9,6 @@ on:
jobs:
publish_bumped_packages:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
steps:
-2
View File
@@ -21,7 +21,6 @@ jobs:
prepare_hermes_workspace:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
@@ -99,7 +98,6 @@ jobs:
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
-1
View File
@@ -9,7 +9,6 @@ on:
jobs:
rerun:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: rerun ${{ inputs.run_id }}
env:
-5
View File
@@ -11,7 +11,6 @@ on:
jobs:
set_release_type:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
outputs:
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
env:
@@ -35,7 +34,6 @@ jobs:
prepare_hermes_workspace:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
@@ -114,7 +112,6 @@ jobs:
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
@@ -597,7 +594,6 @@ jobs:
test_js:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
strategy:
fail-fast: false
matrix:
@@ -612,7 +608,6 @@ jobs:
lint:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
@@ -27,7 +27,6 @@ on:
jobs:
validate-dotslash-artifacts:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout repository
uses: actions/checkout@v4
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## v0.81.3
### Fixed
#### iOS specific
- Reverted "Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source" ([537e3ad930](https://github.com/facebook/react-native/commit/537e3ad93041c0cef959f0d20586fe97818900a6) by [@gabrieldonadel](https://github.com/gabrieldonadel))
## v0.82.0-rc.1
### Added
@@ -23,7 +23,6 @@ import com.facebook.react.utils.PropertyUtils.SCOPED_USE_THIRD_PARTY_JSC
import com.facebook.react.utils.PropertyUtils.USE_THIRD_PARTY_JSC
import org.gradle.api.Project
import org.gradle.api.file.DirectoryProperty
import org.jetbrains.kotlin.gradle.plugin.extraProperties
internal object ProjectUtils {
@@ -76,11 +75,7 @@ internal object ProjectUtils {
(project.hasProperty(HERMES_V1_ENABLED) &&
project.property(HERMES_V1_ENABLED).toString().toBoolean()) ||
(project.hasProperty(SCOPED_HERMES_V1_ENABLED) &&
project.property(SCOPED_HERMES_V1_ENABLED).toString().toBoolean()) ||
(project.extraProperties.has(HERMES_V1_ENABLED) &&
project.extraProperties.get(HERMES_V1_ENABLED).toString().toBoolean()) ||
(project.extraProperties.has(SCOPED_HERMES_V1_ENABLED) &&
project.extraProperties.get(SCOPED_HERMES_V1_ENABLED).toString().toBoolean())
project.property(SCOPED_HERMES_V1_ENABLED).toString().toBoolean())
internal fun Project.needsCodegenFromPackageJson(rootProperty: DirectoryProperty): Boolean {
val parsedPackageJson = readPackageJsonFile(this, rootProperty)
@@ -37,11 +37,11 @@ class PrepareBoostTaskTest {
val project = createProject()
val boostThirdPartyJniPath = File(project.projectDir, "src/main/jni/third-party/boost/")
val task =
createTestTask<PrepareBoostTask>(project = project) { task ->
task.boostPath.setFrom(boostpath)
task.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
task.boostVersion.set("1.0.0")
task.outputDir.set(output)
createTestTask<PrepareBoostTask>(project = project) {
it.boostPath.setFrom(boostpath)
it.boostThirdPartyJniPath.set(boostThirdPartyJniPath)
it.boostVersion.set("1.0.0")
it.outputDir.set(output)
}
File(boostThirdPartyJniPath, "CMakeLists.txt").apply {
parentFile.mkdirs()
@@ -82,11 +82,11 @@ class PrepareGflagsTaskTest {
val gflagsThirdPartyPath = tempFolder.newFolder("gflagspath/jni")
val output = tempFolder.newFolder("output")
val task =
createTestTask<PrepareGflagsTask> { taskConfig ->
taskConfig.gflagsPath.setFrom(gflagspath)
taskConfig.gflagsThirdPartyPath.set(gflagsThirdPartyPath)
taskConfig.gflagsVersion.set("1.0.0")
taskConfig.outputDir.set(output)
createTestTask<PrepareGflagsTask> {
it.gflagsPath.setFrom(gflagspath)
it.gflagsThirdPartyPath.set(gflagsThirdPartyPath)
it.gflagsVersion.set("1.0.0")
it.outputDir.set(output)
}
File(gflagspath, "gflags-1.0.0/src/gflags_declare.h.in").apply {
parentFile.mkdirs()
@@ -50,7 +50,6 @@ Pod::Spec.new do |s|
add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp')
add_dependency(s, "React-jsinspectornetwork", :framework_name => 'jsinspector_modernnetwork')
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "React-networking", :framework_name => 'React_networking')
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
@@ -96,7 +96,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
private final TraceListener mTraceListener;
private final JavaScriptModuleRegistry mJSModuleRegistry;
private final JSBundleLoader mJSBundleLoader;
private final ArrayList<PendingJSCall> mJSCallsPendingInit = new ArrayList<>();
private final ArrayList<PendingJSCall> mJSCallsPendingInit = new ArrayList<PendingJSCall>();
private final Object mJSCallsPendingInitLock = new Object();
private final NativeModuleRegistry mNativeModuleRegistry;
@@ -47,10 +47,9 @@ Pod::Spec.new do |s|
add_rncore_dependency(s)
s.dependency "React-domnativemodule"
s.dependency "React-featureflagsnativemodule"
s.dependency "React-microtasksnativemodule"
s.dependency "React-idlecallbacksnativemodule"
s.dependency "React-webperformancenativemodule"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "React-featureflags")
add_dependency(s, "React-featureflagsnativemodule")
end
@@ -131,18 +131,9 @@ NativePerformance::NativePerformance(std::shared_ptr<CallInvoker> jsInvoker)
: NativePerformanceCxxSpec(std::move(jsInvoker)) {}
HighResTimeStamp NativePerformance::now(jsi::Runtime& /*rt*/) {
// This is not spec-compliant, as this is the duration from system boot to
// now, instead of from app startup to now.
// This should be carefully changed eventually.
return HighResTimeStamp::now();
}
HighResDuration NativePerformance::timeOrigin(jsi::Runtime& /*rt*/) {
// This is not spec-compliant, as this is an approximation from Unix epoch to
// system boot, instead of a precise duration from Unix epoch to app startup.
return HighResTimeStamp::unsafeOriginFromUnixTimeStamp();
}
void NativePerformance::reportMark(
jsi::Runtime& rt,
const std::string& name,
@@ -88,9 +88,6 @@ class NativePerformance : public NativePerformanceCxxSpec<NativePerformance> {
// https://www.w3.org/TR/hr-time-3/#now-method
HighResTimeStamp now(jsi::Runtime& rt);
// https://www.w3.org/TR/hr-time-3/#timeorigin-attribute
HighResDuration timeOrigin(jsi::Runtime& rt);
#pragma mark - User Timing Level 3 functions (https://w3c.github.io/user-timing/)
void reportMark(
@@ -45,14 +45,12 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-jsiexecutor"
s.dependency "React-cxxreact"
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.dependency "ReactCommon/turbomodule/core"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "React-performancetimeline")
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
@@ -27,10 +27,10 @@ std::optional<double> DynamicEventPayload::extractValue(
auto dynamic = payload_;
for (auto& key : path) {
auto type = dynamic.type();
if (type == folly::dynamic::Type::OBJECT && !dynamic.empty()) {
if ((type == folly::dynamic::Type::OBJECT ||
type == folly::dynamic::Type::ARRAY) &&
!dynamic.empty()) {
dynamic = folly::dynamic(dynamic[key]);
} else if (type == folly::dynamic::Type::ARRAY && !dynamic.empty()) {
dynamic = folly::dynamic(dynamic[std::stoi(key)]);
}
}
if (dynamic.type() == folly::dynamic::Type::DOUBLE) {
@@ -201,11 +201,6 @@ class HighResTimeStamp {
return HighResTimeStamp(chronoNow());
}
static HighResDuration unsafeOriginFromUnixTimeStamp() noexcept {
static auto origin = computeUnsafeOriginFromUnixTimeStamp();
return origin;
}
static constexpr HighResTimeStamp min() noexcept {
return HighResTimeStamp(std::chrono::steady_clock::time_point::min());
}
@@ -290,13 +285,6 @@ class HighResTimeStamp {
std::chrono::steady_clock::time_point chronoTimePoint_;
static HighResDuration computeUnsafeOriginFromUnixTimeStamp() noexcept {
auto systemNow = std::chrono::system_clock::now();
auto steadyNow = std::chrono::steady_clock::now();
return HighResDuration(
systemNow.time_since_epoch() - steadyNow.time_since_epoch());
}
#ifdef REACT_NATIVE_DEBUG
static std::function<std::chrono::steady_clock::time_point()>&
getTimeStampProvider() {
+4 -4
View File
@@ -199,11 +199,11 @@ declare interface EventCounts {
}
declare class Performance {
+eventCounts: EventCounts;
+timeOrigin: DOMHighResTimeStamp;
clearMarks(name?: string): void;
clearMeasures(name?: string): void;
eventCounts: EventCounts;
getEntries: (
options?: PerformanceEntryFilterOptions,
) => Array<PerformanceEntry>;
@@ -215,7 +215,7 @@ declare class Performance {
startMarkOrOptions?: string | PerformanceMeasureOptions,
endMark?: string,
): PerformanceMeasure;
now(): DOMHighResTimeStamp;
now: () => DOMHighResTimeStamp;
toJSON(): string;
}
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`execute test-app "ReactAppDependencyProvider/RCTAppDependencyProvider.h" should match snapshot 1`] = `
exports[`execute test-app "RCTAppDependencyProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_END
"
`;
exports[`execute test-app "ReactAppDependencyProvider/RCTAppDependencyProvider.mm" should match snapshot 1`] = `
exports[`execute test-app "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -73,45 +73,7 @@ exports[`execute test-app "ReactAppDependencyProvider/RCTAppDependencyProvider.m
"
`;
exports[`execute test-app "ReactAppDependencyProvider/ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
version = \\"1000.0.0\\"
source = { :git => 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which were presumably in.
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
else
source[:tag] = \\"v#{version}\\"
end
Pod::Spec.new do |s|
s.name = \\"ReactAppDependencyProvider\\"
s.version = version
s.summary = \\"The third party dependency provider for the app\\"
s.homepage = \\"https://reactnative.dev/\\"
s.documentation_url = \\"https://reactnative.dev/\\"
s.license = \\"MIT\\"
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
s.platforms = min_supported_versions
s.source = source
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
s.pod_target_xcconfig = {
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
\\"DEFINES_MODULE\\" => \\"YES\\"
}
s.dependency \\"ReactCodegen\\"
end
"
`;
exports[`execute test-app "ReactCodegen/RCTModuleProviders.h" should match snapshot 1`] = `
exports[`execute test-app "RCTModuleProviders.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -131,7 +93,7 @@ exports[`execute test-app "ReactCodegen/RCTModuleProviders.h" should match snaps
"
`;
exports[`execute test-app "ReactCodegen/RCTModuleProviders.mm" should match snapshot 1`] = `
exports[`execute test-app "RCTModuleProviders.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -197,7 +159,7 @@ exports[`execute test-app "ReactCodegen/RCTModuleProviders.mm" should match snap
"
`;
exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -219,7 +181,7 @@ exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.
"
`;
exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
exports[`execute test-app "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -286,7 +248,7 @@ exports[`execute test-app "ReactCodegen/RCTModulesConformingToProtocolsProvider.
"
`;
exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
exports[`execute test-app "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -306,7 +268,7 @@ exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.h" shoul
"
`;
exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
exports[`execute test-app "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -341,7 +303,7 @@ exports[`execute test-app "ReactCodegen/RCTThirdPartyComponentsProvider.mm" shou
"
`;
exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -359,7 +321,7 @@ exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetu
"
`;
exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
exports[`execute test-app "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -393,7 +355,45 @@ exports[`execute test-app "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetu
"
`;
exports[`execute test-app "ReactCodegen/ReactCodegen.podspec" should match snapshot 1`] = `
exports[`execute test-app "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
version = \\"1000.0.0\\"
source = { :git => 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which were presumably in.
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
else
source[:tag] = \\"v#{version}\\"
end
Pod::Spec.new do |s|
s.name = \\"ReactAppDependencyProvider\\"
s.version = version
s.summary = \\"The third party dependency provider for the app\\"
s.homepage = \\"https://reactnative.dev/\\"
s.documentation_url = \\"https://reactnative.dev/\\"
s.license = \\"MIT\\"
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
s.platforms = min_supported_versions
s.source = source
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
s.pod_target_xcconfig = {
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
\\"DEFINES_MODULE\\" => \\"YES\\"
}
s.dependency \\"ReactCodegen\\"
end
"
`;
exports[`execute test-app "ReactCodegen.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
@@ -507,7 +507,7 @@ end
"
`;
exports[`execute test-app-legacy "ReactAppDependencyProvider/RCTAppDependencyProvider.h" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTAppDependencyProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -536,7 +536,7 @@ NS_ASSUME_NONNULL_END
"
`;
exports[`execute test-app-legacy "ReactAppDependencyProvider/RCTAppDependencyProvider.mm" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTAppDependencyProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -580,45 +580,7 @@ exports[`execute test-app-legacy "ReactAppDependencyProvider/RCTAppDependencyPro
"
`;
exports[`execute test-app-legacy "ReactAppDependencyProvider/ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
version = \\"1000.0.0\\"
source = { :git => 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which were presumably in.
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
else
source[:tag] = \\"v#{version}\\"
end
Pod::Spec.new do |s|
s.name = \\"ReactAppDependencyProvider\\"
s.version = version
s.summary = \\"The third party dependency provider for the app\\"
s.homepage = \\"https://reactnative.dev/\\"
s.documentation_url = \\"https://reactnative.dev/\\"
s.license = \\"MIT\\"
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
s.platforms = min_supported_versions
s.source = source
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
s.pod_target_xcconfig = {
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
\\"DEFINES_MODULE\\" => \\"YES\\"
}
s.dependency \\"ReactCodegen\\"
end
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.h" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTModuleProviders.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -638,7 +600,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.h" should matc
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.mm" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTModuleProviders.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -695,7 +657,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTModuleProviders.mm" should mat
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -717,7 +679,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsPr
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTModulesConformingToProtocolsProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -775,7 +737,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTModulesConformingToProtocolsPr
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -795,7 +757,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.h
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTThirdPartyComponentsProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -829,7 +791,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTThirdPartyComponentsProvider.m
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.h" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -847,7 +809,7 @@ exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQu
"
`;
exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
exports[`execute test-app-legacy "RCTUnstableModulesRequiringMainQueueSetupProvider.mm" should match snapshot 1`] = `
"/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
@@ -872,7 +834,45 @@ exports[`execute test-app-legacy "ReactCodegen/RCTUnstableModulesRequiringMainQu
"
`;
exports[`execute test-app-legacy "ReactCodegen/ReactCodegen.podspec" should match snapshot 1`] = `
exports[`execute test-app-legacy "ReactAppDependencyProvider.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
version = \\"1000.0.0\\"
source = { :git => 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which were presumably in.
source[:commit] = \`git rev-parse HEAD\`.strip if system(\\"git rev-parse --git-dir > /dev/null 2>&1\\")
else
source[:tag] = \\"v#{version}\\"
end
Pod::Spec.new do |s|
s.name = \\"ReactAppDependencyProvider\\"
s.version = version
s.summary = \\"The third party dependency provider for the app\\"
s.homepage = \\"https://reactnative.dev/\\"
s.documentation_url = \\"https://reactnative.dev/\\"
s.license = \\"MIT\\"
s.author = \\"Meta Platforms, Inc. and its affiliates\\"
s.platforms = min_supported_versions
s.source = source
s.source_files = \\"**/RCTAppDependencyProvider.{h,mm}\\"
# This guard prevent to install the dependencies when we run \`pod install\` in the old architecture.
s.pod_target_xcconfig = {
\\"CLANG_CXX_LANGUAGE_STANDARD\\" => rct_cxx_language_standard(),
\\"DEFINES_MODULE\\" => \\"YES\\"
}
s.dependency \\"ReactCodegen\\"
end
"
`;
exports[`execute test-app-legacy "ReactCodegen.podspec" should match snapshot 1`] = `
"# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
@@ -42,18 +42,18 @@ const packageJson = JSON.stringify({
});
[
'ReactAppDependencyProvider/RCTAppDependencyProvider.h',
'ReactAppDependencyProvider/RCTAppDependencyProvider.mm',
'ReactCodegen/RCTModuleProviders.h',
'ReactCodegen/RCTModuleProviders.mm',
'ReactCodegen/RCTModulesConformingToProtocolsProvider.h',
'ReactCodegen/RCTModulesConformingToProtocolsProvider.mm',
'ReactCodegen/RCTThirdPartyComponentsProvider.h',
'ReactCodegen/RCTThirdPartyComponentsProvider.mm',
'ReactAppDependencyProvider/ReactAppDependencyProvider.podspec',
'ReactCodegen/ReactCodegen.podspec',
'ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h',
'ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
'RCTAppDependencyProvider.h',
'RCTAppDependencyProvider.mm',
'RCTModuleProviders.h',
'RCTModuleProviders.mm',
'RCTModulesConformingToProtocolsProvider.h',
'RCTModulesConformingToProtocolsProvider.mm',
'RCTThirdPartyComponentsProvider.h',
'RCTThirdPartyComponentsProvider.mm',
'ReactAppDependencyProvider.podspec',
'ReactCodegen.podspec',
'RCTUnstableModulesRequiringMainQueueSetupProvider.h',
'RCTUnstableModulesRequiringMainQueueSetupProvider.mm',
].forEach(file => {
it(`"${file}" should match snapshot`, () => {
const generatedFileDir = path.join(outputDir, 'build/generated/ios');
@@ -1,44 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
const {TEMPLATES_FOLDER_PATH} = require('./constants');
const {codegenLog} = require('./utils');
const fs = require('fs');
const path = require('path');
const PACKAGE_SWIFT_TEMPLATE_PATH = path.join(
TEMPLATES_FOLDER_PATH,
'Package.swift.template',
);
function generatePackageSwift(
projectRoot /*: string */,
outputDir /*: string */,
reactNativePath /*: string */,
) {
const fullOutputPath = path.join(projectRoot, outputDir);
fs.mkdirSync(outputDir, {recursive: true});
// Generate PAckage.swift File
codegenLog('Generating Package.swift');
const templateH = fs
.readFileSync(PACKAGE_SWIFT_TEMPLATE_PATH, 'utf8')
.replace(
/{reactNativePath}/,
path.relative(fullOutputPath, reactNativePath),
);
const finalPathH = path.join(outputDir, 'Package.swift');
fs.writeFileSync(finalPathH, templateH);
codegenLog(`Generated artifact: ${finalPathH}`);
}
module.exports = {
generatePackageSwift,
};
@@ -22,7 +22,6 @@ const {
} = require('./generateAppDependencyProvider');
const {generateCustomURLHandlers} = require('./generateCustomURLHandlers');
const {generateNativeCode} = require('./generateNativeCode');
const {generatePackageSwift} = require('./generatePackageSwift');
const {generateRCTModuleProviders} = require('./generateRCTModuleProviders');
const {
generateRCTThirdPartyComponents,
@@ -38,7 +37,6 @@ const {
codegenLog,
findCodegenEnabledLibraries,
findDisabledLibrariesByPlatform,
findReactNativeRootPath,
pkgJsonIncludesGeneratedCode,
readPkgJsonInDirectory,
readReactNativeConfig,
@@ -101,6 +99,7 @@ function execute(
if (codegenEnabledLibraries.length === 0) {
codegenLog('No codegen-enabled libraries found.', true);
return;
}
let platforms =
@@ -115,6 +114,10 @@ function execute(
({name}) => !disabledLibraries.includes(name),
);
if (!libraries.length) {
continue;
}
const outputPath = computeOutputPath(
projectRoot,
baseOutputPath,
@@ -122,15 +125,10 @@ function execute(
platform,
);
const reactCodegenOutputPath =
platform === 'android'
? outputPath
: path.join(outputPath, 'ReactCodegen');
if (runReactNativeCodegen) {
const schemaInfos = generateSchemaInfos(libraries);
generateNativeCode(
reactCodegenOutputPath,
outputPath,
schemaInfos.filter(schemaInfo =>
mustGenerateNativeCode(projectRoot, schemaInfo),
),
@@ -141,31 +139,19 @@ function execute(
if (source === 'app' && platform !== 'android') {
// These components are only required by apps, not by libraries and are Apple specific.
generateRCTThirdPartyComponents(libraries, reactCodegenOutputPath);
generateRCTModuleProviders(
projectRoot,
pkgJson,
libraries,
reactCodegenOutputPath,
);
generateCustomURLHandlers(libraries, reactCodegenOutputPath);
generateRCTThirdPartyComponents(libraries, outputPath);
generateRCTModuleProviders(projectRoot, pkgJson, libraries, outputPath);
generateCustomURLHandlers(libraries, outputPath);
generateUnstableModulesRequiringMainQueueSetupProvider(
libraries,
reactCodegenOutputPath,
);
generateAppDependencyProvider(
path.join(outputPath, 'ReactAppDependencyProvider'),
outputPath,
);
generateAppDependencyProvider(outputPath);
generateReactCodegenPodspec(
projectRoot,
pkgJson,
reactCodegenOutputPath,
baseOutputPath,
);
generatePackageSwift(
projectRoot,
outputPath,
findReactNativeRootPath(projectRoot),
baseOutputPath,
);
}
@@ -461,17 +461,6 @@ function findDisabledLibrariesByPlatform(
);
}
function findReactNativeRootPath(projectRoot /* : string */) /* : string */ {
const reactNativePackageJsonPath = require.resolve(
path.join('react-native', 'package.json'),
{
paths: [projectRoot],
},
);
return path.dirname(reactNativePackageJsonPath);
}
module.exports = {
buildCodegenIfNeeded,
pkgJsonIncludesGeneratedCode,
@@ -485,5 +474,4 @@ module.exports = {
parseiOSAnnotations,
readReactNativeConfig,
findDisabledLibrariesByPlatform,
findReactNativeRootPath,
};
@@ -1,59 +0,0 @@
// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "React-GeneratedCode",
platforms: [.iOS(.v15), .macCatalyst(SupportedPlatform.MacCatalystVersion.v13)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "ReactCodegen",
targets: ["ReactCodegen"]),
.library(
name: "ReactAppDependencyProvider",
targets: ["ReactAppDependencyProvider"]),
],
dependencies: [
.package(name: "React", path: "{reactNativePath}")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "ReactCodegen",
dependencies: ["React"],
path: "ReactCodegen",
exclude: ["ReactCodegen.podspec"],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("headers")
],
cxxSettings: [
.headerSearchPath("headers"),
.unsafeFlags(["-std=c++20"]),
],
linkerSettings: [
.linkedFramework("Foundation")
]
),
.target(
name: "ReactAppDependencyProvider",
dependencies: ["ReactCodegen"],
path: "ReactAppDependencyProvider",
exclude: ["ReactAppDependencyProvider.podspec"],
publicHeadersPath: ".",
cSettings: [
.headerSearchPath("headers"),
],
cxxSettings: [
.headerSearchPath("headers"),
.unsafeFlags(["-std=c++20"]),
],
linkerSettings: [
.linkedFramework("Foundation")
]
)
]
)
@@ -24,8 +24,7 @@ require_relative './cocoapods/rncore.rb'
# Importing to expose use_native_modules!
require_relative './cocoapods/autolinking.rb'
$CODEGEN_OUTPUT_DIR = 'build/generated/ios/ReactCodegen'
$APP_DEPENDENCY_PROVIDER_OUTPUT_DIR = 'build/generated/ios/ReactAppDependencyProvider'
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
$CODEGEN_MODULE_DIR = '.'
@@ -201,7 +200,7 @@ def use_react_native! (
end
pod 'ReactCodegen', :path => $CODEGEN_OUTPUT_DIR, :modular_headers => true
pod 'ReactAppDependencyProvider', :path => $APP_DEPENDENCY_PROVIDER_OUTPUT_DIR, :modular_headers => true
pod 'ReactAppDependencyProvider', :path => $CODEGEN_OUTPUT_DIR, :modular_headers => true
# Not needed, but run_codegen expects this to be set.
folly_config = get_folly_config()
run_codegen!(
@@ -63,7 +63,6 @@ const cachedReportMeasure = NativePerformance.reportMeasure;
const cachedGetMarkTime = NativePerformance.getMarkTime;
const cachedNativeClearMarks = NativePerformance.clearMarks;
const cachedNativeClearMeasures = NativePerformance.clearMeasures;
let cachedTimeOrigin: ?DOMHighResTimeStamp;
const MARK_OPTIONS_REUSABLE_OBJECT: PerformanceMarkOptions = {
startTime: 0,
@@ -140,24 +139,6 @@ export default class Performance {
});
}
/**
* Returns the high resolution timestamp that is used as the baseline for
* performance-related timestamps.
* https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin
*/
get timeOrigin(): DOMHighResTimeStamp {
if (cachedTimeOrigin == null) {
if (NativePerformance.timeOrigin) {
cachedTimeOrigin = NativePerformance?.timeOrigin();
} else {
// Very naive polyfill.
cachedTimeOrigin = Date.now() - getCurrentTimeStamp();
}
}
return cachedTimeOrigin;
}
mark(
markName: string,
markOptions?: PerformanceMarkOptions,
@@ -22,37 +22,4 @@ describe('Performance', () => {
return new PerformanceEntry();
}).toThrow("Failed to construct 'PerformanceEntry': Illegal constructor");
});
describe('now', () => {
it('provides increasing timestamps since boot time', () => {
const first = performance.now();
const second = performance.now();
const third = performance.now();
expect(typeof first).toBe('number');
expect(typeof second).toBe('number');
expect(typeof third).toBe('number');
expect(first).toBeGreaterThan(0);
expect(second).toBeGreaterThan(first);
expect(third).toBeGreaterThan(second);
});
});
describe('timeOrigin', () => {
it('allows moving timestamps to Unix epoch', () => {
// We need to truncate timestamps because `Date.now()` only provides
// integer millisecond precision.
const adjustedMonotonicTime = Math.trunc(
performance.now() + performance.timeOrigin,
);
const wallTime = Date.now();
const adjustedMonotonicTimeAfter = Math.trunc(
performance.now() + performance.timeOrigin,
);
expect(wallTime).toBeGreaterThanOrEqual(adjustedMonotonicTime);
expect(adjustedMonotonicTimeAfter).toBeGreaterThanOrEqual(wallTime);
});
});
});
@@ -54,8 +54,6 @@ export type PerformanceObserverInit = {
export interface Spec extends TurboModule {
+now: () => number;
+timeOrigin?: () => number;
+reportMark: (name: string, startTime: number, entry: mixed) => void;
+reportMeasure: (
name: string,
-23
View File
@@ -44,26 +44,3 @@ configure<com.facebook.react.ReactSettingsExtension> {
lockFiles = files("yarn.lock"),
)
}
// Gradle properties defined in `gradle.properties` are not inherited by
// included builds, see https://github.com/gradle/gradle/issues/2534.
// This is a workaround to read the configuration from the consuming project,
// and apply relevant properties to the :react-native project.
buildscript {
val properties = java.util.Properties()
val propertiesToInherit = listOf("hermesV1Enabled", "react.hermesV1Enabled")
try {
file("../../android/gradle.properties").inputStream().use { properties.load(it) }
gradle.rootProject {
propertiesToInherit.forEach { property ->
if (properties.containsKey(property)) {
gradle.rootProject.extra.set(property, properties.getProperty(property))
}
}
}
} catch (e: Exception) {
// fail silently
}
}