Skip to content

Commit

Permalink
chore: Fix codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Sep 24, 2024
1 parent da6e2ce commit ee1d2f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <react/fabric/Binding.h>
#endif

#include "RNRuntimeWorkletDecorator.h"
#include "WorkletRuntimeCollector.h"
#include "WorkletsModule.h"

Expand All @@ -24,7 +25,9 @@ WorkletsModule::WorkletsModule(
: javaPart_(jni::make_global(jThis)),
rnRuntime_(rnRuntime),
nativeWorkletsModule_(std::make_shared<reanimated::NativeWorkletsModule>(
valueUnpackerCode)) {}
valueUnpackerCode)) {
RNRuntimeWorkletDecorator::decorate(*rnRuntime_, nativeWorkletsModule_);
}

jni::local_ref<WorkletsModule::jhybriddata> WorkletsModule::initHybrid(
jni::alias_ref<jhybridobject> jThis,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.swmansion.worklets;
// This file should be a part of `worklets` package but codegen
// mangles namespaces for its Fabric counterpart.
package com.swmansion.reanimated;

import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.ReactApplicationContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.swmansion.reanimated;

import android.annotation.SuppressLint;
import android.util.Log;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.bridge.UIManagerListener;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.fabric.FabricUIManager;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.uimanager.UIManagerModule;
Expand All @@ -17,7 +17,7 @@
import java.util.Objects;
import javax.annotation.Nullable;

@UnstableReactNativeAPI
@SuppressLint("UnsafeOptInUsageError") // TODO: Fix this
@ReactModule(name = ReanimatedModule.NAME)
public class ReanimatedModule extends NativeReanimatedModuleSpec
implements LifecycleEventListener, UIManagerModuleListener, UIManagerListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
import { checkCppVersion } from '../../platform-specific/checkCppVersion';
import { getValueUnpackerCode } from '../../valueUnpacker';
import { WorkletsTurboModule } from '../../specs';
import { ReanimatedError } from '../../errors';
Expand All @@ -21,9 +20,6 @@ export class NativeWorklets {
See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#native-part-of-reanimated-doesnt-seem-to-be-initialized for more details.`
);
}
if (__DEV__) {
checkCppVersion();
}
this.#workletsModuleProxy = global.__workletsModuleProxy;
}
}

0 comments on commit ee1d2f9

Please sign in to comment.