From afb52a8d75833e30fb4c0e8fb5e52abf60e0168e Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Wed, 17 Jun 2020 10:32:13 +0100 Subject: [PATCH 1/2] Split the bundle creation steps for release and code update. Change the bundle step to only create updated bundles and not get updates strings from the web. This way for code updates only we just need to run yarn bundle. For the releases we run yarn release:bundle. This will accelerate the builds for WP-Android and for WP-iOS it will allow deploy and test of PR that need bundle updates quicker. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f7ac44b088..c4ba20d2c3 100644 --- a/package.json +++ b/package.json @@ -68,11 +68,12 @@ "start:inside-gb:debug": "node --inspect-brk node_modules/.bin/react-native start:inside-gb", "patch-metro-no-file-watch": "cp node_modules/metro/src/node-haste/DependencyGraph.js ./ && cp DependencyGraph.js.patched node_modules/metro/src/node-haste/DependencyGraph.js", "un-patch-metro-no-file-watch": "mv ./DependencyGraph.js node_modules/metro/src/node-haste/DependencyGraph.js", + "release:bundle": "yarn bundle && yarn clean:pot && yarn genstrings", "prebundle": "yarn i18n-cache:force", "prebundle:android": "yarn patch-metro-no-file-watch", "prepare": "patch-package", "postbundle:android": "yarn un-patch-metro-no-file-watch", - "bundle": "yarn bundle:android && yarn bundle:ios && yarn clean:pot && yarn genstrings", + "bundle": "yarn bundle:android && yarn bundle:ios", "bundle:android": "mkdir -p bundle/android && react-native bundle --platform android --dev false --entry-file index.js --assets-dest bundle/android --bundle-output bundle/android/App.js --sourcemap-output bundle/android/App.js.map", "bundle:ios": "mkdir -p bundle/ios && react-native bundle --platform ios --dev false --entry-file index.js --assets-dest bundle/ios --bundle-output bundle/ios/App.js --sourcemap-output bundle/ios/App.js.map", "i18n-cache": "node i18n-cache/index.js", From 4bcee058a54dfc8a714ba0a012ac9e5f32c9dd83 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Wed, 24 Jun 2020 10:31:42 +0100 Subject: [PATCH 2/2] Separate js bundles step from remaining bundle. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index eed7ad355f..dbdb1f6e74 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "start": "react-native start --config ./metro.config.js", "start:reset": "npm run core clean:runtime && npm run start -- --reset-cache", "core": "cd gutenberg && npm run native", - "bundle": "npm run clean; npm run bundle:android && npm run bundle:ios && npm run genstrings", + "bundle": "npm run clean; npm run bundle:js && npm run genstrings", + "bundle:js": "npm run bundle:android && npm run bundle:ios", "bundle:android": "mkdir -p bundle/android && react-native bundle --platform android --dev false --entry-file ./index.js --assets-dest ./bundle/android --bundle-output ./bundle/android/App.js --sourcemap-output ./bundle/android/App.js.map", "bundle:ios": "mkdir -p bundle/ios && react-native bundle --platform ios --dev false --entry-file ./index.js --assets-dest ./bundle/ios --bundle-output ./bundle/ios/App.js --sourcemap-output ./bundle/ios/App.js.map", "install:wpcli": "(test -x bin/wp-cli.phar || curl -Ls https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o bin/wp-cli.phar && chmod +x bin/wp-cli.phar) && bin/wp-cli.phar --info",