Skip to content

Commit

Permalink
Revert "[NoQA] feat: bump react-native-pdf to newest version, remove …
Browse files Browse the repository at this point in the history
…unnecessary pat…"
  • Loading branch information
mountiny authored Sep 17, 2024
1 parent 9103d8d commit 29d0253
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 20 deletions.
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-pdf (6.7.5):
- react-native-pdf (6.7.3):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -3182,7 +3182,7 @@ SPEC CHECKSUMS:
react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d
react-native-netinfo: fb5112b1fa754975485884ae85a3fb6a684f49d5
react-native-pager-view: 94195f1bf32e7f78359fa20057c97e632364a08b
react-native-pdf: 2e2591ebd39422163850403b1c0cd7d6b351e168
react-native-pdf: dd6ae39a93607a80919bef9f3499e840c693989d
react-native-performance: 3c608307be10964f8a97d3af462f37125b6d8fa5
react-native-plaid-link-sdk: f91a22b45b7c3d4cd6c47273200dc57df35068b0
react-native-quick-sqlite: 7c793c9f5834e756b336257a8d8b8239b7ceb451
Expand Down Expand Up @@ -3246,7 +3246,7 @@ SPEC CHECKSUMS:
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e
VisionCamera: c6c8aa4b028501fc87644550fbc35a537d4da3fb
Yoga: 2a45d7e59592db061217551fd3bbe2dd993817ae
Yoga: a1d7895431387402a674fd0d1c04ec85e87909b8

PODFILE CHECKSUM: e479ec84cb53e5fd463486d71dfee91708d3fd9a

Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"react-native-modal": "^13.0.0",
"react-native-onyx": "2.0.68",
"react-native-pager-view": "6.4.1",
"react-native-pdf": "6.7.5",
"react-native-pdf": "6.7.3",

This comment has been minimized.

Copy link
@andrewhamili

andrewhamili Sep 27, 2024

https://github.com/wonday/react-native-pdf/issues/830

Did this change fix the react-native-pdf issue for your app?

"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",
Expand Down
53 changes: 53 additions & 0 deletions patches/react-native-pdf+6.7.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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') {
12 changes: 0 additions & 12 deletions patches/react-native-pdf+6.7.5.patch

This file was deleted.

0 comments on commit 29d0253

Please sign in to comment.