Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to RN 0.64.0 #3430

Merged
merged 80 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d1a4f45
Update gutenberg reference
cameronvoell Apr 29, 2021
bf0c748
Update package-lock
cameronvoell Apr 29, 2021
ac8d3ca
Update gutenberg ref
cameronvoell May 7, 2021
c1ae681
Updated gutenberg ref
cameronvoell May 13, 2021
9578b2a
Updating gutenberg ref
cameronvoell May 14, 2021
861aa05
Merge branch 'develop' into try/upgrade-0-64
cameronvoell May 14, 2021
70d14c4
Updated hermes executable to hermesc for building bundle
cameronvoell May 17, 2021
42c9c67
Updated bundle
cameronvoell May 17, 2021
0030252
Update gutenberg ref
ceyhun May 18, 2021
13ab76b
Add changes to package-lock.json after running npm install
ceyhun May 18, 2021
3958c64
Disabled npm cache on CI
ceyhun May 18, 2021
607fefe
Update gutenberg ref
ceyhun May 19, 2021
4517c6d
Add @react-native to transformIgnorePatterns in jest config
ceyhun May 19, 2021
faa7f30
Update gutenberg ref
ceyhun May 19, 2021
d9f119a
Update gutenberg ref
ceyhun May 19, 2021
4730f3f
updated gutenberg ref
cameronvoell May 20, 2021
6114b71
Upgrade react-native related devDependencies
ceyhun May 20, 2021
18570dc
Update gutenberg ref
ceyhun May 20, 2021
d59562e
Fix check correctness diff error
ceyhun May 20, 2021
a6605d3
Update gutenberg ref
ceyhun May 20, 2021
a4dfb5f
Update gutenberg ref
cameronvoell May 20, 2021
7e1f7d9
Updated bundle files
cameronvoell May 20, 2021
523f824
Updated gutenberg ref
cameronvoell May 20, 2021
101ace3
Updated gutenberg ref
cameronvoell May 20, 2021
b48127d
Updated gutenberg ref
cameronvoell May 20, 2021
e053a9b
Adding cache-version file for re-running circle-ci
cameronvoell May 20, 2021
bbc0ca5
Update gutenberg ref
cameronvoell May 20, 2021
622a327
Updated gutenberg ref
cameronvoell May 20, 2021
5922353
Updated ref, removed react-native-mirror s3 from bridge gradle
cameronvoell May 21, 2021
dcab4a8
updated bundle
cameronvoell May 21, 2021
affb5ff
Update podspecs by running generate-podspecs.sh script
ceyhun May 21, 2021
d9e8a95
Updating gutenberg ref
cameronvoell May 21, 2021
191e88a
Merge branch 'develop' into try/upgrade-0-64
cameronvoell May 21, 2021
1ae1978
Update bundle
cameronvoell May 21, 2021
eac4768
Update gutenberg ref
ceyhun May 25, 2021
9ad755f
Revert "Disabled npm cache on CI"
ceyhun May 25, 2021
d6422ff
Modify generate-podspecs.sh script to run FBReactNativeSpec codegen a…
ceyhun May 31, 2021
900921c
Update gutenberg ref
ceyhun May 31, 2021
310ff4c
Update package-lock.json
ceyhun Jun 1, 2021
3ebb08a
Update package-lock.json
ceyhun Jun 1, 2021
49563f4
Add workaround for FBReactNativeSpec podspec in generate-poscpecs.sh …
ceyhun Jun 1, 2021
0267a7e
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
4d5c216
Fix typo
ceyhun Jun 1, 2021
75d3ff9
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
590b352
Add missing external podspecs to generate-podspecs.sh script
ceyhun Jun 1, 2021
6646ca0
Re-generate third-party-podspecs, remove react-native-linear-gradient…
ceyhun Jun 1, 2021
504cae3
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
c092aba
Add exception for react-native-slider fork
ceyhun Jun 1, 2021
dffe6f9
Remove tag from react-native-slider podspec
ceyhun Jun 1, 2021
5bbfc23
Fix react-native-slider git source
ceyhun Jun 1, 2021
c2652ed
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 2, 2021
3fea75d
Update gutenberg ref
ceyhun Jun 2, 2021
ab02d3a
Update bundles
ceyhun Jun 2, 2021
6eef209
Update gutenberg ref
ceyhun Jun 7, 2021
e368d21
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 7, 2021
a4d4202
Update jetpack ref
ceyhun Jun 7, 2021
0827c62
Update bundles
ceyhun Jun 7, 2021
ee5c7e2
Update gutenberg ref
cameronvoell Jun 7, 2021
200a819
Update gutenberg ref
ceyhun Jun 8, 2021
7fa9049
Re-run generate-podspecs.sh to update BVLinearGradient podspec
ceyhun Jun 8, 2021
25d37af
Update gutenberg ref
ceyhun Jun 8, 2021
280a4fa
Update bundles
ceyhun Jun 8, 2021
375ac02
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 14, 2021
a10fd2d
Update gutenberg ref
ceyhun Jun 14, 2021
daff1a2
Changes to package-lock.json after running npm install
ceyhun Jun 14, 2021
6e58521
Update bundles
ceyhun Jun 14, 2021
23fc662
Run ./bin/generate-podspecs.sh
ceyhun Jun 14, 2021
8de898b
Add a few improvements and checks to generate-podspecs.sh
ceyhun Jun 16, 2021
c883138
Add a warning field at the bottom of all podspecs
ceyhun Jun 16, 2021
955f424
Add a warning when the tag or commit field is missing in a podspec
ceyhun Jun 16, 2021
2442b0c
Patch react-native-blur.podspec adding the missing tag
ceyhun Jun 16, 2021
6f87419
Better wording
ceyhun Jun 16, 2021
76d3138
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 16, 2021
443615b
Update bundles
ceyhun Jun 16, 2021
74637e3
Update FBReactNativeSpec ref
ceyhun Jun 16, 2021
cf03c94
Indent patch messages
ceyhun Jun 16, 2021
084cf3d
Patch react-native-blur.podspec again as 3.6.0 tag is missing
ceyhun Jun 16, 2021
f9c415d
Update gutenberg ref
ceyhun Jun 16, 2021
bab0ab4
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 16, 2021
1a4c7e6
Update bundles
ceyhun Jun 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/cache-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# To invalidate the cache, generate a new UUID using `uuidgen` on the command line then paste it here
BD31B30E-7154-402F-AF62-80C50D4BE2CB
102 changes: 94 additions & 8 deletions bin/generate-podspecs.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,91 @@
#!/bin/sh
#!/bin/bash

