Repository navigation
fix!: require React Native 0.83 (Expo SDK 55) - #58
Merged
Merged
Conversation
Before React Native 0.82, iOS drops a view that is not recycled without calling invalidate, and invalidate is the only place Nitro's generated component calls onDropView from for this view. On 0.81 every closed viewer kept its PDFView, document, callbacks, search and form, its load kept running and its pin in Caches/BetterPdf/open stayed (#26). No Expo SDK ships 0.82 (SDK 54 has 0.81, SDK 55 has 0.83.10), so the floor is 0.83, the oldest line the Expo example builds on. There, in a Release build of the example on the iOS simulator, 10 open/close cycles called onDropView 10 times and left no PDFView, PDFDocument or PDFPage; the 10 HybridBetterPdfView objects left wait for a Hermes GC, which a Release build cannot force. The library also compiles on Android at SDK 55, and its JVM tests pass. The README, the migration guide, the research notes and the issue templates now state the same minimum. BREAKING CHANGE: react-native >= 0.83 (Expo SDK 55) is required. React Native 0.81 (Expo SDK 54) and 0.82 are no longer supported; on 0.81 iOS never released closed viewers.
native-build.yml takes an expo-sdk input. When set, the example moves to that SDK with expo install --fix before the unchanged prebuild, pod install, xcodebuild and Gradle steps, and package/node_modules is removed. package/ keeps react-native 0.86.3 as a devDependency, and the library's Android codegen fails on that nested copy with the older parser. Apps have no such copy. native-minimum.yml calls it with SDK 55 weekly, by hand, and on pull requests that edit either workflow. Run locally at SDK 55, the same steps compile the library for iOS and Android. Closes #26
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Raises the minimum to React Native 0.83 / Expo SDK 55 and adds a CI job that builds the example there. Closes #26.
Before React Native 0.82, iOS drops a view that is not recycled without calling
invalidate(RCTComponentViewRegistry.mm:0.81-stableand0.82-stablediffer by exactly that call). For this view,invalidateis the only place Nitro's generated component callsonDropViewfrom. On 0.81 / Expo SDK 54, which the README listed as supported, closed viewers were never torn down. Each kept itsPDFView, document, callbacks (so #16 did not apply), search and form, and its loads and pins stayed.Why 0.83 and not 0.82: no Expo SDK ships 0.82 (SDK 54 has 0.81, SDK 55 has 0.83.10). The example is an Expo app, so 0.83 is the oldest line CI can build.
peerDependencies:react-native >=0.83. The README, the migration guide (which still said 0.78+), the research notes and both issue templates now say the same.native-build.ymltakes anexpo-sdkinput. When it is set, the example moves to that SDK (expo install expo@^N --fix) before the unchanged prebuild, pod install, xcodebuild and Gradle steps, andpackage/node_modulesis removed.package/keeps react-native 0.86.3 as a devDependency, and the library's Android codegen fails on that nested copy with 0.83's parser; an app has no such copy. Without the input nothing changes, sonative.ymlandrelease.ymlare untouched.native-minimum.ymlcalls it with SDK 55 weekly, by hand, and on pull requests that edit either workflow, so this PR runs it.Breaking: apps on React Native 0.81 (Expo SDK 54) or 0.82 fall outside the peer range. The first commit has a
BREAKING CHANGE:footer. Keep the!in the squash title so the release notes call it out.Not done: gating
release.ymlon the minimum build. The issue suggests it, but it adds a second macOS job to every release and could block an urgent patch when something breaks on Expo's side.How was it verified?
Locally on Expo SDK 55 / React Native 0.83.10 (macOS, Xcode 27.1), with the workflow's steps:
pod installandxcodebuildof theNitroBetterPdfscheme for the simulator succeed.-[HybridBetterPdfViewComponent invalidate]is in the object file; Nitro compiles it only for React Native 0.82 and newer.:react-native-better-pdf:assembleDebugandtestDebugUnitTestsucceed, and the 273 JVM tests pass. Withpackage/node_modulesleft in place, codegen fails withUnable to determine event arguments for "onModeChange".NSLoginonDropView:onDropView10 times.heapshowed noPDFView,PDFDocumentorPDFPageobjects.HybridBetterPdfViewobjects (about 1.3 KB each) remained, waiting for a Hermes GC that a Release build cannot force. The "after a GC" half of the acceptance criterion was therefore not measured here; fix: release closed viewers and their documents #16 measured it on 0.86.IPHONEOS_DEPLOYMENT_TARGET=15.1with Xcode 27.1, because react-native-blob-util's privacy bundle targets iOS 11.0. CI compiles only the library scheme, like the existing job, so it is not affected.Native (minimum)checks are its first run.bun run lint,bun run typecheck,bun run testandactionlintpass.Not reproduced on 0.81 itself (there is no SDK 54 build). The 0.81 behaviour comes from React Native's source.
Scope
Checklist
bun run lint,bun run typecheckandbun run testpasscd package && bun run specswas re-run andpackage/nitrogen/is committed with it: not changeddocs/api.md, the feature's guide indocs/guides/, the README's capability matrix anddocs/api-design.mdare updated: not changedNeed help on this PR? Tag
@codesmith-botwith what you need.