Skip to content

Commit

Permalink
Release 1.56.0 (#3664)
Browse files Browse the repository at this point in the history
* Update gutenberg reference

* Update package-lock

* Update gutenberg ref

* Updated gutenberg ref

* Updating gutenberg ref

* Updated hermes executable to hermesc for building bundle

* Updated bundle

* Update gutenberg ref

* Add changes to package-lock.json after running npm install

* Disabled npm cache on CI

* Update gutenberg ref

* Add @react-native to transformIgnorePatterns in jest config

Expecting this to fix the following error:
```
/home/circleci/project/gutenberg/node_modules/@react-native/polyfills/error-guard.js:14
type ErrorHandler = (error: mixed, isFatal: boolean) => void;
        ^^^^^^^^^^^^

SyntaxError: Unexpected identifier

    at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
    at Object.<anonymous> (gutenberg/node_modules/react-native/jest/setup.js:434:6)
```

* Update gutenberg ref

* Update gutenberg ref

* updated gutenberg ref

* Upgrade react-native related devDependencies

* Update gutenberg ref

* Fix check correctness diff error

* Update gutenberg ref

* Update gutenberg ref

* Updated bundle files

* Updated gutenberg ref

* Updated gutenberg ref

* Updated gutenberg ref

* Adding cache-version file for re-running circle-ci

* Update gutenberg ref

* Updated gutenberg ref

* Updated ref, removed react-native-mirror s3 from bridge gradle

* updated bundle

* Update podspecs by running generate-podspecs.sh script

* Updating gutenberg ref

* Update bundle

* Update gutenberg ref

* Revert "Disabled npm cache on CI"

This reverts commit 3958c64.

* Modify generate-podspecs.sh script to run FBReactNativeSpec codegen ahead of time

* Update gutenberg ref

* Update package-lock.json

* Update package-lock.json

* Add workaround for FBReactNativeSpec podspec in generate-poscpecs.sh script

* Update commit hash of FBReactNativeSpec

* Fix typo

* Update commit hash of FBReactNativeSpec

* Add missing external podspecs to generate-podspecs.sh script

* Re-generate third-party-podspecs, remove react-native-linear-gradient podspec

* Update commit hash of FBReactNativeSpec

* Add exception for react-native-slider fork

* Remove tag from react-native-slider podspec

* Fix react-native-slider git source

* Update gutenberg ref

* Update bundles

* Update gutenberg reference

* Update release notes with fix for Gboard enter detection

* Update gutenberg ref

* Update jetpack ref

* Update bundles

* Update gutenberg ref

* Update gutenberg ref

* Re-run generate-podspecs.sh to update BVLinearGradient podspec

* Update gutenberg ref

* Update bundles

* Shallow clone project for CI tasks

Decrease CI task duration by reducing depth of git operations.

- [CircleCI: Shallow Repository Cloning](https://support.circleci.com/hc/en-us/articles/360045096514-Shallow-Repository-Cloning)
- [CircleCI: How do I modify the checkout step?](https://support.circleci.com/hc/en-us/articles/115015659247-How-do-I-modify-the-checkout-step-)
- [Example: CircleCI Shallow Clone](https://discuss.circleci.com/t/shallow-clone-for-circleci-2-0-builds/20200)

* Update Gutenberg ref

* Updates gutenberg reference

* Update Gutenberg submodule ref

Fix component inspector error in React Native

* Bump Gutenberg to latest trunk

* Update gutenberg ref

* Changes to package-lock.json after running npm install

* Update bundles

* Run ./bin/generate-podspecs.sh

* Update gutenberg ref to merge commit

* Update Gutenberg ref

* Add a few improvements and checks to generate-podspecs.sh

* Add a warning field at the bottom of all podspecs

* Add a warning when the tag or commit field is missing in a podspec

* Patch react-native-blur.podspec adding the missing tag

* Better wording

* Update bundles

* Update FBReactNativeSpec ref

* Indent patch messages

* Patch react-native-blur.podspec again as 3.6.0 tag is missing

* CI fetches commit reference directly

The CI configuration is set to clone with a depth of 1. If the CI tasks
then attempts to reference an older commit in the relevant branch, an
error occurs. This might occur when a branch merge occurs between a CI
tasks beginning and the point it attempt to fetch the HEAD of the
branch. This change configures the shallow clone to fetch the specific
commit reference, rather than the HEAD of the relevant branch.

* Update gutenberg reference

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update bundles

* Generate build

* Moved item to the unreleased section of release notes

* Update Gutenberg ref with merge commit

* Bump Gutenberg hash

* Update Gutenberg hash

* Bump Gutenberg hash

* Update Gutenberg hash

* Update Gutenberg hash

* Temporary Metro patch until RN upgrades Metro

Issue message: "Error: EISDIR: illegal operation on a directory, read"
Fix PR on Metro: facebook/metro#567

* Bump Gutenberg hash

* Bump Gutenberg to the merged hash

* Update Gutenberg ref

* Update release notes

* Fix incorrect block insertion point after blurring post title

Selecting the title selection status within the same `useSelect` for
reusable blocks caused the title selection status to become stale, due
to the dependency array for the `useSelect` hook.

The staleness caused the block insertion point to show up in the
incorrect location after blurring the title text input.

* Update gutenberg ref

* Bump Gutenberg

* Update RELEASE-NOTES.txt

* Update Gutenberg hash which contains fix to Android artifact publishing

* Bump Gutenberg

* Add: Grid block, from block-experiments repo

* Bump block-expeiments

* Update the no_output_timeout to 15min

* Revert the longer timeout.

* Add block-experiments to eslintignore

* Remove comment.

* Fix prettier

* Bump block-experiements

* All Layout Grid controls

* Bump block experiment fixes

* Fix up the block setup code

* Fix the availability

* Update bundle

* Simplify the layout grid block registration.

* Update the bundle js files

* Fix minor prettier issue.

* Bump map since it changed

* bump the latest version of Gutenberg

* Update the bundle

* Update gutenberg ref

* Generate bundle

* Bump Gutenberg

* Update Gutenberg ref

* Update gutenberg ref

* Install latest packages

* Install latest packages

* Remove duplicative release note

* Bump Gutenberg

* Update extra node modules resolver

Gutenberg mobile dependencies were resolved using the Jetpack path, so now we check first if the module exists in the Jetpack submodule before solving it with that path.

* Remove email-validator dependency

This dependency is already defined in Jetpack submodule and it's only used there.

* Remove yarn.lock file

* Remove yarn dependency

* Clarify comment in extra node modules resolver

* Update Gutenberg ref with merge commit

* Bump Gutenberg

* Release script: Update gb mobile version to 1.56.0

* Release script: Update gutenberg ref

* Release script: Update bundle for: 1.56.0

* Update Release notes

Co-authored-by: Cameron Voell <cameronvoell@gmail.com>
Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
Co-authored-by: Amanda Riu <amanda.riu@automattic.com>
Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com>
Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Co-authored-by: Antonis Lilis <antonis.lilis@automattic.com>
Co-authored-by: Paul Von Schrottky <paul.von.schrottky@automattic.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@automattic.com>
Co-authored-by: AmandaRiu <5810477+AmandaRiu@users.noreply.github.com>
Co-authored-by: Stefanos Togkoulidis <stefanostogoulidis@gmail.com>
Co-authored-by: Siobhan <siobhan@automattic.com>
Co-authored-by: Oguz Kocer <oguz.kocer@automattic.com>
Co-authored-by: Oguz Kocer <oguzkocer@users.noreply.github.com>
Co-authored-by: Siobhan Bamber <SiobhyB@users.noreply.github.com>
  • Loading branch information
15 people committed Jun 25, 2021
1 parent a6c2368 commit a97315e
Show file tree
Hide file tree
Showing 66 changed files with 12,641 additions and 17,817 deletions.
2 changes: 2 additions & 0 deletions .circleci/cache-version
@@ -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
74 changes: 68 additions & 6 deletions .circleci/config.yml
Expand Up @@ -34,11 +34,73 @@ commands:
paths:
- ~/.npm
- i18n-cache/data
checkout-shallow:
steps:
- run:
name: Checkout (Shallow)
command: |
#!/bin/sh
set -e
# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
export HOME=$(getent passwd $(id -un) | cut -d: -f6)
fi
SSH_CONFIG_DIR="$HOME/.ssh"
echo "Using SSH Config Dir '$SSH_CONFIG_DIR'"
git --version
mkdir -p "$SSH_CONFIG_DIR"
chmod 0700 "$SSH_CONFIG_DIR"
printf "%s" 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
' >> "$SSH_CONFIG_DIR/known_hosts"
chmod 0600 "$SSH_CONFIG_DIR/known_hosts"
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile='$SSH_CONFIG_DIR/known_hosts'"
# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
if [ -e "$HOME/project/.git" ] ; then
echo 'Fetching into existing repository'
existing_repo='true'
cd "$HOME/project"
git remote set-url origin "$CIRCLE_REPOSITORY_URL" || true
else
echo 'Cloning git repository'
existing_repo='false'
mkdir -p "$HOME/project"
cd "$HOME/project"
git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
fi
echo 'Fetching from remote repository'
if [ -n "$CIRCLE_TAG" ]; then
git fetch --depth 1 --force --tags origin "refs/tags/$CIRCLE_TAG"
else
git fetch --depth 1 --force origin "$CIRCLE_SHA1"
fi
if [ -n "$CIRCLE_TAG" ]; then
echo 'Checking out tag'
git checkout --force "$CIRCLE_TAG"
git reset --hard "$CIRCLE_SHA1"
else
echo 'Checking out branch'
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
fi
checkout-submodules:
steps:
- run:
name: Checkout Submodules
command: git submodule update --init --recursive
command: git submodule update --init --recursive --depth 1
add-jest-reporter-dir:
steps:
- run:
Expand Down Expand Up @@ -70,7 +132,7 @@ jobs:
machine:
image: << pipeline.parameters.linux-machine-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- run:
name: Install newer nvm
Expand Down Expand Up @@ -114,7 +176,7 @@ jobs:
machine:
image: << pipeline.parameters.linux-machine-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- run: node -v
- npm-install
Expand Down Expand Up @@ -162,7 +224,7 @@ jobs:
docker:
- image: << pipeline.parameters.android-docker-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- npm-install
- run:
Expand All @@ -180,7 +242,7 @@ jobs:
macos:
xcode: "12.0.0"
steps:
- checkout
- checkout-shallow
- checkout-submodules
- npm-install
- add-jest-reporter-dir
Expand Down Expand Up @@ -292,7 +354,7 @@ jobs:
else
echo "Build initiated from a tag: proceeding..."
fi
- checkout
- checkout-shallow
- checkout-submodules
- run:
# Setting up Android before fetching the Node dependencies because
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
@@ -1,5 +1,7 @@
; ignore the submodules
gutenberg
block-experiments
bundle
jetpack
bin

4 changes: 4 additions & 0 deletions .gitmodules
Expand Up @@ -6,3 +6,7 @@
path = jetpack
url = ../../Automattic/jetpack.git
shallow = true
[submodule "block-experiments"]
path = block-experiments
url = ../../Automattic/block-experiments.git
shallow = true
8 changes: 8 additions & 0 deletions RELEASE-NOTES.txt
@@ -1,12 +1,20 @@
Unreleased
------

1.56.0
------
* [*] Tablet view fixes for inserter button. https://github.com/wordpress-mobile/gutenberg-mobile/pull/3602
* [**] Fixed an issue where pressing enter inside a text-based block was not creating a new block when using Gboard [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3590]
* [*] Tweaks to the badge component's styling, including change of background color and reduced padding. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3642]
* [***] New block: Layout grid. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3513]

1.55.2
------
* [**] Fix incorrect block insertion point after blurring the post title field. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3640]

1.55.1
------
* [*] Fix: RNMobile borderRadius value setting. [https://github.com/WordPress/gutenberg/pull/32717]
* [*] Improve unsupported block message for reusable block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3621]

1.55.0
Expand Down
104 changes: 96 additions & 8 deletions bin/generate-podspecs.sh
@@ -1,34 +1,93 @@
#!/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)
# The npm version we're using is 3.6.0 because 3.6.1 still isn't on npm https://www.npmjs.com/package/@react-native-community/blur/v/3.6.1
# And there's no v3.6.0 tag in https://github.com/Kureev/react-native-blur so we depend on v3.6.1 in the podspec
jq '.source.tag = "v3.6.1" | .version = "3.6.1"' "$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 +103,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 " ==> Patching $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
1 change: 1 addition & 0 deletions block-experiments
Submodule block-experiments added at 79b49e

0 comments on commit a97315e

Please sign in to comment.