From c7173de519adf46e9976cd0bc601c5270531f2b3 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Mon, 2 Sep 2024 17:38:28 +0200 Subject: [PATCH] feat: bump react-native-pdf to newest version, remove unnecessary patch and add new one --- ios/Podfile.lock | 4 +-- package-lock.json | 7 ++-- package.json | 2 +- patches/react-native-pdf+6.7.3.patch | 53 ---------------------------- patches/react-native-pdf+6.7.5.patch | 12 +++++++ 5 files changed, 19 insertions(+), 59 deletions(-) delete mode 100644 patches/react-native-pdf+6.7.3.patch create mode 100644 patches/react-native-pdf+6.7.5.patch diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d688213fafb4..20717fbc2eb5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1776,7 +1776,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-pdf (6.7.3): + - react-native-pdf (6.7.5): - DoubleConversion - glog - hermes-engine @@ -3188,7 +3188,7 @@ SPEC CHECKSUMS: react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d react-native-netinfo: fb5112b1fa754975485884ae85a3fb6a684f49d5 react-native-pager-view: 6bff9b0883b902571530ddd1b2ea9dc570f321f6 - react-native-pdf: dd6ae39a93607a80919bef9f3499e840c693989d + react-native-pdf: 2e2591ebd39422163850403b1c0cd7d6b351e168 react-native-performance: 3c608307be10964f8a97d3af462f37125b6d8fa5 react-native-plaid-link-sdk: f91a22b45b7c3d4cd6c47273200dc57df35068b0 react-native-quick-sqlite: 7c793c9f5834e756b336257a8d8b8239b7ceb451 diff --git a/package-lock.json b/package-lock.json index a7c9fc4fb570..3801d2ff4751 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,7 +105,7 @@ "react-native-modal": "^13.0.0", "react-native-onyx": "2.0.66", "react-native-pager-view": "6.3.4", - "react-native-pdf": "6.7.3", + "react-native-pdf": "6.7.5", "react-native-performance": "^5.1.0", "react-native-permissions": "^3.10.0", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#da50d2c5c54e268499047f9cc98b8df4196c1ddf", @@ -38209,8 +38209,9 @@ } }, "node_modules/react-native-pdf": { - "version": "6.7.3", - "license": "MIT", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/react-native-pdf/-/react-native-pdf-6.7.5.tgz", + "integrity": "sha512-d1S76p2Vwax2iG+kTnjINiUMvpjtJJvtMiYwHRbgGczT8GJjtXH49YCWOd+HfnUAU29cB+knzsKGYoZBMQM8Ow==", "dependencies": { "crypto-js": "4.2.0", "deprecated-react-native-prop-types": "^2.3.0" diff --git a/package.json b/package.json index 2945464ec907..dc9f87168897 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "react-native-modal": "^13.0.0", "react-native-onyx": "2.0.66", "react-native-pager-view": "6.3.4", - "react-native-pdf": "6.7.3", + "react-native-pdf": "6.7.5", "react-native-performance": "^5.1.0", "react-native-permissions": "^3.10.0", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#da50d2c5c54e268499047f9cc98b8df4196c1ddf", diff --git a/patches/react-native-pdf+6.7.3.patch b/patches/react-native-pdf+6.7.3.patch deleted file mode 100644 index 0f0f270cefd1..000000000000 --- a/patches/react-native-pdf+6.7.3.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/node_modules/react-native-pdf/react-native-pdf.podspec b/node_modules/react-native-pdf/react-native-pdf.podspec -index fb36140..5d5f19e 100644 ---- a/node_modules/react-native-pdf/react-native-pdf.podspec -+++ b/node_modules/react-native-pdf/react-native-pdf.podspec -@@ -17,24 +17,11 @@ Pod::Spec.new do |s| - s.framework = "PDFKit" - - if fabric_enabled -- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' -- -- s.pod_target_xcconfig = { -- 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"', -- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", -- } - s.platforms = { ios: '11.0', tvos: '11.0' } -- s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED' - s.source_files = 'ios/**/*.{h,m,mm,cpp}' - s.requires_arc = true - -- s.dependency "React" -- s.dependency "React-RCTFabric" -- s.dependency "React-Codegen" -- s.dependency "RCT-Folly" -- s.dependency "RCTRequired" -- s.dependency "RCTTypeSafety" -- s.dependency "ReactCommon/turbomodule/core" -+ install_modules_dependencies(s) - else - s.platform = :ios, '8.0' - s.source_files = 'ios/**/*.{h,m,mm}' -diff --git a/node_modules/react-native-pdf/index.js b/node_modules/react-native-pdf/index.js -index c05de52..bea7af8 100644 ---- a/node_modules/react-native-pdf/index.js -+++ b/node_modules/react-native-pdf/index.js -@@ -367,11 +367,17 @@ export default class Pdf extends Component { - message[4] = message.splice(4).join('|'); - } - if (message[0] === 'loadComplete') { -+ let tableContents; -+ try { -+ tableContents = message[4]&&JSON.parse(message[4]); -+ } catch(e) { -+ tableContents = message[4]; -+ } - this.props.onLoadComplete && this.props.onLoadComplete(Number(message[1]), this.state.path, { - width: Number(message[2]), - height: Number(message[3]), - }, -- message[4]&&JSON.parse(message[4])); -+ tableContents); - } else if (message[0] === 'pageChanged') { - this.props.onPageChanged && this.props.onPageChanged(Number(message[1]), Number(message[2])); - } else if (message[0] === 'error') { diff --git a/patches/react-native-pdf+6.7.5.patch b/patches/react-native-pdf+6.7.5.patch new file mode 100644 index 000000000000..0cdcf4d5b0c9 --- /dev/null +++ b/patches/react-native-pdf+6.7.5.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js b/node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js +index 596d796..4e47061 100644 +--- a/node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js ++++ b/node_modules/react-native-pdf/fabric/RNPDFPdfNativeComponent.js +@@ -22,6 +22,7 @@ + enablePaging: ?boolean, + enableRTL: ?boolean, + enableAnnotationRendering: ?boolean, ++ enableDoubleTapZoom: ?boolean, + showsHorizontalScrollIndicator: ?boolean, + showsVerticalScrollIndicator: ?boolean, + enableAntialiasing: ?boolean,