# Exit if any command fails
set -e

function warn_missing_tag_commit() {
RED="\033[0;31m"
NO_COLOR="\033[0m"
PODSPEC_HAS_TAG_OR_COMMIT=$(jq '.source | has("tag") or has("commit")' "$DEST/$pod.podspec.json")
if [[ $PODSPEC_HAS_TAG_OR_COMMIT == "false" ]]; then
printf "${RED}WARNING! $pod.podspec doesn't have a 'tag' or 'commit' field. Either modify this script to add a patch during the podspec generation or modify the original $pod.podspec in the source repo.${NO_COLOR}\n"
exit 1
fi
}

# Change to the expected directory.
cd "$( dirname $0 )"
cd "$( dirname "$0" )"
cd ..
WD=$(pwd)
echo "Working directory: $WD"

# Check for cocoapods & jq
command -v pod > /dev/null || ( echo Cocoapods is required to generate podspecs; exit 1 )
command -v jq > /dev/null || ( echo jq is required to generate podspecs; exit 1 )

WD=$(pwd)
read -r -p "If your node_modules folder isn't up-to-date please run 'npm install' first and re-run the script. Is your node_modules folder up-to-date? [y/N] " PROMPT_RESPONSE
if [[ $PROMPT_RESPONSE != "y" ]]; then
echo "Please run npm install first and re-run the script."
exit 1
fi

read -r -p "Enter the commit hash of previous commit. If this is the first-time running this script, enter 0, then commit generated files and re-rerun the script and this time use the previous commit hash: " COMMIT_HASH
if [[ -z "$COMMIT_HASH" ]]; then
echo "Commit hash cannot be empty."
exit 1
fi

DEST="${WD}/third-party-podspecs"
NODE_MODULES_DIR="gutenberg/node_modules"

