Skip to content

Commit

Permalink
fix: inject IS_FABRIC from worklets (#6833)
Browse files Browse the repository at this point in the history
## Summary

We need to inject it from the Decorator that executes sooner.

## Test plan

Example App doesn't throw errors anymore on bare BokehExample
  • Loading branch information
tjzel authored Dec 20, 2024
1 parent 7e40230 commit e60e35b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ void RNRuntimeDecorator::decorate(
rnRuntime.global().setProperty(
rnRuntime, "_WORKLET_RUNTIME", workletRuntimeValue);

#ifdef RCT_NEW_ARCH_ENABLED
constexpr auto isFabric = true;
#else
constexpr auto isFabric = false;
#endif // RCT_NEW_ARCH_ENABLED
rnRuntime.global().setProperty(rnRuntime, "_IS_FABRIC", isFabric);

rnRuntime.global().setProperty(
rnRuntime, "_IS_BRIDGELESS", reanimatedModuleProxy->isBridgeless());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ void RNRuntimeWorkletDecorator::decorate(
const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy) {
rnRuntime.global().setProperty(rnRuntime, "_WORKLET", false);

#ifdef RCT_NEW_ARCH_ENABLED
constexpr auto isFabric = true;
#else
constexpr auto isFabric = false;
#endif // RCT_NEW_ARCH_ENABLED
rnRuntime.global().setProperty(rnRuntime, "_IS_FABRIC", isFabric);

rnRuntime.global().setProperty(
rnRuntime,
"__workletsModuleProxy",
Expand Down

0 comments on commit e60e35b

Please sign in to comment.