Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
551 changes: 0 additions & 551 deletions .yarn/patches/react-native-npm-0.82.0-rc.0-4775a171a4.patch

This file was deleted.

962 changes: 962 additions & 0 deletions .yarn/patches/react-native-npm-0.82.0-rc.4-228ad0ffa7.patch

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3190,10 +3190,10 @@ SPEC CHECKSUMS:
RNReanimated: 3b47c33660454c6f9700b463e92daa282030866a
RNScreens: 6ced6ae8a526512a6eef6e28c2286e1fc2d378c3
RNSVG: 287504b73fa0e90a605225aa9f852a86d5461e84
RNWorklets: 991f94e4fa31fc20853e74d5d987426f8580cb0d
RNWorklets: 7119ae08263033c456c80d90794a312f2f88c956
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: e80c5fabbc3e26311152fa20404cdfa14f16a11f

PODFILE CHECKSUM: db099f48c6dadedd8fc0a430129b75e561867ab9
PODFILE CHECKSUM: 5d8c04f461eed0f22e86610877d94f2b8b838b8b

COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import androidx.annotation.OptIn;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.BundleConsumer;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.common.annotations.FrameworkAPI;
import com.facebook.react.fabric.BigStringBufferWrapper;
import com.facebook.react.fabric.BundleWrapper;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl;
import com.facebook.soloader.SoLoader;
Expand All @@ -20,8 +19,7 @@