# Generate the external (non-RN podspecs)
EXTERNAL_PODSPECS=$(find "$NODE_MODULES_DIR/react-native/third-party-podspecs" \
"$NODE_MODULES_DIR/react-native-svg" \
"$NODE_MODULES_DIR/@react-native-community/blur" \
"$NODE_MODULES_DIR/@react-native-community/masked-view" \
"$NODE_MODULES_DIR/@react-native-community/slider" \
"$NODE_MODULES_DIR/react-native-dark-mode" \
"$NODE_MODULES_DIR/react-native-gesture-handler" \
"$NODE_MODULES_DIR/react-native-get-random-values" \
"$NODE_MODULES_DIR/react-native-keyboard-aware-scroll-view" \
"$NODE_MODULES_DIR/react-native-linear-gradient" \
"$NODE_MODULES_DIR/react-native-reanimated" \
"$NODE_MODULES_DIR/react-native-safe-area" \
"$NODE_MODULES_DIR/react-native-dark-mode" \
"$NODE_MODULES_DIR/react-native-get-random-values" -type f -name "*.podspec" -print)
"$NODE_MODULES_DIR/react-native-safe-area-context" \
"$NODE_MODULES_DIR/react-native-screens" \
"$NODE_MODULES_DIR/react-native-svg" \
"$NODE_MODULES_DIR/react-native-video"\
-type f -name "*.podspec" -print)

for podspec in $EXTERNAL_PODSPECS
do
pod=$(basename "$podspec" .podspec)

echo "Generating podspec for $pod"
pod ipc spec $podspec > "$DEST/$pod.podspec.json"
pod ipc spec "$podspec" > "$DEST/$pod.podspec.json"

# react-native-slider is the only gutenberg-mobile fork where we don't use the native files from the original repo
if [[ "$pod" == "react-native-slider" ]]; then
echo "==> Patching $pod podspec"
TMP_RNSliderSpec=$(mktemp)
jq '.source.git = "https://github.com/wordpress-mobile/react-native-slider.git" | .source.commit = "d263ff16cdd9fb7352b354342522ff030f220f42" | del(.source.tag)' "$DEST/$pod.podspec.json" > "$TMP_RNSliderSpec"
mv "$TMP_RNSliderSpec" "$DEST/$pod.podspec.json"
fi

# react-native-blur doesn't have a tag field in it's podspec
if [[ "$pod" == "react-native-blur" ]]; then
echo "==> Patching $pod podspec"
TMP_RNBlurPodspec=$(mktemp)
jq '.source.tag = "v3.6.0" | .version = "3.6.0"' "$DEST/$pod.podspec.json" > "$TMP_RNBlurPodspec"
mv "$TMP_RNBlurPodspec" "$DEST/$pod.podspec.json"
fi

# Add warning to bottom
TMP_SPEC=$(mktemp)
jq '. + {"__WARNING!__": "This file is autogenerated by generate-podspecs.sh script. Do not modify manually. Re-run the script if necessary."}' "$DEST/$pod.podspec.json" > "$TMP_SPEC"
mv "$TMP_SPEC" "$DEST/$pod.podspec.json"

# As a last step check if podspec has a "tag" or "commit" field in "source"
warn_missing_tag_commit
done

# Generate the React Native podspecs
Expand All @@ -44,11 +101,40 @@ do
path=$(dirname "$podspec")

echo "Generating podspec for $pod with path $path"
pod ipc spec $podspec > "$TMP_DEST/$pod.podspec.json"
pod ipc spec "$podspec" > "$TMP_DEST/$pod.podspec.json"
cat "$TMP_DEST/$pod.podspec.json" | jq > "$DEST/$pod.podspec.json"

# Add a "prepare_command" entry to each podspec so that 'pod install' will fetch sources from the correct directory
# and retains the existing prepare_command if it exists
prepare_command="TMP_DIR=\$(mktemp -d); mv * \$TMP_DIR; cp -R \"\$TMP_DIR/${path}\"/* ."
cat "$TMP_DEST/$pod.podspec.json" | jq --arg CMD "$prepare_command" '.prepare_command = "\($CMD) && \(.prepare_command // true)"' > "$DEST/$pod.podspec.json"

# Add warning to bottom
TMP_SPEC=$(mktemp)
jq '. + {"__WARNING!__": "This file is autogenerated by generate-podspecs.sh script. Do not modify manually. Re-run the script if necessary."}' "$DEST/$pod.podspec.json" > "$TMP_SPEC"
mv "$TMP_SPEC" "$DEST/$pod.podspec.json"

