diff --git a/.gitignore b/.gitignore index b48711db9cfd..2adc014b63ff 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,6 @@ project.xcworkspace /private/helloworld/android/app/build/ /private/helloworld/android/build/ /packages/react-native-popup-menu-android/android/build/ -/packages/react-native-test-library/android/build/ # Buck .buckd diff --git a/packages/react-native-test-library/OSSLibraryExample.podspec b/packages/react-native-test-library/OSSLibraryExample.podspec deleted file mode 100644 index 232273917fd0..000000000000 --- a/packages/react-native-test-library/OSSLibraryExample.podspec +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -require 'json' - -package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) - -Pod::Spec.new do |s| - s.name = 'OSSLibraryExample' - s.version = package['version'] - s.summary = package['description'] - s.description = package['description'] - s.homepage = package['homepage'] - s.license = package['license'] - s.platforms = min_supported_versions - s.author = 'Meta Platforms, Inc. and its affiliates' - s.source = { :git => package['repository']['url'], :tag => "#{s.version}" } - - s.source_files = 'ios/**/*.{h,m,mm,cpp}' - - install_modules_dependencies(s) -end diff --git a/packages/react-native-test-library/README.md b/packages/react-native-test-library/README.md deleted file mode 100644 index 77df8a6791b3..000000000000 --- a/packages/react-native-test-library/README.md +++ /dev/null @@ -1,9 +0,0 @@ -## Important -This package is for testing only. It is a subject to frequent change. It does not represent the recomended structure for React native libraries. It should not be used as a referece for such purposes. - -## Building -``` -yarn install -yarn build -npx react-native codegen -``` diff --git a/packages/react-native-test-library/android/build.gradle.kts b/packages/react-native-test-library/android/build.gradle.kts deleted file mode 100644 index 903c15d07aff..000000000000 --- a/packages/react-native-test-library/android/build.gradle.kts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -plugins { - id("com.facebook.react") - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) -} - -android { - compileSdk = libs.versions.compileSdk.get().toInt() - buildToolsVersion = libs.versions.buildTools.get() - namespace = "com.facebook.react.osslibraryexample" - - defaultConfig { minSdk = libs.versions.minSdk.get().toInt() } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { jvmTarget = "17" } -} - -dependencies { - // Build React Native from source - implementation(project(":packages:react-native:ReactAndroid")) -} diff --git a/packages/react-native-test-library/android/gradle.properties b/packages/react-native-test-library/android/gradle.properties deleted file mode 100644 index 92a0f87956c8..000000000000 --- a/packages/react-native-test-library/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ - -# We want to have more fine grained control on the Java version for -# ReactAndroid, therefore we disable RGNP Java version alignment mechanism -react.internal.disableJavaVersionAlignment=true diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/fbreact/specs/NativeSampleModuleSpec.java b/packages/react-native-test-library/android/src/main/java/com/facebook/fbreact/specs/NativeSampleModuleSpec.java deleted file mode 100644 index 941480642089..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/fbreact/specs/NativeSampleModuleSpec.java +++ /dev/null @@ -1,37 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleJavaSpec.js - * - * @nolint - */ - -package com.facebook.fbreact.specs; - -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; -import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.turbomodule.core.interfaces.TurboModule; -import javax.annotation.Nonnull; - -public abstract class NativeSampleModuleSpec extends ReactContextBaseJavaModule implements TurboModule { - public static final String NAME = "NativeSampleModule"; - - public NativeSampleModuleSpec(ReactApplicationContext reactContext) { - super(reactContext); - } - - @Override - public @Nonnull String getName() { - return NAME; - } - - @ReactMethod(isBlockingSynchronousMethod = true) - @DoNotStrip - public abstract double getRandomNumber(); -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/NativeSampleModule.kt b/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/NativeSampleModule.kt deleted file mode 100644 index 1304ded97845..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/NativeSampleModule.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.osslibraryexample - -import com.facebook.fbreact.specs.NativeSampleModuleSpec -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContextBaseJavaModule -import com.facebook.react.bridge.ReactMethod -import com.facebook.react.module.annotations.ReactModule - -@ReactModule(name = NativeSampleModuleSpec.NAME) -public class NativeSampleModule(reactContext: ReactApplicationContext?) : - ReactContextBaseJavaModule(reactContext) { - - override fun getName(): String = NAME - - private companion object { - const val NAME = "NativeSampleModule" - } - - @ReactMethod - public fun getRandomNumber(): Int { - return (0..99).random() - } -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/OSSLibraryExamplePackage.kt b/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/OSSLibraryExamplePackage.kt deleted file mode 100644 index 428cd61ed9e6..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/OSSLibraryExamplePackage.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.osslibraryexample - -import com.facebook.react.ReactPackage -import com.facebook.react.bridge.NativeModule -import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.uimanager.ViewManager - -@Suppress("DEPRECATION") -public class OSSLibraryExamplePackage : ReactPackage { - @Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.") - override fun createNativeModules(reactContext: ReactApplicationContext): List = - listOf(NativeSampleModule(reactContext)) - - override fun createViewManagers(reactContext: ReactApplicationContext): List> = - listOf(SampleNativeComponentViewManager()) -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeComponentViewManager.kt b/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeComponentViewManager.kt deleted file mode 100644 index 3ab92ac3bd8c..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeComponentViewManager.kt +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.osslibraryexample - -import android.annotation.SuppressLint -import android.graphics.Color -import com.facebook.react.bridge.ReadableArray -import com.facebook.react.module.annotations.ReactModule -import com.facebook.react.uimanager.SimpleViewManager -import com.facebook.react.uimanager.ThemedReactContext -import com.facebook.react.uimanager.ViewProps -import com.facebook.react.uimanager.annotations.ReactProp -import com.facebook.react.viewmanagers.SampleNativeComponentManagerInterface - -/** Legacy View manager (non Fabric compatible) for {@link SampleNativeView} components. */ -@ReactModule(name = SampleNativeComponentViewManager.REACT_CLASS) -internal class SampleNativeComponentViewManager : - SimpleViewManager(), SampleNativeComponentManagerInterface { - - override fun getName(): String = REACT_CLASS - - // @ReactProp(name = ViewProps.OPACITY, defaultFloat = 1f) - override fun setOpacity(view: SampleNativeView, opacity: Float) { - super.setOpacity(view, opacity) - } - - @SuppressLint("BadMethodUse-android.view.View.setBackgroundColor") - @ReactProp(name = ViewProps.COLOR) - fun setColor(view: SampleNativeView, color: String) { - view.setBackgroundColor(Color.parseColor(color)) - } - - @ReactProp(name = "cornerRadius") - fun setCornerRadius(view: SampleNativeView, cornerRadius: Float) { - view.setCornerRadius(cornerRadius) - } - - override fun createViewInstance(reactContext: ThemedReactContext): SampleNativeView = - SampleNativeView(reactContext) - - @SuppressLint("BadMethodUse-android.view.View.setBackgroundColor") - override fun changeBackgroundColor(view: SampleNativeView, color: String) { - view.setBackgroundColor(Color.parseColor(color)) - } - - override fun getExportedViewConstants(): Map = mapOf("PI" to 3.14) - - override fun getExportedCustomBubblingEventTypeConstants(): Map { - return mapOf( - "onColorChanged" to - mapOf( - "phasedRegistrationNames" to - mapOf( - "bubbled" to "onColorChanged", - "captured" to "onColorChangedCapture", - )), - "topIntArrayChanged" to - mapOf( - "phasedRegistrationNames" to - mapOf( - "bubbled" to "topIntArrayChanged", - "captured" to "topIntArrayChangedCapture", - ))) - } - - @SuppressLint("BadMethodUse-android.view.View.setBackgroundColor") - override fun receiveCommand(view: SampleNativeView, commandId: String, args: ReadableArray?) { - if (commandId.contentEquals("changeBackgroundColor")) { - val sentColor: Int = Color.parseColor(args?.getString(0)) - view.setBackgroundColor(sentColor) - } - } - - @Deprecated("Deprecated in Java") - @SuppressLint("BadMethodUse-android.view.View.setBackgroundColor") - @Suppress("DEPRECATION") // We intentionally want to test against the legacy API here. - override fun receiveCommand(view: SampleNativeView, commandId: Int, args: ReadableArray?) { - when (commandId) { - COMMAND_CHANGE_BACKGROUND_COLOR -> { - val sentColor: Int = Color.parseColor(args?.getString(0)) - view.setBackgroundColor(sentColor) - } - } - } - - override fun getCommandsMap(): Map = - mapOf("changeBackgroundColor" to COMMAND_CHANGE_BACKGROUND_COLOR) - - companion object { - const val REACT_CLASS = "SampleNativeComponent" - const val COMMAND_CHANGE_BACKGROUND_COLOR = 42 - } - - @ReactProp(name = "values") - override fun setValues(view: SampleNativeView, value: ReadableArray?) { - val values = mutableListOf() - value?.toArrayList()?.forEach { values.add((it as Double).toInt()) } - view.emitOnArrayChangedEvent(values) - } -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeView.kt b/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeView.kt deleted file mode 100644 index 3a4a8cf32f63..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/osslibraryexample/SampleNativeView.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.osslibraryexample - -import android.graphics.drawable.GradientDrawable -import android.view.View -import com.facebook.react.bridge.Arguments -import com.facebook.react.bridge.ReactContext -import com.facebook.react.bridge.WritableArray -import com.facebook.react.bridge.WritableMap -import com.facebook.react.uimanager.ThemedReactContext -import com.facebook.react.uimanager.UIManagerHelper -import com.facebook.react.uimanager.events.Event - -public class SampleNativeView(context: ThemedReactContext) : View(context) { - private var currentColor = 0 - private var background: GradientDrawable = GradientDrawable() - private val reactContext: ReactContext = context.reactApplicationContext - - override fun setBackgroundColor(color: Int) { - if (color != currentColor) { - background.setColor(color) - currentColor = color - setBackground(background) - } - } - - public fun setCornerRadius(cornerRadius: Float) { - background.cornerRadius = cornerRadius - setBackground(background) - } - - public fun emitOnArrayChangedEvent(ints: List) { - val newIntArray = Arguments.createArray() - val newBoolArray = Arguments.createArray() - val newFloatArray = Arguments.createArray() - val newDoubleArray = Arguments.createArray() - val newYesNoArray = Arguments.createArray() - val newStringArray = Arguments.createArray() - val newObjectArray = Arguments.createArray() - val newArrayArray = Arguments.createArray() - - for (i in ints) { - newIntArray.pushInt(i * 2) - newBoolArray.pushBoolean(i % 2 == 1) - newFloatArray.pushDouble(i * 3.14) - newDoubleArray.pushDouble(i / 3.14) - newYesNoArray.pushString(if (i % 2 == 1) "yep" else "nope") - newStringArray.pushString(i.toString()) - - val latLon = Arguments.createMap() - latLon.putDouble("lat", -1.0 * i) - latLon.putDouble("lon", 2.0 * i) - newObjectArray.pushMap(latLon) - - val innerArray: WritableArray = Arguments.createArray() - innerArray.pushInt(i) - innerArray.pushInt(i) - innerArray.pushInt(i) - newArrayArray.pushArray(innerArray) - } - - val payload = - Arguments.createMap().apply { - putArray("values", newIntArray) - putArray("boolValues", newBoolArray) - putArray("floats", newFloatArray) - putArray("doubles", newDoubleArray) - putArray("yesNos", newYesNoArray) - putArray("strings", newStringArray) - putArray("latLons", newObjectArray) - putArray("multiArrays", newArrayArray) - } - - val reactContext = context as ReactContext - val surfaceId = UIManagerHelper.getSurfaceId(reactContext) - val eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, id) - val event = OnIntArrayChangedEvent(surfaceId, id, payload) - - eventDispatcher?.dispatchEvent(event) - } - - private inner class OnIntArrayChangedEvent( - surfaceId: Int, - viewId: Int, - private val payload: WritableMap - ) : Event(surfaceId, viewId) { - override fun getEventName() = "topIntArrayChanged" - - override fun getEventData() = payload - } -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerDelegate.java b/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerDelegate.java deleted file mode 100644 index bb5b9b527360..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerDelegate.java +++ /dev/null @@ -1,45 +0,0 @@ -/** -* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). -* -* Do not edit this file as changes may cause incorrect behavior and will be lost -* once the code is regenerated. -* -* @generated by codegen project: GeneratePropsJavaDelegate.js -*/ - -package com.facebook.react.viewmanagers; - -import android.view.View; -import androidx.annotation.Nullable; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.uimanager.BaseViewManagerDelegate; -import com.facebook.react.uimanager.BaseViewManager; -import com.facebook.react.uimanager.LayoutShadowNode; - -public class SampleNativeComponentManagerDelegate & SampleNativeComponentManagerInterface> extends BaseViewManagerDelegate { - public SampleNativeComponentManagerDelegate(U viewManager) { - super(viewManager); - } - @Override - public void setProperty(T view, String propName, @Nullable Object value) { - switch (propName) { - case "opacity": - mViewManager.setOpacity(view, value == null ? 0f : ((Double) value).floatValue()); - break; - case "values": - mViewManager.setValues(view, (ReadableArray) value); - break; - default: - super.setProperty(view, propName, value); - } - } - - @Override - public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) { - switch (commandName) { - case "changeBackgroundColor": - mViewManager.changeBackgroundColor(view, args.getString(0)); - break; - } - } -} diff --git a/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerInterface.java b/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerInterface.java deleted file mode 100644 index 576aec6af7cf..000000000000 --- a/packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/** -* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). -* -* Do not edit this file as changes may cause incorrect behavior and will be lost -* once the code is regenerated. -* -* @generated by codegen project: GeneratePropsJavaInterface.js -*/ - -package com.facebook.react.viewmanagers; - -import android.view.View; -import androidx.annotation.Nullable; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; - -public interface SampleNativeComponentManagerInterface extends ViewManagerWithGeneratedInterface { - void setOpacity(T view, float value); - void setValues(T view, @Nullable ReadableArray value); - void changeBackgroundColor(T view, String color); -} diff --git a/packages/react-native-test-library/android/src/main/jni/CMakeLists.txt b/packages/react-native-test-library/android/src/main/jni/CMakeLists.txt deleted file mode 100644 index 1d9a3091aefb..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -cmake_minimum_required(VERSION 3.13) -set(CMAKE_VERBOSE_MAKEFILE on) - -file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/OSSLibraryExampleSpec/*.cpp) - -add_library( - react_codegen_OSSLibraryExampleSpec - OBJECT - ${react_codegen_SRCS} -) - -target_include_directories(react_codegen_OSSLibraryExampleSpec PUBLIC . react/renderer/components/OSSLibraryExampleSpec) - -target_link_libraries( - react_codegen_OSSLibraryExampleSpec - fbjni - jsi - reactnative -) - -target_compile_reactnative_options(react_codegen_OSSLibraryExampleSpec PRIVATE) diff --git a/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec-generated.cpp b/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec-generated.cpp deleted file mode 100644 index b940af418aa7..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec-generated.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleJniCpp.js - */ - -#include "OSSLibraryExampleSpec.h" - -namespace facebook::react { - -static facebook::jsi::Value __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - static jmethodID cachedMethodId = nullptr; - return static_cast(turboModule).invokeJavaMethod(rt, NumberKind, "getRandomNumber", "()D", args, count, cachedMethodId); -} - -NativeSampleModuleSpecJSI::NativeSampleModuleSpecJSI(const JavaTurboModule::InitParams ¶ms) - : JavaTurboModule(params) { - methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber}; -} - -std::shared_ptr OSSLibraryExampleSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) { - if (moduleName == "NativeSampleModule") { - return std::make_shared(params); - } - return nullptr; -} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec.h b/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec.h deleted file mode 100644 index 6d39f6b6de3d..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/OSSLibraryExampleSpec.h +++ /dev/null @@ -1,31 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleJniH.js - */ - -#pragma once - -#include -#include -#include - -namespace facebook::react { - -/** - * JNI C++ class for module 'NativeSampleModule' - */ -class JSI_EXPORT NativeSampleModuleSpecJSI : public JavaTurboModule { -public: - NativeSampleModuleSpecJSI(const JavaTurboModule::InitParams ¶ms); -}; - - -JSI_EXPORT -std::shared_ptr OSSLibraryExampleSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms); - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.cpp deleted file mode 100644 index 385369e4c052..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateComponentDescriptorCpp.js - */ - -#include "ComponentDescriptors.h" -#include -#include - -namespace facebook::react { - -void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen( - std::shared_ptr registry) { -registry->add(concreteComponentDescriptorProvider()); -} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.h deleted file mode 100644 index eac078b81d9d..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ComponentDescriptors.h +++ /dev/null @@ -1,24 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateComponentDescriptorH.js - */ - -#pragma once - -#include "ShadowNodes.h" -#include -#include - -namespace facebook::react { - -using SampleNativeComponentComponentDescriptor = ConcreteComponentDescriptor; - -void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen( - std::shared_ptr registry); - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.cpp deleted file mode 100644 index c5746ac5306d..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.cpp +++ /dev/null @@ -1,95 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterCpp.js - */ - -#include "EventEmitters.h" - - -namespace facebook::react { - -void SampleNativeComponentEventEmitter::onIntArrayChanged(OnIntArrayChanged $event) const { - dispatchEvent("intArrayChanged", [$event=std::move($event)](jsi::Runtime &runtime) { - auto $payload = jsi::Object(runtime); - - auto values = jsi::Array(runtime, $event.values.size()); - size_t valuesIndex = 0; - for (auto valuesValue : $event.values) { - values.setValueAtIndex(runtime, valuesIndex++, valuesValue); - } - $payload.setProperty(runtime, "values", values); - - - auto boolValues = jsi::Array(runtime, $event.boolValues.size()); - size_t boolValuesIndex = 0; - for (auto boolValuesValue : $event.boolValues) { - boolValues.setValueAtIndex(runtime, boolValuesIndex++, (bool)boolValuesValue); - } - $payload.setProperty(runtime, "boolValues", boolValues); - - - auto floats = jsi::Array(runtime, $event.floats.size()); - size_t floatsIndex = 0; - for (auto floatsValue : $event.floats) { - floats.setValueAtIndex(runtime, floatsIndex++, floatsValue); - } - $payload.setProperty(runtime, "floats", floats); - - - auto doubles = jsi::Array(runtime, $event.doubles.size()); - size_t doublesIndex = 0; - for (auto doublesValue : $event.doubles) { - doubles.setValueAtIndex(runtime, doublesIndex++, doublesValue); - } - $payload.setProperty(runtime, "doubles", doubles); - - - auto yesNos = jsi::Array(runtime, $event.yesNos.size()); - size_t yesNosIndex = 0; - for (auto yesNosValue : $event.yesNos) { - yesNos.setValueAtIndex(runtime, yesNosIndex++, toString(yesNosValue)); - } - $payload.setProperty(runtime, "yesNos", yesNos); - - - auto strings = jsi::Array(runtime, $event.strings.size()); - size_t stringsIndex = 0; - for (auto stringsValue : $event.strings) { - strings.setValueAtIndex(runtime, stringsIndex++, stringsValue); - } - $payload.setProperty(runtime, "strings", strings); - - - auto latLons = jsi::Array(runtime, $event.latLons.size()); - size_t latLonsIndex = 0; - for (auto latLonsValue : $event.latLons) { - auto latLonsObject = jsi::Object(runtime); - latLonsObject.setProperty(runtime, "lat", latLonsValue.lat); -latLonsObject.setProperty(runtime, "lon", latLonsValue.lon); - latLons.setValueAtIndex(runtime, latLonsIndex++, latLonsObject); - } - $payload.setProperty(runtime, "latLons", latLons); - - - auto multiArrays = jsi::Array(runtime, $event.multiArrays.size()); - size_t multiArraysIndex = 0; - for (auto multiArraysValue : $event.multiArrays) { - auto multiArraysArray = jsi::Array(runtime, multiArraysValue.size()); - size_t multiArraysIndexInternal = 0; - for (auto multiArraysValueInternal : multiArraysValue) { - multiArraysArray.setValueAtIndex(runtime, multiArraysIndexInternal++, multiArraysValueInternal); - } - multiArrays.setValueAtIndex(runtime, multiArraysIndex++, multiArraysArray); - } - $payload.setProperty(runtime, "multiArrays", multiArrays); - - return $payload; - }); -} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.h deleted file mode 100644 index bfb9cc27ae82..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/EventEmitters.h +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterH.js - */ -#pragma once - -#include - - -namespace facebook::react { -class SampleNativeComponentEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - enum class OnIntArrayChangedYesNos { - Yep, - Nope - }; - - static char const *toString(const OnIntArrayChangedYesNos value) { - switch (value) { - case OnIntArrayChangedYesNos::Yep: return "yep"; - case OnIntArrayChangedYesNos::Nope: return "nope"; - } - } - - struct OnIntArrayChangedLatLons { - double lat; - double lon; - }; - - struct OnIntArrayChanged { - std::vector values; - std::vector boolValues; - std::vector floats; - std::vector doubles; - std::vector yesNos; - std::vector strings; - std::vector latLons; - std::vector> multiArrays; - }; - void onIntArrayChanged(OnIntArrayChanged value) const; -}; -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI-generated.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI-generated.cpp deleted file mode 100644 index fc734d9e6f30..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI-generated.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "OSSLibraryExampleSpecJSI.h" - -namespace facebook::react { - -static jsi::Value __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRandomNumber( - rt - ); -} - -NativeSampleModuleCxxSpecJSI::NativeSampleModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeSampleModule", jsInvoker) { - methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber}; -} - - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI.h deleted file mode 100644 index c19f8f089d38..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/OSSLibraryExampleSpecJSI.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleH.js - */ - -#pragma once - -#include -#include - -namespace facebook::react { - - - class JSI_EXPORT NativeSampleModuleCxxSpecJSI : public TurboModule { -protected: - NativeSampleModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double getRandomNumber(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeSampleModule"; - -protected: - NativeSampleModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSampleModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double getRandomNumber(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getRandomNumber) == 1, - "Expected getRandomNumber(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getRandomNumber, jsInvoker_, instance_); - } - - private: - friend class NativeSampleModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.cpp deleted file mode 100644 index 595766f26bd0..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsCpp.js - */ - -#include "Props.h" -#include -#include - -namespace facebook::react { - -SampleNativeComponentProps::SampleNativeComponentProps( - const PropsParserContext &context, - const SampleNativeComponentProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {0.0})), - values(convertRawProp(context, rawProps, "values", sourceProps.values, {})) - {} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.h deleted file mode 100644 index fd7ad9642bcb..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/Props.h +++ /dev/null @@ -1,29 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsH.js - */ -#pragma once - -#include -#include -#include - -namespace facebook::react { - -class SampleNativeComponentProps final : public ViewProps { - public: - SampleNativeComponentProps() = default; - SampleNativeComponentProps(const PropsParserContext& context, const SampleNativeComponentProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - Float opacity{0.0}; - std::vector values{}; -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.cpp deleted file mode 100644 index 790189cffd6e..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeCpp.js - */ - -#include "ShadowNodes.h" - -namespace facebook::react { - -extern const char SampleNativeComponentComponentName[] = "SampleNativeComponent"; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.h deleted file mode 100644 index 20b9db3837a1..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/ShadowNodes.h +++ /dev/null @@ -1,32 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeH.js - */ - -#pragma once - -#include "EventEmitters.h" -#include "Props.h" -#include "States.h" -#include -#include - -namespace facebook::react { - -JSI_EXPORT extern const char SampleNativeComponentComponentName[]; - -/* - * `ShadowNode` for component. - */ -using SampleNativeComponentShadowNode = ConcreteViewShadowNode< - SampleNativeComponentComponentName, - SampleNativeComponentProps, - SampleNativeComponentEventEmitter, - SampleNativeComponentState>; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.cpp b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.cpp deleted file mode 100644 index 1dbb184cbddb..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateCpp.js - */ -#include "States.h" - -namespace facebook::react { - - - -} // namespace facebook::react diff --git a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.h b/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.h deleted file mode 100644 index 1cffd0cfe6dc..000000000000 --- a/packages/react-native-test-library/android/src/main/jni/react/renderer/components/OSSLibraryExampleSpec/States.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateH.js - */ -#pragma once - -#ifdef RN_SERIALIZABLE_STATE -#include -#endif - -namespace facebook::react { - -class SampleNativeComponentState { -public: - SampleNativeComponentState() = default; - -#ifdef RN_SERIALIZABLE_STATE - SampleNativeComponentState(SampleNativeComponentState const &previousState, folly::dynamic data){}; - folly::dynamic getDynamic() const { - return {}; - }; -#endif -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/babel.config.js b/packages/react-native-test-library/babel.config.js deleted file mode 100644 index 87d86f0b5a5e..000000000000 --- a/packages/react-native-test-library/babel.config.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @noflow - */ - -module.exports = { - presets: [ - [ - 'module:@react-native/babel-preset', - {disableStaticViewConfigsCodegen: false}, - ], - ], -}; diff --git a/packages/react-native-test-library/index.js b/packages/react-native-test-library/index.js deleted file mode 100644 index 7e033cab5a6d..000000000000 --- a/packages/react-native-test-library/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -export {default as SampleNativeComponent} from './src/SampleNativeComponent'; -export type {NativeComponentType} from './src/SampleNativeComponent'; -import {Commands as SampleNativeComponentCommands} from './src/SampleNativeComponent'; - -export {SampleNativeComponentCommands}; -export {default as NativeSampleModule} from './src/NativeSampleModule'; diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.cpp deleted file mode 100644 index 385369e4c052..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateComponentDescriptorCpp.js - */ - -#include "ComponentDescriptors.h" -#include -#include - -namespace facebook::react { - -void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen( - std::shared_ptr registry) { -registry->add(concreteComponentDescriptorProvider()); -} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.h deleted file mode 100644 index eac078b81d9d..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ComponentDescriptors.h +++ /dev/null @@ -1,24 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateComponentDescriptorH.js - */ - -#pragma once - -#include "ShadowNodes.h" -#include -#include - -namespace facebook::react { - -using SampleNativeComponentComponentDescriptor = ConcreteComponentDescriptor; - -void OSSLibraryExampleSpec_registerComponentDescriptorsFromCodegen( - std::shared_ptr registry); - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.cpp deleted file mode 100644 index c5746ac5306d..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.cpp +++ /dev/null @@ -1,95 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterCpp.js - */ - -#include "EventEmitters.h" - - -namespace facebook::react { - -void SampleNativeComponentEventEmitter::onIntArrayChanged(OnIntArrayChanged $event) const { - dispatchEvent("intArrayChanged", [$event=std::move($event)](jsi::Runtime &runtime) { - auto $payload = jsi::Object(runtime); - - auto values = jsi::Array(runtime, $event.values.size()); - size_t valuesIndex = 0; - for (auto valuesValue : $event.values) { - values.setValueAtIndex(runtime, valuesIndex++, valuesValue); - } - $payload.setProperty(runtime, "values", values); - - - auto boolValues = jsi::Array(runtime, $event.boolValues.size()); - size_t boolValuesIndex = 0; - for (auto boolValuesValue : $event.boolValues) { - boolValues.setValueAtIndex(runtime, boolValuesIndex++, (bool)boolValuesValue); - } - $payload.setProperty(runtime, "boolValues", boolValues); - - - auto floats = jsi::Array(runtime, $event.floats.size()); - size_t floatsIndex = 0; - for (auto floatsValue : $event.floats) { - floats.setValueAtIndex(runtime, floatsIndex++, floatsValue); - } - $payload.setProperty(runtime, "floats", floats); - - - auto doubles = jsi::Array(runtime, $event.doubles.size()); - size_t doublesIndex = 0; - for (auto doublesValue : $event.doubles) { - doubles.setValueAtIndex(runtime, doublesIndex++, doublesValue); - } - $payload.setProperty(runtime, "doubles", doubles); - - - auto yesNos = jsi::Array(runtime, $event.yesNos.size()); - size_t yesNosIndex = 0; - for (auto yesNosValue : $event.yesNos) { - yesNos.setValueAtIndex(runtime, yesNosIndex++, toString(yesNosValue)); - } - $payload.setProperty(runtime, "yesNos", yesNos); - - - auto strings = jsi::Array(runtime, $event.strings.size()); - size_t stringsIndex = 0; - for (auto stringsValue : $event.strings) { - strings.setValueAtIndex(runtime, stringsIndex++, stringsValue); - } - $payload.setProperty(runtime, "strings", strings); - - - auto latLons = jsi::Array(runtime, $event.latLons.size()); - size_t latLonsIndex = 0; - for (auto latLonsValue : $event.latLons) { - auto latLonsObject = jsi::Object(runtime); - latLonsObject.setProperty(runtime, "lat", latLonsValue.lat); -latLonsObject.setProperty(runtime, "lon", latLonsValue.lon); - latLons.setValueAtIndex(runtime, latLonsIndex++, latLonsObject); - } - $payload.setProperty(runtime, "latLons", latLons); - - - auto multiArrays = jsi::Array(runtime, $event.multiArrays.size()); - size_t multiArraysIndex = 0; - for (auto multiArraysValue : $event.multiArrays) { - auto multiArraysArray = jsi::Array(runtime, multiArraysValue.size()); - size_t multiArraysIndexInternal = 0; - for (auto multiArraysValueInternal : multiArraysValue) { - multiArraysArray.setValueAtIndex(runtime, multiArraysIndexInternal++, multiArraysValueInternal); - } - multiArrays.setValueAtIndex(runtime, multiArraysIndex++, multiArraysArray); - } - $payload.setProperty(runtime, "multiArrays", multiArrays); - - return $payload; - }); -} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.h deleted file mode 100644 index bfb9cc27ae82..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/EventEmitters.h +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateEventEmitterH.js - */ -#pragma once - -#include - - -namespace facebook::react { -class SampleNativeComponentEventEmitter : public ViewEventEmitter { - public: - using ViewEventEmitter::ViewEventEmitter; - - enum class OnIntArrayChangedYesNos { - Yep, - Nope - }; - - static char const *toString(const OnIntArrayChangedYesNos value) { - switch (value) { - case OnIntArrayChangedYesNos::Yep: return "yep"; - case OnIntArrayChangedYesNos::Nope: return "nope"; - } - } - - struct OnIntArrayChangedLatLons { - double lat; - double lon; - }; - - struct OnIntArrayChanged { - std::vector values; - std::vector boolValues; - std::vector floats; - std::vector doubles; - std::vector yesNos; - std::vector strings; - std::vector latLons; - std::vector> multiArrays; - }; - void onIntArrayChanged(OnIntArrayChanged value) const; -}; -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec-generated.mm b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec-generated.mm deleted file mode 100644 index faf7056af985..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec-generated.mm +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleObjCpp - * - * We create an umbrella header (and corresponding implementation) here since - * Cxx compilation in BUCK has a limitation: source-code producing genrule()s - * must have a single output. More files => more genrule()s => slower builds. - */ - -#import "OSSLibraryExampleSpec.h" - - -namespace facebook::react { - - static facebook::jsi::Value __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) { - return static_cast(turboModule).invokeObjCMethod(rt, NumberKind, "getRandomNumber", @selector(getRandomNumber), args, count); - } - - NativeSampleModuleSpecJSI::NativeSampleModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms) - : ObjCTurboModule(params) { - - methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleSpecJSI_getRandomNumber}; - - } -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec.h deleted file mode 100644 index 1ff5010b13fc..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/OSSLibraryExampleSpec.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleObjCpp - * - * We create an umbrella header (and corresponding implementation) here since - * Cxx compilation in BUCK has a limitation: source-code producing genrule()s - * must have a single output. More files => more genrule()s => slower builds. - */ - -#ifndef __cplusplus -#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. -#endif - -// Avoid multiple includes of OSSLibraryExampleSpec symbols -#ifndef OSSLibraryExampleSpec_H -#define OSSLibraryExampleSpec_H - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - - -@protocol NativeSampleModuleSpec - -- (NSNumber *)getRandomNumber; - -@end -namespace facebook::react { - /** - * ObjC++ class for module 'NativeSampleModule' - */ - class JSI_EXPORT NativeSampleModuleSpecJSI : public ObjCTurboModule { - public: - NativeSampleModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); - }; -} // namespace facebook::react - -#endif // OSSLibraryExampleSpec_H diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.cpp deleted file mode 100644 index 595766f26bd0..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsCpp.js - */ - -#include "Props.h" -#include -#include - -namespace facebook::react { - -SampleNativeComponentProps::SampleNativeComponentProps( - const PropsParserContext &context, - const SampleNativeComponentProps &sourceProps, - const RawProps &rawProps): ViewProps(context, sourceProps, rawProps), - - opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {0.0})), - values(convertRawProp(context, rawProps, "values", sourceProps.values, {})) - {} - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.h deleted file mode 100644 index fd7ad9642bcb..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/Props.h +++ /dev/null @@ -1,29 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GeneratePropsH.js - */ -#pragma once - -#include -#include -#include - -namespace facebook::react { - -class SampleNativeComponentProps final : public ViewProps { - public: - SampleNativeComponentProps() = default; - SampleNativeComponentProps(const PropsParserContext& context, const SampleNativeComponentProps &sourceProps, const RawProps &rawProps); - -#pragma mark - Props - - Float opacity{0.0}; - std::vector values{}; -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/RCTComponentViewHelpers.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/RCTComponentViewHelpers.h deleted file mode 100644 index d6e5a3531eed..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/RCTComponentViewHelpers.h +++ /dev/null @@ -1,50 +0,0 @@ -/** -* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). -* -* Do not edit this file as changes may cause incorrect behavior and will be lost -* once the code is regenerated. -* -* @generated by codegen project: GenerateComponentHObjCpp.js -*/ - -#import -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol RCTSampleNativeComponentViewProtocol -- (void)changeBackgroundColor:(NSString *)color; -@end - -RCT_EXTERN inline void RCTSampleNativeComponentHandleCommand( - id componentView, - NSString const *commandName, - NSArray const *args) -{ - if ([commandName isEqualToString:@"changeBackgroundColor"]) { -#if RCT_DEBUG - if ([args count] != 1) { - RCTLogError(@"%@ command %@ received %d arguments, expected %d.", @"SampleNativeComponent", commandName, (int)[args count], 1); - return; - } -#endif - - NSObject *arg0 = args[0]; -#if RCT_DEBUG - if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSString class], @"string", @"SampleNativeComponent", commandName, @"1st")) { - return; - } -#endif - NSString * color = (NSString *)arg0; - - [componentView changeBackgroundColor:color]; - return; -} - -#if RCT_DEBUG - RCTLogError(@"%@ received command %@, which is not a supported command.", @"SampleNativeComponent", commandName); -#endif -} - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.cpp deleted file mode 100644 index 790189cffd6e..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeCpp.js - */ - -#include "ShadowNodes.h" - -namespace facebook::react { - -extern const char SampleNativeComponentComponentName[] = "SampleNativeComponent"; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.h deleted file mode 100644 index 20b9db3837a1..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/ShadowNodes.h +++ /dev/null @@ -1,32 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateShadowNodeH.js - */ - -#pragma once - -#include "EventEmitters.h" -#include "Props.h" -#include "States.h" -#include -#include - -namespace facebook::react { - -JSI_EXPORT extern const char SampleNativeComponentComponentName[]; - -/* - * `ShadowNode` for component. - */ -using SampleNativeComponentShadowNode = ConcreteViewShadowNode< - SampleNativeComponentComponentName, - SampleNativeComponentProps, - SampleNativeComponentEventEmitter, - SampleNativeComponentState>; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.cpp deleted file mode 100644 index 1dbb184cbddb..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateCpp.js - */ -#include "States.h" - -namespace facebook::react { - - - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.h deleted file mode 100644 index 1cffd0cfe6dc..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpec/States.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateStateH.js - */ -#pragma once - -#ifdef RN_SERIALIZABLE_STATE -#include -#endif - -namespace facebook::react { - -class SampleNativeComponentState { -public: - SampleNativeComponentState() = default; - -#ifdef RN_SERIALIZABLE_STATE - SampleNativeComponentState(SampleNativeComponentState const &previousState, folly::dynamic data){}; - folly::dynamic getDynamic() const { - return {}; - }; -#endif -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI-generated.cpp b/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI-generated.cpp deleted file mode 100644 index fc734d9e6f30..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI-generated.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleCpp.js - */ - -#include "OSSLibraryExampleSpecJSI.h" - -namespace facebook::react { - -static jsi::Value __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) { - return static_cast(&turboModule)->getRandomNumber( - rt - ); -} - -NativeSampleModuleCxxSpecJSI::NativeSampleModuleCxxSpecJSI(std::shared_ptr jsInvoker) - : TurboModule("NativeSampleModule", jsInvoker) { - methodMap_["getRandomNumber"] = MethodMetadata {0, __hostFunction_NativeSampleModuleCxxSpecJSI_getRandomNumber}; -} - - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI.h b/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI.h deleted file mode 100644 index c19f8f089d38..000000000000 --- a/packages/react-native-test-library/ios/OSSLibraryExampleSpecJSI.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). - * - * Do not edit this file as changes may cause incorrect behavior and will be lost - * once the code is regenerated. - * - * @generated by codegen project: GenerateModuleH.js - */ - -#pragma once - -#include -#include - -namespace facebook::react { - - - class JSI_EXPORT NativeSampleModuleCxxSpecJSI : public TurboModule { -protected: - NativeSampleModuleCxxSpecJSI(std::shared_ptr jsInvoker); - -public: - virtual double getRandomNumber(jsi::Runtime &rt) = 0; - -}; - -template -class JSI_EXPORT NativeSampleModuleCxxSpec : public TurboModule { -public: - jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override { - return delegate_.create(rt, propName); - } - - static constexpr std::string_view kModuleName = "NativeSampleModule"; - -protected: - NativeSampleModuleCxxSpec(std::shared_ptr jsInvoker) - : TurboModule(std::string{NativeSampleModuleCxxSpec::kModuleName}, jsInvoker), - delegate_(reinterpret_cast(this), jsInvoker) {} - - -private: - class Delegate : public NativeSampleModuleCxxSpecJSI { - public: - Delegate(T *instance, std::shared_ptr jsInvoker) : - NativeSampleModuleCxxSpecJSI(std::move(jsInvoker)), instance_(instance) { - - } - - double getRandomNumber(jsi::Runtime &rt) override { - static_assert( - bridging::getParameterCount(&T::getRandomNumber) == 1, - "Expected getRandomNumber(...) to have 1 parameters"); - - return bridging::callFromJs( - rt, &T::getRandomNumber, jsInvoker_, instance_); - } - - private: - friend class NativeSampleModuleCxxSpec; - T *instance_; - }; - - Delegate delegate_; -}; - -} // namespace facebook::react diff --git a/packages/react-native-test-library/ios/RCTNativeSampleModule.mm b/packages/react-native-test-library/ios/RCTNativeSampleModule.mm deleted file mode 100644 index b5a059b7f6e6..000000000000 --- a/packages/react-native-test-library/ios/RCTNativeSampleModule.mm +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#ifdef RCT_NEW_ARCH_ENABLED -#import "OSSLibraryExampleSpec/OSSLibraryExampleSpec.h" -#else -#import -#endif - -#import -#include -#include - -#ifdef RCT_NEW_ARCH_ENABLED -@interface RCTNativeSampleModule : NSObject -#else -@interface RCTNativeSampleModule : NSObject -#endif - -@end - -@implementation RCTNativeSampleModule - -RCT_EXPORT_MODULE(); - -#ifdef RCT_NEW_ARCH_ENABLED -- (std::shared_ptr)getTurboModule: - (const facebook::react::ObjCTurboModule::InitParams &)params -{ - return std::make_shared(params); -} -#endif - -#ifdef RCT_NEW_ARCH_ENABLED -- (NSNumber *)getRandomNumber -#else -RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getRandomNumber) -#endif -{ - return @(arc4random_uniform(99)); -} - -@end diff --git a/packages/react-native-test-library/ios/RCTSampleNativeComponentComponentView.mm b/packages/react-native-test-library/ios/RCTSampleNativeComponentComponentView.mm deleted file mode 100644 index 13dca042838e..000000000000 --- a/packages/react-native-test-library/ios/RCTSampleNativeComponentComponentView.mm +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "OSSLibraryExampleSpec/ComponentDescriptors.h" -#import "OSSLibraryExampleSpec/EventEmitters.h" -#import "OSSLibraryExampleSpec/Props.h" -#import "OSSLibraryExampleSpec/RCTComponentViewHelpers.h" - -#import "RCTFabricComponentsPlugins.h" - -#import -#import -#import - -using namespace facebook::react; - -static UIColor *UIColorFromHexString(const std::string hexString) -{ - unsigned rgbValue = 0; - NSString *colorString = [NSString stringWithCString:hexString.c_str() encoding:[NSString defaultCStringEncoding]]; - NSScanner *scanner = [NSScanner scannerWithString:colorString]; - [scanner setScanLocation:1]; // bypass '#' character - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0 - green:((rgbValue & 0xFF00) >> 8) / 255.0 - blue:(rgbValue & 0xFF) / 255.0 - alpha:1.0]; -} - -@interface RCTSampleNativeComponentComponentView : RCTViewComponentView - -@property (nonatomic, copy) RCTBubblingEventBlock onIntArrayChanged; - -@end - -@implementation RCTSampleNativeComponentComponentView { - UIView *_view; -} - -+ (ComponentDescriptorProvider)componentDescriptorProvider -{ - return concreteComponentDescriptorProvider(); -} - -// Load is not invoked if it is not defined, therefore, we must ask to update this. -// See the Apple documentation: https://developer.apple.com/documentation/objectivec/nsobject/1418815-load?language=objc -// "[...] but only if the newly loaded class or category implements a method that can respond." -+ (void)load -{ - [super load]; -} - -- (instancetype)initWithFrame:(CGRect)frame -{ - if (self = [super initWithFrame:frame]) { - static const auto defaultProps = std::make_shared(); - _props = defaultProps; - - _view = [[UIView alloc] init]; - _view.backgroundColor = [UIColor redColor]; - - self.contentView = _view; - } - - return self; -} - -- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps -{ - const auto &oldViewProps = *std::static_pointer_cast(_props); - const auto &newViewProps = *std::static_pointer_cast(props); - - if (oldViewProps.values != newViewProps.values) { - if (_eventEmitter) { - std::vector newVector = {}; - std::vector newBoolVector = {}; - std::vector newFloatVector = {}; - std::vector newDoubleVector = {}; - std::vector newYesNoVector = {}; - std::vector newStringVector = {}; - std::vector newLatLonVector = {}; - std::vector> newIntVectorVector = {}; - for (auto val : newViewProps.values) { - newVector.push_back(val * 2); - newBoolVector.push_back(val % 2 ? true : false); - newFloatVector.push_back(val * 3.14); - newDoubleVector.push_back(val / 3.14); - newYesNoVector.push_back( - val % 2 ? SampleNativeComponentEventEmitter::OnIntArrayChangedYesNos::Yep - : SampleNativeComponentEventEmitter::OnIntArrayChangedYesNos::Nope); - newStringVector.push_back(std::to_string(val)); - newLatLonVector.push_back({-1.0 * val, 2.0 * val}); - newIntVectorVector.push_back({val, val, val}); - } - SampleNativeComponentEventEmitter::OnIntArrayChanged value = { - newVector, - newBoolVector, - newFloatVector, - newDoubleVector, - newYesNoVector, - newStringVector, - newLatLonVector, - newIntVectorVector}; - std::static_pointer_cast(_eventEmitter)->onIntArrayChanged(value); - } - } - - [super updateProps:props oldProps:oldProps]; -} - -- (void)onChange:(UIView *)sender -{ - // No-op - // std::dynamic_pointer_cast(_eventEmitter) - // ->onChange(ViewEventEmitter::OnChange{.value = static_cast(sender.on)}); -} - -#pragma mark - Native Commands - -- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args -{ - RCTSampleNativeComponentHandleCommand(self, commandName, args); -} - -- (void)changeBackgroundColor:(NSString *)color -{ - _view.backgroundColor = UIColorFromHexString(std::string(color.UTF8String)); -} - -@end - -Class SampleNativeComponentCls(void) -{ - return RCTSampleNativeComponentComponentView.class; -} diff --git a/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm b/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm deleted file mode 100644 index 809812602093..000000000000 --- a/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import -#import -#import - -#import - -static UIColor *UIColorFromHexString(const std::string hexString) -{ - unsigned rgbValue = 0; - NSString *colorString = [NSString stringWithCString:hexString.c_str() encoding:[NSString defaultCStringEncoding]]; - NSScanner *scanner = [NSScanner scannerWithString:colorString]; - [scanner setScanLocation:1]; // bypass '#' character - [scanner scanHexInt:&rgbValue]; - return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0 - green:((rgbValue & 0xFF00) >> 8) / 255.0 - blue:(rgbValue & 0xFF) / 255.0 - alpha:1.0]; -} - -@interface RCTSampleNativeComponentViewManager : RCTViewManager -@end - -@implementation RCTSampleNativeComponentViewManager - -RCT_EXPORT_MODULE(SampleNativeComponent) - -RCT_REMAP_VIEW_PROPERTY(color, backgroundColor, UIColor) - -RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat) - -RCT_EXPORT_VIEW_PROPERTY(onColorChanged, RCTBubblingEventBlock) - -RCT_CUSTOM_VIEW_PROPERTY(cornerRadius, CGFloat, UIView) -{ - view.clipsToBounds = true; - NSNumber *cornerRadius = (NSNumber *)json; - view.layer.cornerRadius = [cornerRadius floatValue]; -} - -RCT_EXPORT_METHOD(changeBackgroundColor : (nonnull NSNumber *)reactTag color : (NSString *)color) -{ - [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { - if (UIView *view = [RCTSampleNativeComponentViewManager getViewByTag:viewRegistry reactTag:reactTag]) { - view.backgroundColor = UIColorFromHexString(std::string(color.UTF8String)); - } - }]; -} - -+ (UIView *)getViewByTag:(NSDictionary *)viewRegistry reactTag:(nonnull NSNumber *)reactTag -{ - UIView *view = viewRegistry[reactTag]; - if (view == nil) { - RCTLogError(@"Cannot find view with tag #%@", reactTag); - } - return view; -} - -- (UIView *)view -{ - UIView *view = [UIView new]; - view.backgroundColor = UIColor.redColor; - return view; -} - -@end diff --git a/packages/react-native-test-library/package.json b/packages/react-native-test-library/package.json deleted file mode 100644 index 96311c75092f..000000000000 --- a/packages/react-native-test-library/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "@react-native/oss-library-example", - "version": "0.81.0-main", - "private": true, - "description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.", - "license": "MIT", - "homepage": "https://github.com/facebook/react-native.git", - "repository": { - "type": "git", - "url": "https://github.com/facebook/react-native.git", - "directory": "packages/react-native-test-library" - }, - "main": "./index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "scripts": { - "build": "yarn clean && babel --out-dir lib src", - "clean": "rimraf lib", - "codegen": "npx react-native codegen", - "prepare": "yarn run codegen && yarn run build" - }, - "files": [ - "generated" - ], - "devDependencies": { - "@babel/core": "^7.25.2", - "@react-native/babel-preset": "0.81.0-main", - "react-native": "1000.0.0" - }, - "peerDependencies": { - "react": "*", - "react-native": "*" - }, - "codegenConfig": { - "name": "OSSLibraryExampleSpec", - "type": "all", - "jsSrcsDir": "src", - "outputDir": { - "ios": "ios", - "android": "android/src/main" - }, - "includesGeneratedCode": true, - "android": { - "javaPackageName": "com.reactnative.osslibraryexample" - }, - "ios": { - "componentProvider": { - "SampleNativeComponent": "RCTSampleNativeComponentComponentView" - } - } - } -} diff --git a/packages/react-native-test-library/react-native.config.js b/packages/react-native-test-library/react-native.config.js deleted file mode 100644 index 5301f495f7d6..000000000000 --- a/packages/react-native-test-library/react-native.config.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @noflow - */ - -module.exports = { - dependency: { - platforms: { - android: { - cmakeListsPath: '../android/src/main/jni/CMakeLists.txt', - }, - }, - }, -}; diff --git a/packages/react-native-test-library/src/NativeSampleModule.js b/packages/react-native-test-library/src/NativeSampleModule.js deleted file mode 100644 index de546b74e53d..000000000000 --- a/packages/react-native-test-library/src/NativeSampleModule.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport'; - -import {TurboModuleRegistry} from 'react-native'; - -export interface Spec extends TurboModule { - +getRandomNumber: () => number; -} - -export default (TurboModuleRegistry.get('NativeSampleModule'): ?Spec); diff --git a/packages/react-native-test-library/src/SampleNativeComponent.js b/packages/react-native-test-library/src/SampleNativeComponent.js deleted file mode 100644 index 854db39f005a..000000000000 --- a/packages/react-native-test-library/src/SampleNativeComponent.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -import type {HostComponent} from 'react-native'; -import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes'; -import type { - BubblingEventHandler, - Double, - Float, - Int32, -} from 'react-native/Libraries/Types/CodegenTypes'; - -import * as React from 'react'; -import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; - -type Event = $ReadOnly<{ - values: $ReadOnlyArray, - boolValues: $ReadOnlyArray, - floats: $ReadOnlyArray, - doubles: $ReadOnlyArray, - yesNos: $ReadOnlyArray<'yep' | 'nope'>, - strings: $ReadOnlyArray, - latLons: $ReadOnlyArray<{lat: Double, lon: Double}>, - multiArrays: $ReadOnlyArray<$ReadOnlyArray>, -}>; - -type NativeProps = $ReadOnly<{ - ...ViewProps, - opacity?: Float, - values: $ReadOnlyArray, - - // Events - onIntArrayChanged?: ?BubblingEventHandler, -}>; - -export type NativeComponentType = HostComponent; - -interface NativeCommands { - +changeBackgroundColor: ( - viewRef: React.ElementRef, - color: string, - ) => void; -} - -export const Commands: NativeCommands = codegenNativeCommands({ - supportedCommands: ['changeBackgroundColor'], -}); - -export default (codegenNativeComponent( - 'SampleNativeComponent', -): NativeComponentType); diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index e35ee5883ad7..dae3a107f6bb 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -54,7 +54,6 @@ def pods(target_name, options = {}) pod 'ScreenshotManager', :path => "NativeModuleExample" pod 'MyNativeView', :path => "NativeComponentExample" pod 'NativeCxxModuleExample', :path => "NativeCxxModuleExample" - pod 'OSSLibraryExample', :path => '../react-native-test-library' end target 'RNTester' do diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 2a568e1874e6..43235e7bc091 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -16,7 +16,7 @@ PODS: - hermes-engine/inspector (1000.0.0) - hermes-engine/inspector_chrome (1000.0.0) - hermes-engine/Public (1000.0.0) - - MyNativeView (0.80.0-main): + - MyNativeView (0.81.0-main): - boost - DoubleConversion - fast_float @@ -44,7 +44,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - NativeCxxModuleExample (0.80.0-main): + - NativeCxxModuleExample (0.81.0-main): - boost - DoubleConversion - fast_float @@ -73,34 +73,6 @@ PODS: - SocketRocket - Yoga - OCMock (3.9.4) - - OSSLibraryExample (0.80.0-main): - - boost - - DoubleConversion - - fast_float - - fmt - - glog - - hermes-engine - - RCT-Folly - - RCT-Folly/Fabric - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-jsi - - React-NativeModulesApple - - React-RCTFabric - - React-renderercss - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - SocketRocket - - Yoga - RCT-Folly (2024.11.18.00): - boost - DoubleConversion @@ -584,6 +556,7 @@ PODS: - RCT-Folly - RCT-Folly/Fabric - React-Fabric + - React-Fabric/bridging - React-FabricComponents - React-graphics - React-jsi @@ -609,6 +582,7 @@ PODS: - React-debug - React-Fabric/animations (= 1000.0.0) - React-Fabric/attributedstring (= 1000.0.0) + - React-Fabric/bridging (= 1000.0.0) - React-Fabric/componentregistry (= 1000.0.0) - React-Fabric/componentregistrynative (= 1000.0.0) - React-Fabric/components (= 1000.0.0) @@ -684,6 +658,31 @@ PODS: - React-utils - ReactCommon/turbomodule/core - SocketRocket + - React-Fabric/bridging (1000.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-rendererdebug + - React-runtimeexecutor + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket - React-Fabric/componentregistry (1000.0.0): - boost - DoubleConversion @@ -1243,11 +1242,14 @@ PODS: - React-FabricComponents/components/inputaccessory (= 1000.0.0) - React-FabricComponents/components/iostextinput (= 1000.0.0) - React-FabricComponents/components/modal (= 1000.0.0) + - React-FabricComponents/components/rncore (= 1000.0.0) - React-FabricComponents/components/safeareaview (= 1000.0.0) - React-FabricComponents/components/scrollview (= 1000.0.0) - React-FabricComponents/components/text (= 1000.0.0) - React-FabricComponents/components/textinput (= 1000.0.0) - React-FabricComponents/components/unimplementedview (= 1000.0.0) + - React-FabricComponents/components/virtualview (= 1000.0.0) + - React-FabricComponents/components/virtualviewexperimental (= 1000.0.0) - React-featureflags - React-graphics - React-jsi @@ -1341,6 +1343,33 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga + - React-FabricComponents/components/rncore (1000.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga - React-FabricComponents/components/safeareaview (1000.0.0): - boost - DoubleConversion @@ -1476,6 +1505,60 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga + - React-FabricComponents/components/virtualview (1000.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - React-FabricComponents/components/virtualviewexperimental (1000.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-cxxreact + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-jsi + - React-jsiexecutor + - React-logger + - React-RCTFBReactNativeSpec + - React-rendererdebug + - React-runtimescheduler + - React-utils + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga - React-FabricComponents/textlayoutmanager (1000.0.0): - boost - DoubleConversion @@ -2122,7 +2205,18 @@ PODS: - React-utils - SocketRocket - React-runtimeexecutor (1000.0.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - RCT-Folly + - RCT-Folly/Fabric + - React-debug + - React-featureflags - React-jsi (= 1000.0.0) + - React-utils + - SocketRocket - React-RuntimeHermes (1000.0.0): - boost - DoubleConversion @@ -2283,7 +2377,7 @@ PODS: - React-perflogger (= 1000.0.0) - React-utils (= 1000.0.0) - SocketRocket - - ScreenshotManager (0.80.0-main): + - ScreenshotManager (0.81.0-main): - boost - DoubleConversion - fast_float @@ -2325,7 +2419,6 @@ DEPENDENCIES: - MyNativeView (from `NativeComponentExample`) - NativeCxxModuleExample (from `NativeCxxModuleExample`) - OCMock (~> 3.9.1) - - OSSLibraryExample (from `../react-native-test-library`) - RCT-Folly (from `../react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTDeprecation (from `../react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`) - RCTRequired (from `../react-native/Libraries/Required`) @@ -2422,8 +2515,6 @@ EXTERNAL SOURCES: :path: NativeComponentExample NativeCxxModuleExample: :path: NativeCxxModuleExample - OSSLibraryExample: - :path: "../react-native-test-library" RCT-Folly: :podspec: "../react-native/third-party-podspecs/RCT-Folly.podspec" RCTDeprecation: @@ -2565,84 +2656,83 @@ SPEC CHECKSUMS: boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 - FBLazyVector: d3c2dd739a63c1a124e775df075dc7c517a719cb + FBLazyVector: a67ac982f94e725e28eb5fdf00ae785a88fee122 fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 - hermes-engine: fd5605ca4043c8317548d649d0b64e5dafc2a124 - MyNativeView: 9b03b64f5cd9220bf7ef49fcdfc468effe704fa0 - NativeCxxModuleExample: 2897d5f3aee8a02dd201a3dd41fbc94ada1aac5e + hermes-engine: 3350cd88070588a0c3ebf47ea6f81ba28c7aaf9f + MyNativeView: f9ac5b43a4d23e7d40f2e7c4337b40fc98f645cc + NativeCxxModuleExample: 9abb81d71be6898827e6c0bb65b1715f6f3b75a2 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 - OSSLibraryExample: bf5b5a4238613dae3c536faff58f87528e6191cf - RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669 + RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f RCTDeprecation: 3808e36294137f9ee5668f4df2e73dc079cd1dcf - RCTRequired: a00614e2da5344c2cda3d287050b6cee00e21dc6 - RCTTypeSafety: 459a16418c6b413060d35434ba3e83f5b0bd2651 - React: 170a01a19ba2525ab7f11243e2df6b19bf268093 - React-callinvoker: f08f425e4043cd1998a158b6e39a6aed1fd1d718 - React-Core: d35c5cf69898fd026e5cd93a0454b1d42e999d3e - React-CoreModules: 3ce1d43f6cc37f43759ec543ce1c0010080f1de1 - React-cxxreact: 3169b106af8f405e182d131d3a0844201e3252e2 - React-debug: 195df38487d3f48a7af04deddeb4a5c6d4440416 - React-defaultsnativemodule: 8afea5a4bd07addb523bf48489b8a684ea1bdff0 - React-domnativemodule: 8a813559774e65bc800fe489bbb454cd546f21d7 - React-Fabric: e9846203f11ab49be8b1329c76301bbd399ef2ad - React-FabricComponents: 032d6f01f1d6966633418c0fece18f698ddb7897 - React-FabricImage: 264c9ce5241e43e25b94c8de55ac6c3c8a046472 - React-featureflags: 595651ea13c63a9f77f06d9a1973b665b4a28b7e - React-featureflagsnativemodule: 06823479a2ee210cfa0e9c19447c2722a8d995f2 - React-graphics: 1f99b9b5515eac389f0cf9c85b03abc366d6a933 - React-hermes: 745eb45a6d0aae7e890d0aae0def54670bbd103c - React-idlecallbacksnativemodule: 4e65f183318b8a0fbabc481a4eafc0f0d62d1cbf - React-ImageManager: a6833445e17879933378b7c0ba45ee42115c14bc - React-jserrorhandler: bec134a192c50338193544404d45df24fb8a19ca - React-jsi: 4ad77650fb0ca4229569eb2532db7a87e3d12662 - React-jsiexecutor: fa5b80bdbe1ceffc33a892da20fc07b4dfa4df7a - React-jsinspector: 10b5dc4eef2a3d05b80be2114ed676496c5bf59c - React-jsinspectorcdp: 5fb266e5f23d3a2819ba848e9d4d0b6b00f95934 - React-jsinspectornetwork: 1655a81f3fe14789df41e063bd56dd130cc3562a - React-jsinspectortracing: 5b0be488e06958a572e1badfe8509929ae1cc83b - React-jsitooling: 9e563b89f94cf4baf872fe47105d60ae83f4ce4d - React-jsitracing: ce443686f52538d1033ce7db1e7d643e866262f0 - React-logger: 116c3ae5a9906671d157aa00882a5ee75a5a7ebc - React-Mapbuffer: fc937cfa41140d7724c559c3d16c50dd725361c8 - React-microtasksnativemodule: 09899c7389250279bdcc5384f0281bb069979855 - React-NativeModulesApple: d05b718ccd8b68c184e76dbc1efb63385197595b - React-oscompat: 7133e0e945cda067ae36b22502df663d73002864 - React-perflogger: ada3cdf3dfc8b7cd1fabe3c91b672e23981611ab - React-performancetimeline: e7d5849d89ee39557dcd56dfb6e7b0d49003d925 - React-RCTActionSheet: 1bf8cc8086ad1c15da3407dfb7bc9dd94dc7595d - React-RCTAnimation: 263593e66c89bf810604b1ace15dfa382a1ca2df - React-RCTAppDelegate: 3a99437ffa7460f85045de65f9bed6b1c47d5f09 - React-RCTBlob: 7b76230c53fe87d305eeeb250b0aae031bb6cbae - React-RCTFabric: 2fd2ef899c7219fd39fd61c39750510f88a81434 - React-RCTFBReactNativeSpec: 4ed3b463eb26726b04ac65c73797207ecab5634c - React-RCTImage: de404b6b0ebe53976a97e3a0dee819c83e12977b - React-RCTLinking: 06742cfad41c506091403a414370743a4ed75af3 - React-RCTNetwork: b4577eec0092c16d8996e415e4cac7a372d6d362 - React-RCTPushNotification: ea11178d499696516e0ff9ae335edbe99b06f94b - React-RCTRuntime: 925039e78fc530e0421c308ccc607f214f3c7be1 - React-RCTSettings: d3c2dd305ec81f7faf42762ec598d57f07fd43be - React-RCTTest: 2db46eda60bc2228cb67622a580e8e86b00088d9 - React-RCTText: e416825b80c530647040ef91d23ffd35ccc87981 - React-RCTVibration: 1837a27fc16eeffc9509779c3334fde54c012bcc - React-rendererconsistency: 777c894edc43dde01499189917ac54ee76ae6a6a - React-renderercss: a9cb6ba7f49a80dc4b4f7008bae1590d12f27049 - React-rendererdebug: fea8bde927403a198742b2d940a5f1cd8230c0b4 - React-RuntimeApple: 6a0c164a8855edb4987b90da2d4d8601302de72d - React-RuntimeCore: 6dec37113b759b76641bd028bfbbbec8cf923356 - React-runtimeexecutor: a16a24b964e964afe833a652d703e1bb39f10dc9 - React-RuntimeHermes: d4f661204d3061219a63951eb4efed4dcaf3f12f - React-runtimescheduler: ae44fe8b4170a9d59f62e8b7d7b060c179db739d - React-timing: 9d49179631e5e3c759e6e82d4c613c73da80a144 - React-utils: 0944df8d553d66b27f486282c42a84a969fd2f6c - ReactAppDependencyProvider: 68f2d2cefd6c9b9f2865246be2bfe86ebd49238d - ReactCodegen: 8fc4c8b6562a59409b5650e67f78719093d093bf - ReactCommon: a53973ab35d399560ace331ec9e2b26db0592cec - ReactCommon-Samples: dcc128cbf51ac38d2578791750d0a046d1b8a5e9 - ScreenshotManager: 6ac0b11c7bbd5cf1abd9448fb3b856fe6fd65ff7 + RCTRequired: 2122b76857162ff9aa7e211de2575089ffe611d6 + RCTTypeSafety: cda30ca2aadf5786d66ba137b5c06d2190e697e9 + React: 662099b139948fd652fa9dc369f2a6aece1e18b2 + React-callinvoker: 49a5a4449dbb4830fdac6341be9027ebf8ffc3bf + React-Core: 7e0f44e57d0dc4a814c1be194e8667ca6ee052b7 + React-CoreModules: a82c6f0d605188a1261b020b4c43cd5c39a9e57f + React-cxxreact: bec05af5ce328afa9428fafa6d33730400e4b68c + React-debug: 40cbf9f72c96613c639f12f7fcc9a6cb8d54f588 + React-defaultsnativemodule: 68c0affa6e5c4de5db8352aac0ff53eeace95035 + React-domnativemodule: b9dc5b7141dbfb65e53039aa708f342c24ca2d30 + React-Fabric: 15cced8cd4c50826215448b633362106dcfb98d4 + React-FabricComponents: f6ef214976c812eb2bb59f8e9d10f4ada46ffe12 + React-FabricImage: 32b54b2b17d61df7b22a0ff8b78b57de1245a588 + React-featureflags: d2a5f1ee99706701567ad6ffacfefe54bf839813 + React-featureflagsnativemodule: 722fa94f9d7ac24632df7d178b845c77ac794d36 + React-graphics: aae15c16655f51e02f4ba211f108bb591d02f82a + React-hermes: afd04a013d8e73fcea46019a38724097d410c53c + React-idlecallbacksnativemodule: fdb1f69e1725303cd2fb302c6c104b117871dabc + React-ImageManager: c2119408bc90c98b037eb418855eac8484b79987 + React-jserrorhandler: 710e7a368c42914e44a9065ad0f878286511c181 + React-jsi: 6b6955a311c687ce2560fac466ed7ea6ae1ba851 + React-jsiexecutor: a1837ded1bd224b94d57e36ee72bd26299cb0624 + React-jsinspector: 99852440c65d84257ed9bb1a9f6a943ab3b2dc53 + React-jsinspectorcdp: 51b7b9e98f69a5f43a200286e0f1809b8be2e7d6 + React-jsinspectornetwork: 31c2d9f486c87f670ae8d76c5eee606995e9a994 + React-jsinspectortracing: af188edab74f98d132a4170013a4073f13e02323 + React-jsitooling: c16793498697b5bf00b2b5245529f5ad1bd7dc03 + React-jsitracing: 1e5621e281f794777dd6933960b63b4001ff6688 + React-logger: 6be7039c28299972c00f0b326591085037f2224b + React-Mapbuffer: c7da77a5d048ec7d7e1e050b3f946551241a768c + React-microtasksnativemodule: 394af907fa98cc28f993ed949975c6f4d3d53f5f + React-NativeModulesApple: 15bfbf94f0a1286ee7bf4fe0b0d3e8a04a9a3f26 + React-oscompat: 496762720e2a4dd97786fa08f788e3f8763404ea + React-perflogger: 64a1b6eac6ff95474c02c3ee1734c8752a7a1da8 + React-performancetimeline: 5bfcaa23bc90980d8cc4f0d4dd92e08fbdd10638 + React-RCTActionSheet: fda681f38788c81040b6e0aebd7050580d5fd74d + React-RCTAnimation: 983a1257c6ca45998848a2129d1ea9ada70824a6 + React-RCTAppDelegate: 15a4c95028249abb71d2769b9d5ec158ce81a9f8 + React-RCTBlob: 8986952d547b4c81e2827f7dfa9d8457b36c673b + React-RCTFabric: 511cc7ff0f99c790330855d20ce7e7a7d28f548a + React-RCTFBReactNativeSpec: b4a3bfa2a45af3dcdba1cd13285a7b5c7da29b21 + React-RCTImage: e4fa15c647802b7ed6c7e405d40db829e2146d02 + React-RCTLinking: dc1cc3b29036a58f7c828d1ca0a6b24ea7801a97 + React-RCTNetwork: dffe5f8de5ea63ba22baace02df4b84438e09986 + React-RCTPushNotification: 4d8081e9d2c636469b7098e137ff39d141643a18 + React-RCTRuntime: 0abb761a26d449eacfdd47f378ae365b830076c8 + React-RCTSettings: 9ba77f0aebce1bf71582ee8845db723b264039f6 + React-RCTTest: 09f99c5f8b2e5e00b9fa6b796ae81fd162843b2d + React-RCTText: 58b4e7484e6ce4903e5a9333c9fb744b84b16a05 + React-RCTVibration: b65dc9f78e1c5d482599205e4a52ec33815c7a1c + React-rendererconsistency: 0d60f7275a5f39b37c3753d548e72186562c3a48 + React-renderercss: 88f92ff8dc85711a2ff861f815876cf8e312fe49 + React-rendererdebug: fa30da9cdff3556e43a29c5fd5468faee8615850 + React-RuntimeApple: 415a26184ba8fc6cf372f39d351665b73f0ceeaf + React-RuntimeCore: a875f3c5479b1fc07ca3ae0c0797c623baf6516e + React-runtimeexecutor: 344502ff6d944ae095379ee587cea61720812751 + React-RuntimeHermes: 8e0734f0dd51840d957bc2f5216ea84a599dad03 + React-runtimescheduler: e3d95a3e38dd7c30b1faffdd808cf915fec0c991 + React-timing: 1c3682ededd5ab4158b7f065404b9c493d1f97f9 + React-utils: 99cab5ff9f585e8f6d57d97f35d2d38e1d51b4b7 + ReactAppDependencyProvider: b3db1f6073cd2d5085705f812a6eef258aa9a9d7 + ReactCodegen: 17ffed80c08ee934120f5962a19c8cdae62615f9 + ReactCommon: 8135b5504e1ddab9348bb09a7e6c829eb1b21bc6 + ReactCommon-Samples: 0fc23e4c63e23897cc41f2f6867f5358e7e60806 + ScreenshotManager: 3b0059e34e3ac8ec152874e4ac9b7a304216ecca SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 - Yoga: c4e80f1c2235fa6236d71a49e5bb2ee74d987921 + Yoga: d4ae2f851e524b23cb324409594f60bc3f091403 -PODFILE CHECKSUM: 8591f96a513620a2a83a0b9a125ad3fa32ea1369 +PODFILE CHECKSUM: 995beda3236c2c76801e7a4efc7fedcd390220e6 COCOAPODS: 1.15.2 diff --git a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt index 05ca30df409d..d3bf047cced8 100644 --- a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt +++ b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt @@ -26,7 +26,6 @@ import com.facebook.react.defaults.DefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.module.model.ReactModuleInfo import com.facebook.react.module.model.ReactModuleInfoProvider -import com.facebook.react.osslibraryexample.OSSLibraryExamplePackage import com.facebook.react.popupmenu.PopupMenuPackage import com.facebook.react.shell.MainReactPackage import com.facebook.react.soloader.OpenSourceMergedSoMapping @@ -54,7 +53,6 @@ internal class RNTesterApplication : Application(), ReactApplication { return listOf( MainReactPackage(), PopupMenuPackage(), - OSSLibraryExamplePackage(), object : BaseReactPackage() { override fun getModule( name: String, diff --git a/packages/rn-tester/js/examples/OSSLibraryExample/OSSLibraryExample.js b/packages/rn-tester/js/examples/OSSLibraryExample/OSSLibraryExample.js deleted file mode 100644 index c7217a33c663..000000000000 --- a/packages/rn-tester/js/examples/OSSLibraryExample/OSSLibraryExample.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -'use strict'; - -import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; -import type {NativeComponentType} from '@react-native/oss-library-example'; - -import RNTesterText from '../../components/RNTesterText'; -import { - SampleNativeComponent, - SampleNativeComponentCommands, -} from '@react-native/oss-library-example'; -import {NativeSampleModule} from '@react-native/oss-library-example'; -import * as React from 'react'; -import {useRef, useState} from 'react'; -import {Button, View} from 'react-native'; -import {StyleSheet} from 'react-native'; - -const colors = [ - '#0000FF', - '#FF0000', - '#00FF00', - '#003300', - '#330000', - '#000033', -]; - -// $FlowFixMe[value-as-type] -const styles: StyleSheet = StyleSheet.create({ - container: { - flex: 1, - }, - column: { - flex: 2, - justifyContent: 'center', - paddingLeft: 5, - paddingRight: 5, - }, -}); - -function SampleNativeComponentContainer(props: {}): React.Node { - const ref = useRef | null>(null); - const [opacity, setOpacity] = useState(1.0); - const [arrayValues, setArrayValues] = useState([1, 2, 3]); - return ( - - { - console.log(event.nativeEvent.values); - console.log(event.nativeEvent.boolValues); - console.log(event.nativeEvent.floats); - console.log(event.nativeEvent.doubles); - console.log(event.nativeEvent.yesNos); - console.log(event.nativeEvent.strings); - console.log(event.nativeEvent.latLons); - console.log(event.nativeEvent.multiArrays); - }} - /> -