⬆️ Upgrade dependency react-native-view-shot to v5#137
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
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.
This PR contains the following updates:
4.0.3→5.1.0Release Notes
gre/react-native-view-shot (react-native-view-shot)
v5.1.0Compare Source
Highlights
iOS
UIGraphicsImageRenderer(fixes deprecated APIs).releaseCapture+ encoding tests.Android
snapshotContentContainernow correctly captures off-screen content.Windows
example-windowson RNW 0.76.17 with full demo screen suite (Basic, FS, FullScreen, Image, Modal, Rendering, ScrollView, StyleFilters, Transparency).RNViewShotModule,ViewShot,Helpers).RNViewShot.Tests).Examples / Tests
style-filtersrepro screen (#578).snapshotContentContainerScrollView capture demo.testMatch.Full Changelog: gre/react-native-view-shot@v5.0.1...v5.1.0
v5.0.1Compare Source
Patch release fixing an Android crash that hit users capturing GL / SurfaceView / TextureView roots directly.
What changed
applyTransformationsagainstNullPointerExceptionandClassCastExceptionwhen the captured view is itself a non-ViewGroup(e.g. aSurfaceViewcaptured directly withhandleGLSurfaceView: true). The original parent walk ran pastrootand either dereferenced a null parent or tried to cast aViewRootImpltoView. The walk is now extracted into awalkAncestorshelper that short-circuits whenchild == root, stops on null, and stops on non-ViewViewParent. Closes #488. (#631)build-androidCI job via./gradlew :react-native-view-shot:testDebugUnitTest. Covers the three failure modes plus happy paths. (#631)Contributors
Full changelog: gre/react-native-view-shot@v5.0.0...v5.0.1
v5.0.0Compare Source
First stable release of the 5.x line. This is a major version bump covering the New Architecture migration, a project-wide cleanup, and a long list of cross-platform fixes accumulated since
v4.0.3. If you're upgrading from 4.x, please read the Breaking changes section below.Highlights
>=0.76.0. Tested up to0.84.1.src/is now.ts/.tsx).view.draw()and view resolution now run on the UIManager queue with a hard timeout, cancellation, exception propagation, and a CAS-based bitmap pool handoff so canvas-backing bitmaps cannot be recycled mid-draw.RCTScrollViewremoval in RN 0.84 (runtimeUIScrollViewdetection covering both Paper and Fabric), plus a Privacy Manifest.captureRef, JPG output,releaseCapture, and CORS image handling.Breaking changes
0.76.0. Lower versions are no longer supported..d.tsfiles now ship alongsidelib/(thepackage.jsonmainstill points tolib/index.js, thereact-nativefield points tosrc/index.tsx).RNViewShot.web.jswas renamed toRNViewShot.web.ts. Metro and webpack still resolve*.web.tsautomatically.src/specs/NativeRNViewShot.ts. The runtime detects old vs. new arch viaglobal.__turboModuleProxyso consumers do not need to choose explicitly.What changed
New Architecture / RN 0.84
RCTScrollViewon iOS by switching to runtimeUIScrollViewdetection (subview walk +respondsToSelector:) that works under both Paper and Fabric.react-native.config.jsso the library is correctly linked on Android.Android
refactor(android)) UI-thread-safe view capture with hardened bitmap lifecycle:view.draw()now runs on the UIManager queue instead of the capture executor.runOnUiThreadBlockingposts work to the main looper with a hard 5s timeout (UiThreadBlockTimeoutException) so a stuck UI thread cannot hang capture forever.STATE_QUEUED/RUNNING/DONE) with CAS between caller (timeout) and runnable (entry) so exactly one side owns cleanup.AtomicReference<Bitmap>+getAndSet(null)so the canvas-backing bitmap cannot be returned to the pool whileview.draw()is still drawing into it.handler.post()return value checked,Throwablethrown inside the UI runnable is captured and rethrown on the caller thread (surfaces aspromise.reject(...)instead of crashing the UI thread).ViewGroupsubtrees (kept inert in practice, see PR for context).fix(android)) Resolve view on the UIManager queue before posting capture work to the executor (cherry-pick of #556 by @wfern), with atry/catchsocurrentActivity == null(app backgrounded) or a throw insideresolveViewrejects the promise instead of crashing the UIManager queue.iOS
UIScrollViewvia subview walk andrespondsToSelector:@​selector(scrollView)so bothRCTScrollViewComponentView(Fabric) and legacyRCTScrollView(Paper) are covered with no compile-time__has_includebranches.PrivacyInfo.xcprivacy).Web
captureRefcrash on web by skippingfindNodeHandle(not supported).useCORSforhtml2canvasto fix cross-origin image capture.releaseCapturecrash on web (now a no-op since there are no temp files to clean up) and add aViewShotcomponent example.Examples, tests, CI
Docs
Dependency updates
Numerous dependabot bumps in example/example-web/example-windows/example-expo (lodash, minimatch, fast-xml-parser, node-forge, picomatch, handlebars, brace-expansion, follow-redirects, flatted, terser-webpack-plugin, copy-webpack-plugin, serve, serialize-javascript). The library itself has no new runtime dependencies.
Closed PRs of note (superseded or already-on-master)
These were closed during this release cycle in favor of the consolidated work above:
view.draw()-preserving approach.releaseCapturethrowing) addressed on master.Contributors
Thanks to everyone who contributed to this release:
Full changelog: gre/react-native-view-shot@v4.0.3...v5.0.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.