fix(🍏): gate RCTCxxBridge behind RCT_DISABLE_LEGACY_ARCH#3852
Open
wcandillon wants to merge 4 commits into
Open
fix(🍏): gate RCTCxxBridge behind RCT_DISABLE_LEGACY_ARCH#3852wcandillon wants to merge 4 commits into
wcandillon wants to merge 4 commits into
Conversation
Contributor
Author
|
@cipolleschi does this look good? which version of React Native should I try this on? |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the iOS Skia integration to avoid directly referencing RCTCxxBridge (which can be compiled out when RCT_DISABLE_LEGACY_ARCH is enabled), by switching runtime access to a RCTBridge-level accessor and gating legacy-only jsInvoker wiring.
Changes:
SkiaManager.mm: stop casting toRCTCxxBridgeand instead use a forward-declaredRCTBridgeruntimeaccessor.RNSkiaModule.mm: wrap legacyRCTCxxBridgejsCallInvokeraccess behind#ifndef RCT_DISABLE_LEGACY_ARCHand passself.bridgetoSkiaManager.Podfile.lock(example iOS app): large set of pod checksum updates and a CocoaPods version line change.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/skia/apple/SkiaManager.mm | Removes direct RCTCxxBridge usage by accessing the JSI runtime via bridge.runtime. |
| packages/skia/apple/RNSkiaModule.mm | Gates legacy RCTCxxBridge call-invoker wiring behind RCT_DISABLE_LEGACY_ARCH. |
| apps/example/ios/Podfile.lock | Updates pod checksums and the recorded CocoaPods version for the example iOS app. |
Comments suppressed due to low confidence (1)
packages/skia/apple/SkiaManager.mm:47
RNSkApplePlatformContext/RNSkPlatformContextassumes a non-null CallInvoker (it dereferences_callInvokerinrunOnJavascriptThread()without checks).SkiaManagercurrently only gates onbridge.runtime; ifjsInvokeris empty,_skManagerwill still be created with a platform context that can later crash when scheduling work on the JS thread. Consider also requiringjsInvokerto be set (or failing fast) before constructingRNSkManager/platform context.
if (bridge.runtime) {
facebook::jsi::Runtime *jsRuntime =
(facebook::jsi::Runtime *)bridge.runtime;
// Create the RNSkiaManager (cross platform)
_skManager = std::make_shared<RNSkia::RNSkManager>(
jsRuntime, jsInvoker,
std::make_shared<RNSkia::RNSkApplePlatformContext>(bridge,
jsInvoker));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.