From fdfcb451b643832d1da532de69959e3b16f1b239 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Tue, 6 Jun 2023 18:06:51 +0200 Subject: [PATCH 1/2] Add `react-native-reanimated` library --- .buildkite/publish-libraries.sh | 8 ++++++- package-lock.json | 41 +++++++++++++++++++++++++++++++++ package.json | 1 + settings.gradle.kts | 2 ++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/.buildkite/publish-libraries.sh b/.buildkite/publish-libraries.sh index f4ead82..4535990 100755 --- a/.buildkite/publish-libraries.sh +++ b/.buildkite/publish-libraries.sh @@ -13,6 +13,7 @@ react-native-webview react-native-masked-view react-native-clipboard react-native-fast-image +react-native-reanimated ) for project in "${PROJECTS[@]}" @@ -21,6 +22,11 @@ do ./gradlew :$project:assertVersionIsNotAlreadyPublished || EXIT_CODE=$? # If the project is not published already, publish it if [ $EXIT_CODE -eq 0 ]; then - ./gradlew :$project:publishS3PublicationToS3Repository + # Force using Hermes and adding the artifact when publishing Reanimated + if [ "${project}" == "react-native-reanimated" ]; then + CLIENT_SIDE_BUILD="True" JS_RUNTIME="hermes" ./gradlew :$project:publishS3PublicationToS3Repository + else + ./gradlew :$project:publishS3PublicationToS3Repository + fi fi done diff --git a/package-lock.json b/package-lock.json index d67fe8d..2a5cf47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -715,6 +715,15 @@ "@babel/helper-plugin-utils": "^7.21.5" } }, + "@babel/plugin-transform-object-assign": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.18.6.tgz", + "integrity": "sha512-mQisZ3JfqWh2gVXvfqYCAAyRs6+7oev+myBsTwW5RnPhYXOTuCEw2oe3YgxlXMViXUS53lG8koulI7mJ+8JE+A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.18.6" + } + }, "@babel/plugin-transform-object-super": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", @@ -3627,6 +3636,12 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -5007,6 +5022,20 @@ "integrity": "sha512-7F6bD7B8Xsn3JllxcwHhFcsl9aHIig47+3eN4IHFNqfLhZr++3ElDrcqfMzugM+niWbaMi7bJ0kAkAL8eCpdWg==", "dev": true }, + "react-native-reanimated": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-2.17.0.tgz", + "integrity": "sha512-bVy+FUEaHXq4i+aPPqzGeor1rG4scgVNBbBz21ohvC7iMpB9IIgvGsmy1FAoodZhZ5sa3EPF67Rcec76F1PXlQ==", + "dev": true, + "requires": { + "@babel/plugin-transform-object-assign": "^7.16.7", + "@babel/preset-typescript": "^7.16.7", + "invariant": "^2.2.4", + "lodash.isequal": "^4.5.0", + "setimmediate": "^1.0.5", + "string-hash-64": "^1.0.3" + } + }, "react-native-safe-area-context": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-3.2.0.tgz", @@ -5339,6 +5368,12 @@ } } }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -5658,6 +5693,12 @@ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true }, + "string-hash-64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string-hash-64/-/string-hash-64-1.0.3.tgz", + "integrity": "sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw==", + "dev": true + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", diff --git a/package.json b/package.json index 230d494..035baf1 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@react-native-masked-view/masked-view": "0.2.6", "@react-native-clipboard/clipboard": "1.9.0", "react-native-fast-image": "8.5.11", + "react-native-reanimated": "2.17.0", "react-native": "0.71.8" }, "dependencies": { diff --git a/settings.gradle.kts b/settings.gradle.kts index 41f35ef..5c75ecc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,3 +32,5 @@ include(":react-native-clipboard") project(":react-native-clipboard").projectDir = File(rootProject.projectDir, "node_modules/@react-native-clipboard/clipboard/android") include(":react-native-fast-image") project(":react-native-fast-image").projectDir = File(rootProject.projectDir, "node_modules/react-native-fast-image/android") +include(":react-native-reanimated") +project(":react-native-reanimated").projectDir = File(rootProject.projectDir, "node_modules/react-native-reanimated/android") From d00056f4a48f8b3336c86b29ec86d4198c92e096 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Mon, 12 Jun 2023 11:36:10 +0200 Subject: [PATCH 2/2] Use env vars when building and publishing Reanimated library --- .buildkite/publish-libraries.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.buildkite/publish-libraries.sh b/.buildkite/publish-libraries.sh index 4535990..2dc6526 100755 --- a/.buildkite/publish-libraries.sh +++ b/.buildkite/publish-libraries.sh @@ -16,17 +16,17 @@ react-native-fast-image react-native-reanimated ) +# `react-native-reanimated` library uses JSC by default. These env vars will force it to use Hermes instead. +# Reference: https://t.ly/DQou +export CLIENT_SIDE_BUILD="True" +export JS_RUNTIME="hermes" + for project in "${PROJECTS[@]}" do EXIT_CODE=0 ./gradlew :$project:assertVersionIsNotAlreadyPublished || EXIT_CODE=$? # If the project is not published already, publish it if [ $EXIT_CODE -eq 0 ]; then - # Force using Hermes and adding the artifact when publishing Reanimated - if [ "${project}" == "react-native-reanimated" ]; then - CLIENT_SIDE_BUILD="True" JS_RUNTIME="hermes" ./gradlew :$project:publishS3PublicationToS3Repository - else - ./gradlew :$project:publishS3PublicationToS3Repository - fi + ./gradlew :$project:publishS3PublicationToS3Repository fi done