diff --git a/android/app/build.gradle b/android/app/build.gradle index c986be6517..253bb7c260 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -159,6 +159,7 @@ dependencies { implementation project(':@react-native-community_slider') implementation project(':react-native-video') implementation project(':react-native-svg') + implementation project(':react-native-get-random-values') implementation project(':react-native-aztec') implementation project(':react-native-gutenberg-bridge') implementation "org.wordpress:utils:$wordpressUtilsVersion" diff --git a/android/app/src/main/java/com/gutenberg/MainApplication.java b/android/app/src/main/java/com/gutenberg/MainApplication.java index cb866365dc..4967db6082 100644 --- a/android/app/src/main/java/com/gutenberg/MainApplication.java +++ b/android/app/src/main/java/com/gutenberg/MainApplication.java @@ -16,6 +16,7 @@ import com.facebook.react.devsupport.interfaces.DevOptionHandler; import com.facebook.react.devsupport.interfaces.DevSupportManager; import com.horcrux.svg.SvgPackage; +import org.linusu.RNGetRandomValuesPackage; import org.wordpress.mobile.ReactNativeAztec.ReactAztecPackage; import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergBridgeJS2Parent; @@ -153,6 +154,7 @@ protected List getPackages() { new SvgPackage(), new ReactAztecPackage(), new LinearGradientPackage(), + new RNGetRandomValuesPackage(), mRnReactNativeGutenbergBridgePackage); } diff --git a/android/settings.gradle b/android/settings.gradle index 323d004d82..3f1eb971c6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -14,5 +14,7 @@ include ':react-native-gutenberg-bridge' project(':react-native-gutenberg-bridge').projectDir = new File(rootProject.projectDir, '../react-native-gutenberg-bridge/android') include ':react-native-linear-gradient' project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') +include ':react-native-get-random-values' +project(':react-native-get-random-values').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-random-values/android') include ':app' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 35063d6f2a..d57e039ee6 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -189,6 +189,8 @@ PODS: - React-cxxreact (= 0.61.5) - React-jsi (= 0.61.5) - React-jsinspector (0.61.5) + - react-native-get-random-values (1.4.0): + - React - react-native-keyboard-aware-scroll-view (0.8.8): - React - react-native-safe-area (0.5.1): @@ -264,6 +266,7 @@ DEPENDENCIES: - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) + - react-native-get-random-values (from `../node_modules/react-native-get-random-values`) - react-native-keyboard-aware-scroll-view (from `../node_modules/react-native-keyboard-aware-scroll-view`) - react-native-safe-area (from `../node_modules/react-native-safe-area`) - "react-native-slider (from `../node_modules/@react-native-community/slider`)" @@ -322,6 +325,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsiexecutor" React-jsinspector: :path: "../node_modules/react-native/ReactCommon/jsinspector" + react-native-get-random-values: + :path: "../node_modules/react-native-get-random-values" react-native-keyboard-aware-scroll-view: :path: "../node_modules/react-native-keyboard-aware-scroll-view" react-native-safe-area: @@ -377,6 +382,7 @@ SPEC CHECKSUMS: React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7 React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386 React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0 + react-native-get-random-values: 2b7500cdb68066aba87cdccd97067c29e16ffe95 react-native-keyboard-aware-scroll-view: ffa9152671fec9a571197ed2d02e0fcb90206e60 react-native-safe-area: e8230b0017d76c00de6b01e2412dcf86b127c6a3 react-native-slider: f81b89fa0c1f9a65742d33f889a194ca6653a985 diff --git a/ios/gutenberg.xcodeproj/project.pbxproj b/ios/gutenberg.xcodeproj/project.pbxproj index 65235a15f1..2cb4a669ce 100644 --- a/ios/gutenberg.xcodeproj/project.pbxproj +++ b/ios/gutenberg.xcodeproj/project.pbxproj @@ -489,6 +489,7 @@ "${BUILT_PRODUCTS_DIR}/WordPress-Aztec-iOS/Aztec.framework", "${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework", "${BUILT_PRODUCTS_DIR}/glog/glog.framework", + "${BUILT_PRODUCTS_DIR}/react-native-get-random-values/react_native_get_random_values.framework", "${BUILT_PRODUCTS_DIR}/react-native-keyboard-aware-scroll-view/react_native_keyboard_aware_scroll_view.framework", "${BUILT_PRODUCTS_DIR}/react-native-safe-area/react_native_safe_area.framework", "${BUILT_PRODUCTS_DIR}/react-native-slider/react_native_slider.framework", @@ -523,6 +524,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Aztec.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/glog.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_get_random_values.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_keyboard_aware_scroll_view.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_safe_area.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/react_native_slider.framework", diff --git a/package.json b/package.json index fbb48d40a3..954ad7cc2e 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,7 @@ "react": "16.9.0", "react-native": "0.61.5", "react-native-dark-mode": "git+https://github.com/wordpress-mobile/react-native-dark-mode.git#f09bf1480e7b34536413ab3300f29e4375edb2c6", + "react-native-get-random-values": "^1.4.0", "react-native-hr": "git+https://github.com/Riglerr/react-native-hr.git#2d01a5cf77212d100e8b99e0310cce5234f977b3", "react-native-keyboard-aware-scroll-view": "git+https://github.com/wordpress-mobile/react-native-keyboard-aware-scroll-view.git#gb-v0.8.8", "react-native-linear-gradient": "git+https://github.com/wordpress-mobile/react-native-linear-gradient.git#52bf43077171cff8714ce3e0155f3ebb7f55bc37", @@ -191,6 +192,7 @@ "traverse": "^0.6.6", "turbo-combine-reducers": "^1.0.2", "underscore": "^1.9.1", - "use-memo-one": "^1.1.1" + "use-memo-one": "^1.1.1", + "uuid": "^7.0.2" } } diff --git a/react-native-gutenberg-bridge/android/build.gradle b/react-native-gutenberg-bridge/android/build.gradle index 60eaf7a43c..0dc6578c4e 100644 --- a/react-native-gutenberg-bridge/android/build.gradle +++ b/react-native-gutenberg-bridge/android/build.gradle @@ -133,6 +133,7 @@ dependencies { implementation project(':react-native-svg') implementation project(':react-native-video') implementation project(':@react-native-community_slider') + implementation project(':react-native-get-random-values') implementation 'com.facebook.react:react-native:+' } else { @@ -142,6 +143,7 @@ dependencies { implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-video', readHashedVersion('../../package.json', 'react-native-video', 'dependencies'))) implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-linear-gradient', readHashedVersion('../../package.json', 'react-native-linear-gradient', 'dependencies'))) implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-slider', readHashedVersion('../../package.json', '@react-native-community/slider', 'dependencies'))) + implementation (waitJitpack('com.github.wordpress-mobile', 'react-native-get-random-values', readHashedVersion('../../package.json', 'react-native-get-random-values', 'dependencies'))) // FIXME Temporary fix to get Jitpack builds to green while I work on a solution without hardcoded values. //def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies') diff --git a/src/index.js b/src/index.js index 2b3edd9c04..50ff67d113 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ /** * External dependencies */ +import 'react-native-get-random-values'; // This library works as a polyfill for the global crypto.getRandomValues which is needed by `uuid` version 7.0.0 import { AppRegistry, I18nManager } from 'react-native'; import React from 'react'; diff --git a/yarn.lock b/yarn.lock index 8b72e901d9..d2f6139e85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7022,6 +7022,11 @@ fast-average-color@^4.3.0: resolved "https://registry.yarnpkg.com/fast-average-color/-/fast-average-color-4.3.0.tgz#baf08eb9c62955c40718a26c47d0b1501c62193e" integrity sha512-k8FXd6+JeXoItmdNqB3hMwFgArryjdYBLuzEM8fRY/oztd/051yhSHU6GUrMOfIQU9dDHyFDcIAkGrQKlYtpDA== +fast-base64-decode@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" + integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" @@ -12022,6 +12027,13 @@ react-native-animatable@^1.2.4: events "3.0.0" toolkit.ts "0.0.2" +react-native-get-random-values@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.4.0.tgz#1234d4dde6b56b2fab0eaa7dc1719e2f8c32c336" + integrity sha512-NnmEZcC5zfz+QEytFPM/fw818Hodw/BNbv7jGxU4pla4K2K9DCzG83IReMJqQ2wo552AYKguqrBG2SSn/U6rbA== + dependencies: + fast-base64-decode "^1.0.0" + "react-native-hr@git+https://github.com/Riglerr/react-native-hr.git#2d01a5cf77212d100e8b99e0310cce5234f977b3": version "1.1.3" resolved "git+https://github.com/Riglerr/react-native-hr.git#2d01a5cf77212d100e8b99e0310cce5234f977b3"