Skip to content

Commit

Permalink
Merge pull request #5874 from wordpress-mobile/upgrade/react-native-0…
Browse files Browse the repository at this point in the history
….71.8

Upgrade React Native `0.71.11`
  • Loading branch information
fluiddot authored Jul 27, 2023
2 parents 231596e + b837251 commit 622322d
Show file tree
Hide file tree
Showing 79 changed files with 7,442 additions and 2,421 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ steps:
agents:
queue: mac
env:
IMAGE_ID: xcode-14.3
IMAGE_ID: xcode-14.3.1
15 changes: 15 additions & 0 deletions .buildkite/publish-react-native-ios-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
echo "--- :arrow_down: Download iOS JS bundle"
buildkite-agent artifact download bundle/ios/App.js .

echo '--- :node: Setup node_modules for RNReanimated'
echo '--- :node: 1. Install nvm'
brew install nvm

echo '--- :node: 2. Load nvm in the current shell'
export NVM_DIR="$HOME/.nvm"
mkdir -p "$NVM_DIR"
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" --install

echo '--- :node: 3. Install node version from .nvmrc'
nvm install "$(cat .nvmrc)" && nvm use

echo '--- :node: 4. nmp ci'
npm ci

echo "--- :rubygems: Setting up Gems"
cd ./ios-xcframework

Expand Down
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Unreleased
---
* [**] Upgrade React Native to 0.71.11 [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5874]

1.100.1
---
Expand Down
15 changes: 8 additions & 7 deletions __device-tests__/gutenberg-editor-sanity-test-1-visual.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const {
} = e2eUtils;
import { NESTED_COLUMNS_3_LEVELS } from './test-editor-data';

const ANDROID_COLUMN_APPENDER_BUTTON_XPATH =
'//android.widget.Button[@content-desc="Column Block. Row 1"]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.Button';

describe( 'Gutenberg Editor - Test Suite 1', () => {
describe( 'Columns block', () => {
it( 'displays placeholders when unselected', async () => {
Expand Down Expand Up @@ -47,8 +50,8 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
);
await columnsBlock.click();

// Navigate upwards in block hierarchy
await editorPage.moveBlockSelectionUp( { toRoot: true } );

await editorPage.removeBlock();
} );

Expand All @@ -67,7 +70,7 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
'//android.widget.Button[@content-desc="Column Block. Row 1"]/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.Button/android.view.ViewGroup/android.view.ViewGroup'
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
Expand Down Expand Up @@ -124,7 +127,7 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
'//android.widget.Button[@content-desc="Column Block. Row 1"]/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.Button/android.view.ViewGroup/android.view.ViewGroup'
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
Expand Down Expand Up @@ -194,7 +197,7 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
'//android.widget.Button[@content-desc="Column Block. Row 1"]/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.Button/android.view.ViewGroup/android.view.ViewGroup'
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
Expand Down Expand Up @@ -252,9 +255,7 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
// Wait for the modal to open
await editorPage.driver.sleep( 3000 );

const cellId = isAndroid()
? 'Column 1. Width is 50 Percent (%)., double-tap to change unit'
: 'Column 1. Width is 50 Percent (%).';
const cellId = 'Column 1. Width is 50 Percent (%).';
const cell = await editorPage.driver.elementByAccessibilityId(
cellId
);
Expand Down
29 changes: 19 additions & 10 deletions bin/generate-podspecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ RN_DIR="./"
SCRIPTS_PATH="./scripts/"
CODEGEN_REPO_PATH="../packages/react-native-codegen"
CODEGEN_NPM_PATH="../react-native-codegen"
PACKAGE_JSON_PATH="./package.json"
SRCS_DIR=${SRCS_DIR:-$(cd "./Libraries" && pwd)}
RN_VERSION=$(cat ./package.json | grep -m 1 version | sed 's/[^0-9.]//g')
HERMES_ENABLED="true"

RN_PODSPECS=$(find * -type f -name "*.podspec" -not -name "React-rncore.podspec" -not -path "third-party-podspecs/*" -not -path "*Fabric*" -print)
TMP_DEST=$(mktemp -d)
Expand Down Expand Up @@ -161,23 +163,30 @@ do
fi

# Generate React-Codegen
# A copy of react_native_pods is done to modify the content within get_react_codegen_spec
# A copy of codegen_utils.rb is done to modify the content within get_react_codegen_spec
# this enables getting the schema for React-Codegen in runtime by printing the content.
echo "Generating React-Codegen"
REACT_NATIVE_PODS_PATH="$SCRIPTS_PATH/react_native_pods.rb"
REACT_NATIVE_PODS_MODIFIED_PATH="$SCRIPTS_PATH/react_native_pods_modified.rb"
# Making a temp copy of react_native_pods.rb
cp $REACT_NATIVE_PODS_PATH $REACT_NATIVE_PODS_MODIFIED_PATH
REACT_NATIVE_CODEGEN_UTILS_PATH="$SCRIPTS_PATH/cocoapods/codegen_utils.rb"
REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH="$SCRIPTS_PATH/cocoapods/codegen_utils_modified.rb"
# Making a temp copy of codegen_utils.rb
cp $REACT_NATIVE_CODEGEN_UTILS_PATH $REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH
# Manually add the min_ios_version_supported variable to the CodegenUtils class
# The modified script won't be able to detect min_ios_version_supported otherwise
echo "
def min_ios_version_supported
'12.4'
end
" >> "$REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH"
# Modify the get_react_codegen_spec method to return the result using print and JSON.pretty
sed -i '' -e "s/:git => ''/:git => 'https:\/\/github.com\/facebook\/react-native.git', :tag => 'v$RN_VERSION'/" "$REACT_NATIVE_PODS_MODIFIED_PATH"
sed -i '' -e 's/return spec/print JSON.pretty_generate(spec)/' "$REACT_NATIVE_PODS_MODIFIED_PATH"
sed -i '' -e "s/:git => ''/:git => 'https:\/\/github.com\/facebook\/react-native.git', :tag => 'v$RN_VERSION'/" "$REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH"
sed -i '' -e 's/return spec/print JSON.pretty_generate(spec)/' "$REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH"
# Run get_react_codegen_spec and generate React-Codegen.podspec.json
ruby -r "./scripts/react_native_pods_modified.rb" -e "get_react_codegen_spec" > "$DEST/React-Codegen.podspec.json"
ruby -r "./scripts/cocoapods/codegen_utils_modified.rb" -e "CodegenUtils.new.get_react_codegen_spec('$PACKAGE_JSON_PATH', hermes_enabled:$HERMES_ENABLED)" > "$DEST/React-Codegen.podspec.json"
TMP_ReactCodeGenSpec=$(mktemp)
jq '.source_files = "third-party-podspecs/FBReactNativeSpec/**/*.{c,h,m,mm,cpp}"' "$DEST/React-Codegen.podspec.json" > "$TMP_ReactCodeGenSpec"
mv "$TMP_ReactCodeGenSpec" "$DEST/React-Codegen.podspec.json"
# Remove temp copy of react_native_pods.rb
rm $REACT_NATIVE_PODS_MODIFIED_PATH
# Remove temp copy of codegen_utils.rb
rm $REACT_NATIVE_CODEGEN_UTILS_MODIFIED_PATH

echo "Generating schema from Flow types"
"$NODE_BINARY" "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
Expand Down
Binary file modified bundle/ios/App.js
Binary file not shown.
2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 622322d

Please sign in to comment.