@SuppressWarnings("JavaJniMissingFunction")
@ReactModule(name = WorkletsModule.NAME)
public class WorkletsModule extends NativeWorkletsModuleSpec
implements LifecycleEventListener, BundleConsumer {
public class WorkletsModule extends NativeWorkletsModuleSpec implements LifecycleEventListener {
static {
SoLoader.loadLibrary("worklets");
}
Expand All @@ -39,19 +37,9 @@ protected HybridData getHybridData() {
private final AndroidUIScheduler mAndroidUIScheduler;
private final AnimationFrameQueue mAnimationFrameQueue;
private boolean mSlowAnimationsEnabled;
private BigStringBufferWrapper mScriptWrapper = null;
private BundleWrapper mBundleWrapper = null;
private String mSourceURL = null;

@Override
public void setScriptWrapper(BigStringBufferWrapper scriptWrapper) {
mScriptWrapper = scriptWrapper;
}

@Override
public void setSourceURL(String sourceURL) {
mSourceURL = sourceURL;
}

/**
* Invalidating concurrently could be fatal. It shouldn't happen in a normal flow, but it doesn't
* cost us much to add synchronization for extra safety.
Expand All @@ -64,7 +52,7 @@ private native HybridData initHybrid(
MessageQueueThread messageQueueThread,
CallInvokerHolderImpl jsCallInvokerHolder,
AndroidUIScheduler androidUIScheduler,
BigStringBufferWrapper scriptWrapper,
BundleWrapper bundleWrapper,
String sourceURL);

public WorkletsModule(ReactApplicationContext reactContext) {
Expand All @@ -90,13 +78,16 @@ public boolean installTurboModule() {
var jsContext = Objects.requireNonNull(context.getJavaScriptContextHolder()).get();
var jsCallInvokerHolder = JSCallInvokerResolver.getJSCallInvokerHolder(context);

mSourceURL = context.getSourceURL();
mBundleWrapper = context.getBundle();

mHybridData =
initHybrid(
jsContext,
mMessageQueueThread,
jsCallInvokerHolder,
mAndroidUIScheduler,
mScriptWrapper,
mBundleWrapper,
mSourceURL);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ jni::local_ref<WorkletsModule::jhybriddata> WorkletsModule::initHybrid(
jni::alias_ref<worklets::AndroidUIScheduler::javaobject> androidUIScheduler
#ifdef WORKLETS_BUNDLE_MODE
,
jni::alias_ref<facebook::react::BigStringBufferWrapper::javaobject>
scriptWrapper,
jni::alias_ref<facebook::react::BundleWrapper::javaobject> bundleWrapper,
const std::string &sourceURL
#endif // WORKLETS_BUNDLE_MODE
) {
Expand All @@ -63,7 +62,7 @@ jni::local_ref<WorkletsModule::jhybriddata> WorkletsModule::initHybrid(

std::shared_ptr<const BigStringBuffer> script = nullptr;
#ifdef WORKLETS_BUNDLE_MODE
script = scriptWrapper->cthis()->getScript();
script = bundleWrapper->cthis()->getBundle();
#else
const auto sourceURL = std::string{};
#endif // WORKLETS_BUNDLE_MODE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <jsireact/JSIExecutor.h>
#include <react/jni/JMessageQueueThread.h>
#ifdef WORKLETS_BUNDLE_MODE
#include <react/fabric/BigStringBufferWrapper.h>
#include <react/fabric/BundleWrapper.h>
#endif // WORKLETS_BUNDLE_MODE

#include <worklets/NativeModules/WorkletsModuleProxy.h>
Expand Down Expand Up @@ -35,8 +35,7 @@ class WorkletsModule : public jni::HybridClass<WorkletsModule> {
androidUIScheduler
#ifdef WORKLETS_BUNDLE_MODE
,
jni::alias_ref<facebook::react::BigStringBufferWrapper::javaobject>
scriptWrapper,
jni::alias_ref<facebook::react::BundleWrapper::javaobject> bundleWrapper,
const std::string &sourceURL
#endif // WORKLETS_BUNDLE_MODE
);
Expand All @@ -54,7 +53,7 @@ class WorkletsModule : public jni::HybridClass<WorkletsModule> {
jni::alias_ref<JavaMessageQueueThread::javaobject> messageQueueThread,
const std::shared_ptr<facebook::react::CallInvoker> &jsCallInvoker,
const std::shared_ptr<UIScheduler> &uiScheduler,
const std::shared_ptr<const BigStringBuffer> &script,
const std::shared_ptr<const BigStringBuffer> &bundle,
const std::string &sourceURL);

void invalidateCpp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#import <React/RCTBridge+Private.h>
#import <React/RCTCallInvoker.h>

#if __has_include(<React/RCTBundleProvider.h>)
// Bundle mode
#import <React/RCTBundleProvider.h>
#endif // __has_include(<React/RCTBundleProvider.h>)

using worklets::RNRuntimeWorkletDecorator;
using worklets::WorkletsModuleProxy;

Expand All @@ -33,11 +38,10 @@ @implementation WorkletsModule {
return workletsModuleProxy_;
}

#if __has_include(<React/RCTBundleConsumer.h>)
#if __has_include(<React/RCTBundleProvider.h>)
// Bundle mode
@synthesize scriptBuffer = scriptBuffer_;
@synthesize sourceURL = sourceURL_;
#endif // __has_include(<React/RCTBundleConsumer.h>)
@synthesize bundleProvider = bundleProvider_;
#endif // __has_include(<React/RCTBundleProvider.h>)

- (void)checkBridgeless
{
Expand Down Expand Up @@ -66,8 +70,8 @@ - (void)checkBridgeless
std::string sourceURL = "";
std::shared_ptr<const BigStringBuffer> script = nullptr;
#ifdef WORKLETS_BUNDLE_MODE
script = [scriptBuffer_ getBuffer];
sourceURL = [sourceURL_ UTF8String];
script = [bundleProvider_ getBundle];
sourceURL = [[bundleProvider_ getSourceURL] UTF8String];
#endif // WORKLETS_BUNDLE_MODE

auto jsCallInvoker = _callInvoker.callInvoker;
Expand Down
41 changes: 5 additions & 36 deletions scripts/patches/bundle-mode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -74,49 +74,18 @@ index cb4f1c4adc..b05b824d9c 100644

module.exports = wrapWithReanimatedMetroConfig(
mergeConfig(getDefaultConfig(__dirname), config)
diff --git a/apps/fabric-example/package.json b/apps/fabric-example/package.json
index 7810a059bc..b8095d694e 100644
--- a/apps/fabric-example/package.json
+++ b/apps/fabric-example/package.json
@@ -11,7 +11,7 @@
},
"dependencies": {
"common-app": "workspace:*",
- "react-native": "0.82.0-rc.0"
+ "react-native": "patch:react-native@npm%3A0.82.0-rc.0#~/.yarn/patches/react-native-npm-0.82.0-rc.0-4775a171a4.patch"
},
"devDependencies": {
"prettier": "^3.3.3"
diff --git a/package.json b/package.json
index 6a77357267..fa77b14543 100644
index 6a77357267..df6817cce5 100644
--- a/package.json
+++ b/package.json
@@ -49,5 +49,28 @@
@@ -49,5 +49,10 @@
"prettier": "^3.3.3",
"prettier-plugin-jsdoc": "^1.3.0",
"typescript": "5.8.3"
+ },
+ "resolutions": {
+ "@react-native/community-cli-plugin@npm:0.80.0": "patch:@react-native/community-cli-plugin@npm%3A0.80.0#~/.yarn/patches/@react-native-community-cli-plugin-npm-0.80.0-4137b3f35c.patch",
+ "metro@npm:^0.82.0": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:^0.82.2": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:0.82.4": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:0.80.12": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:0.82.1": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:0.82.3": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:^0.80.3": "patch:metro@npm%3A0.82.4#~/.yarn/patches/metro-npm-0.82.4-2c6a795208.patch",
+ "metro@npm:^0.83.1": "patch:metro@npm%3A0.83.1#~/.yarn/patches/metro-npm-0.83.1-241fe42591.patch",
+ "metro@npm:0.83.1": "patch:metro@npm%3A0.83.1#~/.yarn/patches/metro-npm-0.83.1-241fe42591.patch",
+ "metro@npm:0.82.5": "patch:metro@npm%3A0.83.1#~/.yarn/patches/metro-npm-0.83.1-241fe42591.patch",
+ "metro-runtime@npm:^0.80.3": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:0.80.12": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:0.82.1": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:0.82.3": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:^0.82.0": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:^0.82.2": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:0.82.4": "patch:metro-runtime@npm%3A0.82.4#~/.yarn/patches/metro-runtime-npm-0.82.4-32e8f779f8.patch",
+ "metro-runtime@npm:^0.83.1": "patch:metro-runtime@npm%3A0.83.1#~/.yarn/patches/metro-runtime-npm-0.83.1-c3d616063e.patch",
+ "metro-runtime@npm:0.83.1": "patch:metro-runtime@npm%3A0.83.1#~/.yarn/patches/metro-runtime-npm-0.83.1-c3d616063e.patch",
+ "metro-runtime@npm:0.82.5": "patch:metro-runtime@npm%3A0.83.1#~/.yarn/patches/metro-runtime-npm-0.83.1-c3d616063e.patch"
+ "metro": "patch:metro@npm%3A0.83.1#~/.yarn/patches/metro-npm-0.83.1-241fe42591.patch",
+ "metro-runtime": "patch:metro-runtime@npm%3A0.83.1#~/.yarn/patches/metro-runtime-npm-0.83.1-c3d616063e.patch",
+ "react-native": "patch:react-native@npm%3A0.82.0-rc.4#~/.yarn/patches/react-native-npm-0.82.0-rc.4-228ad0ffa7.patch"
}
}
Loading