# As a last step check if podspec has a "tag" or "commit" field in "source"
warn_missing_tag_commit

# FBReactNativeSpec needs special treatment because of react-native-codegen code generation
if [[ "$pod" == "FBReactNativeSpec" ]]; then
echo "==> Modyfing $pod podspec"
# First move it to its own folder
mkdir -p "$DEST/FBReactNativeSpec"
mv "$DEST/FBReactNativeSpec.podspec.json" "$DEST/FBReactNativeSpec"

# Then we generate FBReactNativeSpec-generated.mm and FBReactNativeSpec.h files.
# They are normally generated during compile time using a Script Phase in FBReactNativeSpec added via the `use_react_native_codegen` function.
# This script is inside node_modules/react-native/scripts folder. Since we don't have the node_modules when compiling WPiOS,
# we're calling the script here manually to generate these files ahead of time.
CODEGEN_MODULES_OUTPUT_DIR=$DEST/FBReactNativeSpec ./scripts/generate-specs.sh

# Removing 'script_phases' that shouldn't be needed anymore.
# Removing 'prepare_command' that includes additional steps to create intermediate folders to keep generated files which won't be needed.
# Removing 'source.tag' as we'll use a commit hash from gutenberg-mobile instead.
TMP_FBReactNativeSpec=$(mktemp)
jq --arg COMMIT_HASH "$COMMIT_HASH" 'del(.script_phases) | del(.prepare_command) | del(.source.tag) | .source.git = "https://github.com/wordpress-mobile/gutenberg-mobile.git" | .source.commit = $COMMIT_HASH | .source.submodules = "true" | .source_files = "third-party-podspecs/FBReactNativeSpec/**/*.{c,h,m,mm,cpp}"' "$DEST/FBReactNativeSpec/FBReactNativeSpec.podspec.json" > "$TMP_FBReactNativeSpec"
mv "$TMP_FBReactNativeSpec" "$DEST/FBReactNativeSpec/FBReactNativeSpec.podspec.json"
fi
done
5,886 changes: 2,942 additions & 2,944 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 99 files
+6 −0 .eslintrc.js
+3 −1 .github/workflows/rnmobile-ios-runner.yml
+0 −20 changelog.txt
+1 −1 gutenberg.php
+1 −2 lib/blocks.php
+2 −2 lib/client-assets.php
+2,139 −2,801 package-lock.json
+7 −7 package.json
+1 −1 packages/babel-plugin-import-jsx-pragma/package.json
+1 −1 packages/babel-plugin-makepot/package.json
+1 −1 packages/block-directory/package.json
+1 −0 packages/block-editor/src/components/block-list/index.native.js
+0 −1 packages/block-editor/src/components/block-list/style.native.scss
+1 −3 packages/block-editor/src/components/block-navigation/block-contents.js
+0 −3 packages/block-editor/src/components/block-navigation/block-select-button.js
+0 −5 packages/block-editor/src/components/block-navigation/block-slot.js
+1 −5 packages/block-editor/src/components/block-navigation/block.js
+2 −26 packages/block-editor/src/components/block-navigation/branch.js
+0 −24 packages/block-editor/src/components/block-navigation/expander.js
+8 −52 packages/block-editor/src/components/block-navigation/style.scss
+1 −45 packages/block-editor/src/components/block-navigation/tree.js
+1 −1 packages/block-editor/src/components/navigable-toolbar/index.js
+5 −1 packages/block-editor/src/components/plain-text/index.native.js
+1 −1 packages/block-library/package.json
+13 −42 packages/block-library/src/image/image.js
+0 −2 packages/block-library/src/missing/test/__snapshots__/edit.native.js.snap
+7 −5 packages/block-library/src/post-content/edit.js
+6 −1 packages/block-library/src/post-excerpt/edit.js
+6 −1 packages/block-library/src/post-title/edit.js
+9 −3 packages/block-library/src/utils/hooks.js
+1 −1 packages/components/package.json
+4 −12 packages/components/src/mobile/html-text-input/test/index.native.js
+3 −3 packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js
+3 −3 packages/components/src/mobile/picker/index.android.js
+5 −1 packages/components/src/sandbox/index.js
+7 −0 packages/components/src/scroll-lock/test/index.js
+5 −49 packages/components/src/tree-grid/index.js
+3 −3 packages/components/src/ui/popover/test/__snapshots__/index.js.snap
+1 −1 packages/components/src/ui/tooltip/test/__snapshots__/index.js.snap
+0 −4 packages/compose/CHANGELOG.md
+9 −5 packages/compose/README.md
+0 −1 packages/compose/package.json
+63 −0 packages/compose/src/higher-order/with-safe-timeout/index.js
+0 −84 packages/compose/src/higher-order/with-safe-timeout/index.tsx
+1 −1 packages/compose/src/hooks/use-constrained-tabbing/index.js
+5 −20 packages/compose/src/hooks/use-dialog/index.js
+4 −4 packages/compose/src/hooks/use-focus-on-mount/index.js
+2 −7 packages/compose/src/hooks/use-preferred-color-scheme/index.ios.js
+28 −1 packages/compose/tsconfig.json
+1 −0 packages/core-data/README.md
+1 −1 packages/core-data/package.json
+0 −1 packages/core-data/src/entities.js
+12 −10 packages/core-data/src/resolvers.js
+7 −10 packages/core-data/src/selectors.js
+38 −14 packages/core-data/src/test/selectors.js
+1 −1 packages/customize-widgets/package.json
+1 −1 packages/e2e-tests/package.json
+9 −0 packages/e2e-tests/specs/editor/plugins/templates.test.js
+0 −3 packages/e2e-tests/specs/performance/site-editor.test.js
+1 −1 packages/edit-navigation/package.json
+1 −1 packages/edit-post/package.json
+2 −4 packages/edit-post/src/components/header/template-title/delete-template.js
+1 −2 packages/edit-post/src/components/secondary-sidebar/style.scss
+1 −1 packages/edit-site/package.json
+1 −1 packages/edit-widgets/package.json
+1 −1 packages/editor/package.json
+2 −2 packages/element/package.json
+0 −1 packages/icons/src/index.js
+0 −12 packages/icons/src/library/chevron-right-small.js
+1 −1 packages/jest-preset-default/package.json
+3 −1 packages/jest-preset-default/scripts/setup-test-framework.js
+3 −3 packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java
+3 −0 packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.m
+18 −3 packages/react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.swift
+10 −8 packages/react-native-aztec/src/AztecView.js
+4 −3 packages/react-native-bridge/android/react-native-bridge/build.gradle
+12 −2 packages/react-native-editor/android/app/build.gradle
+2 −1 packages/react-native-editor/android/build.gradle
+6 −0 packages/react-native-editor/android/gradle.properties
+14 −19 packages/react-native-editor/android/gradlew
+3 −0 packages/react-native-editor/android/gradlew.bat
+1 −1 packages/react-native-editor/ios/Gemfile
+36 −26 packages/react-native-editor/ios/Gemfile.lock
+7 −5 packages/react-native-editor/ios/GutenbergDemo.xcodeproj/project.pbxproj
+28 −36 packages/react-native-editor/ios/Podfile
+270 −209 packages/react-native-editor/ios/Podfile.lock
+0 −13 packages/react-native-editor/metro-patch/metro+0.56.4.patch
+16 −19 packages/react-native-editor/package.json
+1 −1 packages/react-native-editor/sass-transformer.js
+2 −5 packages/react-native-editor/src/index.js
+1 −1 packages/reusable-blocks/package.json
+1 −1 packages/widgets/package.json
+0 −95 patches/react-native+0.61.5.patch
+4 −4 phpunit/class-vendor-script-filename-test.php
+1 −1 readme.txt
+1 −1 test/native/enzyme.config.js
+1 −1 test/native/jest.config.js
+15 −2 test/native/setup.js
+0 −1 tsconfig.json
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
// See: https://github.com/wordpress-mobile/gutenberg-mobile/pull/257#discussion_r234978268
// There is no overloading in jest so we need to rewrite the config from react-native-jest-preset:
// https://github.com/facebook/react-native/blob/master/jest-preset.json#L20
'node_modules/(?!(simple-html-tokenizer|@react-native-community|(jest-)?react-native|react-clone-referenced-element))',
'node_modules/(?!(simple-html-tokenizer|@react-native-community|(jest-)?react-native|@react-native|react-clone-referenced-element))',
],
reporters: [ 'default', 'jest-junit' ],
};
Loading