getTurboModule(
27 | const std::string name,
28 | const JavaTurboModule::InitParams ¶ms) override;
29 |
30 | /**
31 | * Test-only method. Allows user to verify whether a TurboModule can be
32 | * created by instances of this class.
33 | */
34 | bool canCreateTurboModule(std::string name);
35 | };
36 |
37 | } // namespace react
38 | } // namespace facebook
39 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalflatlist/newarchitecture/components/MainComponentsRegistry.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalflatlist.newarchitecture.components;
2 |
3 | import com.facebook.jni.HybridData;
4 | import com.facebook.proguard.annotations.DoNotStrip;
5 | import com.facebook.react.fabric.ComponentFactory;
6 | import com.facebook.soloader.SoLoader;
7 |
8 | /**
9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a
10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/
11 | * folder for you).
12 | *
13 | * Please note that this class is used ONLY if you opt-in for the New Architecture (see the
14 | * `newArchEnabled` property). Is ignored otherwise.
15 | */
16 | @DoNotStrip
17 | public class MainComponentsRegistry {
18 | static {
19 | SoLoader.loadLibrary("fabricjni");
20 | }
21 |
22 | @DoNotStrip private final HybridData mHybridData;
23 |
24 | @DoNotStrip
25 | private native HybridData initHybrid(ComponentFactory componentFactory);
26 |
27 | @DoNotStrip
28 | private MainComponentsRegistry(ComponentFactory componentFactory) {
29 | mHybridData = initHybrid(componentFactory);
30 | }
31 |
32 | @DoNotStrip
33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) {
34 | return new MainComponentsRegistry(componentFactory);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalflatlist/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalflatlist;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import com.facebook.react.ReactActivityDelegate;
5 | import com.facebook.react.ReactRootView;
6 |
7 | public class MainActivity extends ReactActivity {
8 |
9 | /**
10 | * Returns the name of the main component registered from JavaScript. This is used to schedule
11 | * rendering of the component.
12 | */
13 | @Override
14 | protected String getMainComponentName() {
15 | return "main";
16 | }
17 |
18 | /**
19 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
20 | * you can specify the rendered you wish to use (Fabric or the older renderer).
21 | */
22 | @Override
23 | protected ReactActivityDelegate createReactActivityDelegate() {
24 | return new MainActivityDelegate(this, getMainComponentName());
25 | }
26 |
27 | public static class MainActivityDelegate extends ReactActivityDelegate {
28 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
29 | super(activity, mainComponentName);
30 | }
31 |
32 | @Override
33 | protected ReactRootView createRootView() {
34 | ReactRootView reactRootView = new ReactRootView(getContext());
35 | // If you opted-in for the New Architecture, we enable the Fabric Renderer.
36 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
37 | return reactRootView;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp:
--------------------------------------------------------------------------------
1 | #include "MainApplicationTurboModuleManagerDelegate.h"
2 | #include "MainApplicationModuleProvider.h"
3 |
4 | namespace facebook {
5 | namespace react {
6 |
7 | jni::local_ref
8 | MainApplicationTurboModuleManagerDelegate::initHybrid(
9 | jni::alias_ref) {
10 | return makeCxxInstance();
11 | }
12 |
13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() {
14 | registerHybrid({
15 | makeNativeMethod(
16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
17 | makeNativeMethod(
18 | "canCreateTurboModule",
19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
20 | });
21 | }
22 |
23 | std::shared_ptr
24 | MainApplicationTurboModuleManagerDelegate::getTurboModule(
25 | const std::string name,
26 | const std::shared_ptr jsInvoker) {
27 | // Not implemented yet: provide pure-C++ NativeModules here.
28 | return nullptr;
29 | }
30 |
31 | std::shared_ptr
32 | MainApplicationTurboModuleManagerDelegate::getTurboModule(
33 | const std::string name,
34 | const JavaTurboModule::InitParams ¶ms) {
35 | return MainApplicationModuleProvider(name, params);
36 | }
37 |
38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
39 | std::string name) {
40 | return getTurboModule(name, nullptr) != nullptr ||
41 | getTurboModule(name, {.moduleName = name}) != nullptr;
42 | }
43 |
44 | } // namespace react
45 | } // namespace facebook
46 |
--------------------------------------------------------------------------------
/example/android/app/src/main/jni/Android.mk:
--------------------------------------------------------------------------------
1 | THIS_DIR := $(call my-dir)
2 |
3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
4 |
5 | # If you wish to add a custom TurboModule or Fabric component in your app you
6 | # will have to include the following autogenerated makefile.
7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
8 | include $(CLEAR_VARS)
9 |
10 | LOCAL_PATH := $(THIS_DIR)
11 |
12 | # You can customize the name of your application .so file here.
13 | LOCAL_MODULE := example_appmodules
14 |
15 | LOCAL_C_INCLUDES := $(LOCAL_PATH)
16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
18 |
19 | # If you wish to add a custom TurboModule or Fabric component in your app you
20 | # will have to uncomment those lines to include the generated source
21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
22 | #
23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
26 |
27 | # Here you should add any native library you wish to depend on.
28 | LOCAL_SHARED_LIBRARIES := \
29 | libfabricjni \
30 | libfbjni \
31 | libfolly_futures \
32 | libfolly_json \
33 | libglog \
34 | libjsi \
35 | libreact_codegen_rncore \
36 | libreact_debug \
37 | libreact_nativemodule_core \
38 | libreact_render_componentregistry \
39 | libreact_render_core \
40 | libreact_render_debug \
41 | libreact_render_graphics \
42 | librrc_view \
43 | libruntimeexecutor \
44 | libturbomodulejsijni \
45 | libyoga
46 |
47 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall
48 |
49 | include $(BUILD_SHARED_LIBRARY)
50 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalFlatlistExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSExceptionDomains
30 |
31 | localhost
32 |
33 | NSExceptionAllowsInsecureHTTPLoads
34 |
35 |
36 |
37 |
38 | NSLocationWhenInUseUsageDescription
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UIViewControllerBasedStatusBarAppearance
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 | # Automatically convert third-party libraries to use AndroidX
25 | android.enableJetifier=true
26 |
27 | # Version of flipper SDK to use with React Native
28 | FLIPPER_VERSION=0.125.0
29 |
30 | # Use this property to specify which architecture you want to build.
31 | # You can also override it from the CLI using
32 | # ./gradlew -PreactNativeArchitectures=x86_64
33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
34 |
35 | # Use this property to enable support to the new architecture.
36 | # This will allow you to use TurboModules and the Fabric render in
37 | # your application. You should enable this flag either if you want
38 | # to write custom TurboModules/Fabric components OR use libraries that
39 | # are providing them.
40 | newArchEnabled=false
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | import org.apache.tools.ant.taskdefs.condition.Os
2 |
3 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
4 |
5 | buildscript {
6 | ext {
7 | buildToolsVersion = "31.0.0"
8 | minSdkVersion = 21
9 | compileSdkVersion = 31
10 | targetSdkVersion = 31
11 |
12 | if (System.properties['os.arch'] == "aarch64") {
13 | // For M1 Users we need to use the NDK 24 which added support for aarch64
14 | ndkVersion = "24.0.8215888"
15 | } else {
16 | // Otherwise we default to the side-by-side NDK version from AGP.
17 | ndkVersion = "21.4.7075529"
18 | }
19 | }
20 | repositories {
21 | google()
22 | mavenCentral()
23 | }
24 | dependencies {
25 | classpath("com.android.tools.build:gradle:7.0.4")
26 | classpath("com.facebook.react:react-native-gradle-plugin")
27 | classpath("de.undercouch:gradle-download-task:4.1.2")
28 | // NOTE: Do not place your application dependencies here; they belong
29 | // in the individual module build.gradle files
30 | }
31 | }
32 |
33 | allprojects {
34 | repositories {
35 | maven {
36 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
37 | url("$rootDir/../node_modules/react-native/android")
38 | }
39 | maven {
40 | // Android JSC is installed from npm
41 | url("$rootDir/../node_modules/jsc-android/dist")
42 | }
43 | mavenCentral {
44 | // We don't want to fetch react-native from Maven Central as there are
45 | // older versions over there.
46 | content {
47 | excludeGroup "com.facebook.react"
48 | }
49 | }
50 | google()
51 | maven { url 'https://www.jitpack.io' }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
23 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalflatlist/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalflatlist.newarchitecture.modules;
2 |
3 | import com.facebook.jni.HybridData;
4 | import com.facebook.react.ReactPackage;
5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.soloader.SoLoader;
8 | import java.util.List;
9 |
10 | /**
11 | * Class responsible to load the TurboModules. This class has native methods and needs a
12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/
13 | * folder for you).
14 | *
15 | * Please note that this class is used ONLY if you opt-in for the New Architecture (see the
16 | * `newArchEnabled` property). Is ignored otherwise.
17 | */
18 | public class MainApplicationTurboModuleManagerDelegate
19 | extends ReactPackageTurboModuleManagerDelegate {
20 |
21 | private static volatile boolean sIsSoLibraryLoaded;
22 |
23 | protected MainApplicationTurboModuleManagerDelegate(
24 | ReactApplicationContext reactApplicationContext, List packages) {
25 | super(reactApplicationContext, packages);
26 | }
27 |
28 | protected native HybridData initHybrid();
29 |
30 | native boolean canCreateTurboModule(String moduleName);
31 |
32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
33 | protected MainApplicationTurboModuleManagerDelegate build(
34 | ReactApplicationContext context, List packages) {
35 | return new MainApplicationTurboModuleManagerDelegate(context, packages);
36 | }
37 | }
38 |
39 | @Override
40 | protected synchronized void maybeLoadOtherSoLibraries() {
41 | if (!sIsSoLibraryLoaded) {
42 | // If you change the name of your application .so file in the Android.mk file,
43 | // make sure you update the name here as well.
44 | SoLoader.loadLibrary("example_appmodules");
45 | sIsSoLibraryLoaded = true;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/example/android/app/src/main/jni/MainComponentsRegistry.cpp:
--------------------------------------------------------------------------------
1 | #include "MainComponentsRegistry.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | namespace facebook {
9 | namespace react {
10 |
11 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}
12 |
13 | std::shared_ptr
14 | MainComponentsRegistry::sharedProviderRegistry() {
15 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
16 |
17 | // Custom Fabric Components go here. You can register custom
18 | // components coming from your App or from 3rd party libraries here.
19 | //
20 | // providerRegistry->add(concreteComponentDescriptorProvider<
21 | // AocViewerComponentDescriptor>());
22 | return providerRegistry;
23 | }
24 |
25 | jni::local_ref
26 | MainComponentsRegistry::initHybrid(
27 | jni::alias_ref,
28 | ComponentFactory *delegate) {
29 | auto instance = makeCxxInstance(delegate);
30 |
31 | auto buildRegistryFunction =
32 | [](EventDispatcher::Weak const &eventDispatcher,
33 | ContextContainer::Shared const &contextContainer)
34 | -> ComponentDescriptorRegistry::Shared {
35 | auto registry = MainComponentsRegistry::sharedProviderRegistry()
36 | ->createComponentDescriptorRegistry(
37 | {eventDispatcher, contextContainer});
38 |
39 | auto mutableRegistry =
40 | std::const_pointer_cast(registry);
41 |
42 | mutableRegistry->setFallbackComponentDescriptor(
43 | std::make_shared(
44 | ComponentDescriptorParameters{
45 | eventDispatcher, contextContainer, nullptr}));
46 |
47 | return registry;
48 | };
49 |
50 | delegate->buildRegistryFunction = buildRegistryFunction;
51 | return instance;
52 | }
53 |
54 | void MainComponentsRegistry::registerNatives() {
55 | registerHybrid({
56 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
57 | });
58 | }
59 |
60 | } // namespace react
61 | } // namespace facebook
62 |
--------------------------------------------------------------------------------
/src/FlatList.tsx:
--------------------------------------------------------------------------------
1 | import React, { forwardRef, MutableRefObject, useCallback, useRef, useState } from 'react';
2 | import { FlatList as FlatListRN, LayoutChangeEvent, Platform, ScrollViewProps, StyleSheet, View } from 'react-native';
3 | import { ScrollView } from './ScrollView';
4 | import { usePrerenderedData } from './hooks/usePrerenderedData';
5 | import type { BidirectionalFlatListProps, FlatListType } from './types';
6 | import { MIN_INDEX } from './config';
7 |
8 | const maintainVisibleContentPosition = { minIndexForVisible: MIN_INDEX };
9 |
10 | const FlatListImpl = forwardRef((props, ref) => {
11 | const renderScrollComponent = useCallback((props: ScrollViewProps) => {
12 | return ;
13 | }, []);
14 |
15 | const capturedRef = useRef();
16 | const captureRef = useCallback((r: any) => {
17 | const obj = r ? Object.assign(r, {
18 | shift: (options: {height: number; offset: number}) => {
19 | if(Platform.OS !== 'android') {
20 | return;
21 | }
22 | r.getNativeScrollRef().shift(options);
23 | },
24 | }) : r;
25 | capturedRef.current = obj;
26 | if(!ref) {
27 | return;
28 | }
29 | if(typeof ref === 'function') {
30 | ref(obj);
31 | } else {
32 | (ref as MutableRefObject).current = obj;
33 | }
34 | }, [ref]);
35 |
36 | // todo add hack to prevent flickering
37 | const {
38 | data = [],
39 | keyExtractor = (item: any) => item.id ?? item.key,
40 | renderItem,
41 | onUpdateData,
42 | getItemLayout,
43 | onLayout,
44 | } = props;
45 | const {finalData, prerender, getItemLayoutCustom} = usePrerenderedData({
46 | data: data ?? [],
47 | keyExtractor,
48 | renderItem,
49 | scrollRef: capturedRef as MutableRefObject,
50 | onUpdateData,
51 | getItemLayout,
52 | });
53 |
54 | const [width, setWidth] = useState();
55 | const onLayoutFlatList = useCallback((e: LayoutChangeEvent) => {
56 | onLayout?.(e);
57 | setWidth(e.nativeEvent.layout.width);
58 | }, [onLayout]);
59 |
60 | return <>
61 |
69 | {prerender && !!width &&
70 | {prerender}
71 | }
72 | >
73 | })
74 |
75 | const styles = StyleSheet.create({
76 | prerender: {
77 | position: 'absolute',
78 | top: 0,
79 | left: -10000,
80 | }
81 | });
82 |
83 | export const FlatList = FlatListImpl as unknown as FlatListType
84 |
--------------------------------------------------------------------------------
/example/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.5)
5 | rexml
6 | activesupport (6.1.5.1)
7 | concurrent-ruby (~> 1.0, >= 1.0.2)
8 | i18n (>= 1.6, < 2)
9 | minitest (>= 5.1)
10 | tzinfo (~> 2.0)
11 | zeitwerk (~> 2.3)
12 | addressable (2.8.0)
13 | public_suffix (>= 2.0.2, < 5.0)
14 | algoliasearch (1.27.5)
15 | httpclient (~> 2.8, >= 2.8.3)
16 | json (>= 1.5.1)
17 | atomos (0.1.3)
18 | claide (1.1.0)
19 | cocoapods (1.11.3)
20 | addressable (~> 2.8)
21 | claide (>= 1.0.2, < 2.0)
22 | cocoapods-core (= 1.11.3)
23 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
24 | cocoapods-downloader (>= 1.4.0, < 2.0)
25 | cocoapods-plugins (>= 1.0.0, < 2.0)
26 | cocoapods-search (>= 1.0.0, < 2.0)
27 | cocoapods-trunk (>= 1.4.0, < 2.0)
28 | cocoapods-try (>= 1.1.0, < 2.0)
29 | colored2 (~> 3.1)
30 | escape (~> 0.0.4)
31 | fourflusher (>= 2.3.0, < 3.0)
32 | gh_inspector (~> 1.0)
33 | molinillo (~> 0.8.0)
34 | nap (~> 1.0)
35 | ruby-macho (>= 1.0, < 3.0)
36 | xcodeproj (>= 1.21.0, < 2.0)
37 | cocoapods-core (1.11.3)
38 | activesupport (>= 5.0, < 7)
39 | addressable (~> 2.8)
40 | algoliasearch (~> 1.0)
41 | concurrent-ruby (~> 1.1)
42 | fuzzy_match (~> 2.0.4)
43 | nap (~> 1.0)
44 | netrc (~> 0.11)
45 | public_suffix (~> 4.0)
46 | typhoeus (~> 1.0)
47 | cocoapods-deintegrate (1.0.5)
48 | cocoapods-downloader (1.6.3)
49 | cocoapods-plugins (1.0.0)
50 | nap
51 | cocoapods-search (1.0.1)
52 | cocoapods-trunk (1.6.0)
53 | nap (>= 0.8, < 2.0)
54 | netrc (~> 0.11)
55 | cocoapods-try (1.2.0)
56 | colored2 (3.1.2)
57 | concurrent-ruby (1.1.10)
58 | escape (0.0.4)
59 | ethon (0.15.0)
60 | ffi (>= 1.15.0)
61 | ffi (1.15.5)
62 | fourflusher (2.3.1)
63 | fuzzy_match (2.0.4)
64 | gh_inspector (1.1.3)
65 | httpclient (2.8.3)
66 | i18n (1.10.0)
67 | concurrent-ruby (~> 1.0)
68 | json (2.6.1)
69 | minitest (5.15.0)
70 | molinillo (0.8.0)
71 | nanaimo (0.3.0)
72 | nap (1.1.0)
73 | netrc (0.11.0)
74 | public_suffix (4.0.7)
75 | rexml (3.2.5)
76 | ruby-macho (2.5.1)
77 | typhoeus (1.4.0)
78 | ethon (>= 0.9.0)
79 | tzinfo (2.0.4)
80 | concurrent-ruby (~> 1.0)
81 | xcodeproj (1.21.0)
82 | CFPropertyList (>= 2.3.3, < 4.0)
83 | atomos (~> 0.1.3)
84 | claide (>= 1.0.2, < 2.0)
85 | colored2 (~> 3.1)
86 | nanaimo (~> 0.3.0)
87 | rexml (~> 3.2.4)
88 | zeitwerk (2.5.4)
89 |
90 | PLATFORMS
91 | ruby
92 |
93 | DEPENDENCIES
94 | cocoapods (~> 1.11, >= 1.11.2)
95 |
96 | RUBY VERSION
97 | ruby 2.7.4p191
98 |
99 | BUNDLED WITH
100 | 2.2.27
101 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalFlatlistExample.xcodeproj/xcshareddata/xcschemes/BidirectionalFlatlistExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
35 |
37 |
43 |
44 |
45 |
46 |
52 |
54 |
60 |
61 |
62 |
63 |
65 |
66 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalflatlist/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalflatlist;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactInstanceManager;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.react.config.ReactFeatureFlags;
11 | import com.facebook.soloader.SoLoader;
12 | import com.example.reactnativebidirectionalflatlist.newarchitecture.MainApplicationReactNativeHost;
13 | import java.lang.reflect.InvocationTargetException;
14 | import java.util.List;
15 |
16 | public class MainApplication extends Application implements ReactApplication {
17 |
18 | private final ReactNativeHost mReactNativeHost =
19 | new ReactNativeHost(this) {
20 | @Override
21 | public boolean getUseDeveloperSupport() {
22 | return BuildConfig.DEBUG;
23 | }
24 |
25 | @Override
26 | protected List getPackages() {
27 | @SuppressWarnings("UnnecessaryLocalVariable")
28 | List packages = new PackageList(this).getPackages();
29 | // Packages that cannot be autolinked yet can be added manually here, for example:
30 | // packages.add(new MyReactNativePackage());
31 | return packages;
32 | }
33 |
34 | @Override
35 | protected String getJSMainModuleName() {
36 | return "index";
37 | }
38 | };
39 |
40 | private final ReactNativeHost mNewArchitectureNativeHost =
41 | new MainApplicationReactNativeHost(this);
42 |
43 | @Override
44 | public ReactNativeHost getReactNativeHost() {
45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
46 | return mNewArchitectureNativeHost;
47 | } else {
48 | return mReactNativeHost;
49 | }
50 | }
51 |
52 | @Override
53 | public void onCreate() {
54 | super.onCreate();
55 | // If you opted-in for the New Architecture, we enable the TurboModule system
56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
57 | SoLoader.init(this, /* native exopackage */ false);
58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
59 | }
60 |
61 | /**
62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like
63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
64 | *
65 | * @param context
66 | * @param reactInstanceManager
67 | */
68 | private static void initializeFlipper(
69 | Context context, ReactInstanceManager reactInstanceManager) {
70 | if (BuildConfig.DEBUG) {
71 | try {
72 | /*
73 | We use reflection here to pick up the class that initializes Flipper,
74 | since Flipper library is not available in release mode
75 | */
76 | Class> aClass = Class.forName("com.example.reactnativebidirectionalflatlist.ReactNativeFlipper");
77 | aClass
78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
79 | .invoke(null, context, reactInstanceManager);
80 | } catch (ClassNotFoundException e) {
81 | e.printStackTrace();
82 | } catch (NoSuchMethodException e) {
83 | e.printStackTrace();
84 | } catch (IllegalAccessException e) {
85 | e.printStackTrace();
86 | } catch (InvocationTargetException e) {
87 | e.printStackTrace();
88 | }
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/example/reactnativebidirectionalflatlist/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example.reactnativebidirectionalflatlist;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceEventListener;
23 | import com.facebook.react.ReactInstanceManager;
24 | import com.facebook.react.bridge.ReactContext;
25 | import com.facebook.react.modules.network.NetworkingModule;
26 | import okhttp3.OkHttpClient;
27 |
28 | public class ReactNativeFlipper {
29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
30 | if (FlipperUtils.shouldEnableFlipper(context)) {
31 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
32 |
33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
34 | client.addPlugin(new ReactFlipperPlugin());
35 | client.addPlugin(new DatabasesFlipperPlugin(context));
36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
37 | client.addPlugin(CrashReporterPlugin.getInstance());
38 |
39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
40 | NetworkingModule.setCustomClientBuilder(
41 | new NetworkingModule.CustomClientBuilder() {
42 | @Override
43 | public void apply(OkHttpClient.Builder builder) {
44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
45 | }
46 | });
47 | client.addPlugin(networkFlipperPlugin);
48 | client.start();
49 |
50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
51 | // Hence we run if after all native modules have been initialized
52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
53 | if (reactContext == null) {
54 | reactInstanceManager.addReactInstanceEventListener(
55 | new ReactInstanceEventListener() {
56 | @Override
57 | public void onReactContextInitialized(ReactContext reactContext) {
58 | reactInstanceManager.removeReactInstanceEventListener(this);
59 | reactContext.runOnNativeModulesQueueThread(
60 | new Runnable() {
61 | @Override
62 | public void run() {
63 | client.addPlugin(new FrescoFlipperPlugin());
64 | }
65 | });
66 | }
67 | });
68 | } else {
69 | client.addPlugin(new FrescoFlipperPlugin());
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.3'
9 | }
10 | }
11 |
12 | def isNewArchitectureEnabled() {
13 | return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
14 | }
15 |
16 | apply plugin: 'com.android.library'
17 |
18 | if (isNewArchitectureEnabled()) {
19 | apply plugin: 'com.facebook.react'
20 | }
21 |
22 | def getExtOrDefault(name) {
23 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['BidirectionalFlatlist_' + name]
24 | }
25 |
26 | def getExtOrIntegerDefault(name) {
27 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['BidirectionalFlatlist_' + name]).toInteger()
28 | }
29 |
30 | android {
31 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
32 |
33 | defaultConfig {
34 | minSdkVersion getExtOrIntegerDefault('minSdkVersion')
35 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
36 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
37 | }
38 | buildTypes {
39 | release {
40 | minifyEnabled false
41 | }
42 | }
43 |
44 | lintOptions {
45 | disable 'GradleCompatible'
46 | }
47 |
48 | compileOptions {
49 | sourceCompatibility JavaVersion.VERSION_1_8
50 | targetCompatibility JavaVersion.VERSION_1_8
51 | }
52 | }
53 |
54 | repositories {
55 | mavenCentral()
56 | google()
57 |
58 | def found = false
59 | def defaultDir = null
60 | def androidSourcesName = 'React Native sources'
61 |
62 | if (rootProject.ext.has('reactNativeAndroidRoot')) {
63 | defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
64 | } else {
65 | defaultDir = new File(
66 | projectDir,
67 | '/../../../node_modules/react-native/android'
68 | )
69 | }
70 |
71 | if (defaultDir.exists()) {
72 | maven {
73 | url defaultDir.toString()
74 | name androidSourcesName
75 | }
76 |
77 | logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
78 | found = true
79 | } else {
80 | def parentDir = rootProject.projectDir
81 |
82 | 1.upto(5, {
83 | if (found) return true
84 | parentDir = parentDir.parentFile
85 |
86 | def androidSourcesDir = new File(
87 | parentDir,
88 | 'node_modules/react-native'
89 | )
90 |
91 | def androidPrebuiltBinaryDir = new File(
92 | parentDir,
93 | 'node_modules/react-native/android'
94 | )
95 |
96 | if (androidPrebuiltBinaryDir.exists()) {
97 | maven {
98 | url androidPrebuiltBinaryDir.toString()
99 | name androidSourcesName
100 | }
101 |
102 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
103 | found = true
104 | } else if (androidSourcesDir.exists()) {
105 | maven {
106 | url androidSourcesDir.toString()
107 | name androidSourcesName
108 | }
109 |
110 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
111 | found = true
112 | }
113 | })
114 | }
115 |
116 | if (!found) {
117 | throw new GradleException(
118 | "${project.name}: unable to locate React Native android sources. " +
119 | "Ensure you have you installed React Native as a dependency in your project and try again."
120 | )
121 | }
122 | }
123 |
124 |
125 | dependencies {
126 | //noinspection GradleDynamicVersion
127 | implementation "com.facebook.react:react-native:+"
128 | // From node_modules
129 | }
130 |
131 | if (isNewArchitectureEnabled()) {
132 | react {
133 | jsRootDir = file("../src/")
134 | libraryName = "BidirectionalFlatlist"
135 | codegenJavaPackageName = "com.reactnativebidirectionalflatlist"
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativebidirectionalflatlist/scroll/ScrollView.java:
--------------------------------------------------------------------------------
1 | package com.reactnativebidirectionalflatlist.scroll;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 | import android.view.View;
6 | import android.widget.OverScroller;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.core.view.ViewCompat;
10 |
11 | import com.facebook.common.logging.FLog;
12 | import com.facebook.react.common.ReactConstants;
13 | import com.facebook.react.views.scroll.ReactScrollView;
14 |
15 | import java.lang.reflect.Field;
16 |
17 | public class ScrollView extends ReactScrollView {
18 |
19 | private OverScroller mScroller;
20 | private boolean mTriedToGetScroller;
21 | protected double mShiftHeight = 0;
22 | protected double mShiftOffset = 0;
23 |
24 | public ScrollView(Context context) {
25 | super(context, null);
26 | }
27 |
28 | public void setShiftHeight(double shiftHeight) {
29 | mShiftHeight = shiftHeight;
30 | Log.d("ScrollView", "set shiftHeight " + shiftHeight);
31 | }
32 |
33 | public void setShiftOffset(double shiftOffset) {
34 | mShiftOffset = shiftOffset;
35 | Log.d("ScrollView", "set shiftOffset " + shiftOffset);
36 | }
37 |
38 | @Override
39 | public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
40 | super.onLayoutChange(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom);
41 | int scrollWindowHeight = getHeight() - getPaddingBottom() - getPaddingTop();
42 | if(mShiftHeight != 0 && mShiftOffset <= getScrollY() + scrollWindowHeight / 2) {
43 | // correct
44 | scrollTo(0, getScrollY() + (int)mShiftHeight);
45 | if(getOverScrollerFromParent() != null && !getOverScrollerFromParent().isFinished()) {
46 | // get current directed velocity from scroller
47 | int direction = getOverScrollerFromParent().getFinalY() - getOverScrollerFromParent().getStartY() > 0 ? 1 : -1;
48 | float velocity = getOverScrollerFromParent().getCurrVelocity() * direction;
49 | // stop and restart animation again
50 | getOverScrollerFromParent().abortAnimation();
51 | mScroller.fling(
52 | getScrollX(), // startX
53 | getScrollY(), // startY
54 | 0, // velocityX
55 | (int)velocity, // velocityY
56 | 0, // minX
57 | 0, // maxX
58 | 0, // minY
59 | Integer.MAX_VALUE, // maxY
60 | 0, // overX
61 | scrollWindowHeight / 2 // overY
62 | );
63 | ViewCompat.postInvalidateOnAnimation(this);
64 | }
65 | }
66 | mShiftHeight = 0;
67 | mShiftOffset = 0;
68 | }
69 |
70 | @Nullable
71 | private OverScroller getOverScrollerFromParent() {
72 | if(mTriedToGetScroller) {
73 | return mScroller;
74 | }
75 | mTriedToGetScroller = true;
76 | Field field = null;
77 | try {
78 | field = ReactScrollView.class.getDeclaredField("mScroller");
79 | field.setAccessible(true);
80 | } catch (NoSuchFieldException e) {
81 | FLog.w(
82 | "ScrollView",
83 | "Failed to get mScroller field for ScrollView! "
84 | + "This app will exhibit the bounce-back scrolling bug :(");
85 | }
86 |
87 | if(field != null) {
88 | Object scrollerValue = null;
89 | try {
90 | scrollerValue = field.get(this);
91 | if (scrollerValue instanceof OverScroller) {
92 | mScroller = (OverScroller) scrollerValue;
93 | } else {
94 | FLog.w(
95 | ReactConstants.TAG,
96 | "Failed to cast mScroller field in ScrollView (probably due to OEM changes to AOSP)! "
97 | + "This app will exhibit the bounce-back scrolling bug :(");
98 | mScroller = null;
99 | }
100 | } catch (IllegalAccessException e) {
101 | throw new RuntimeException("Failed to get mScroller from ScrollView!", e);
102 | }
103 | }
104 | return mScroller;
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalFlatlistExample/AppDelegate.mm:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 | #import
5 | #import
6 |
7 | #import
8 |
9 | #if RCT_NEW_ARCH_ENABLED
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 |
17 | #import
18 |
19 | @interface AppDelegate () {
20 | RCTTurboModuleManager *_turboModuleManager;
21 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
22 | std::shared_ptr _reactNativeConfig;
23 | facebook::react::ContextContainer::Shared _contextContainer;
24 | }
25 | @end
26 | #endif
27 |
28 | @implementation AppDelegate
29 |
30 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
31 | {
32 | RCTAppSetupPrepareApp(application);
33 |
34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
35 |
36 | #if RCT_NEW_ARCH_ENABLED
37 | _contextContainer = std::make_shared();
38 | _reactNativeConfig = std::make_shared();
39 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
40 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
41 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
42 | #endif
43 |
44 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"main", nil);
45 |
46 | if (@available(iOS 13.0, *)) {
47 | rootView.backgroundColor = [UIColor systemBackgroundColor];
48 | } else {
49 | rootView.backgroundColor = [UIColor whiteColor];
50 | }
51 |
52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
53 | UIViewController *rootViewController = [UIViewController new];
54 | rootViewController.view = rootView;
55 | self.window.rootViewController = rootViewController;
56 | [self.window makeKeyAndVisible];
57 | return YES;
58 | }
59 |
60 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
61 | {
62 | #if DEBUG
63 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
64 | #else
65 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
66 | #endif
67 | }
68 |
69 | #if RCT_NEW_ARCH_ENABLED
70 |
71 | #pragma mark - RCTCxxBridgeDelegate
72 |
73 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge
74 | {
75 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
76 | delegate:self
77 | jsInvoker:bridge.jsCallInvoker];
78 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
79 | }
80 |
81 | #pragma mark RCTTurboModuleManagerDelegate
82 |
83 | - (Class)getModuleClassFromName:(const char *)name
84 | {
85 | return RCTCoreModulesClassProvider(name);
86 | }
87 |
88 | - (std::shared_ptr)getTurboModule:(const std::string &)name
89 | jsInvoker:(std::shared_ptr)jsInvoker
90 | {
91 | return nullptr;
92 | }
93 |
94 | - (std::shared_ptr)getTurboModule:(const std::string &)name
95 | initParams:
96 | (const facebook::react::ObjCTurboModule::InitParams &)params
97 | {
98 | return nullptr;
99 | }
100 |
101 | - (id)getModuleInstanceFromClass:(Class)moduleClass
102 | {
103 | return RCTAppSetupDefaultModuleFromClass(moduleClass);
104 | }
105 |
106 | #endif
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalFlatlistExample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-bidirectional-flatlist",
3 | "version": "0.6.0",
4 | "description": "A FlatList which can handle prepending and appending and still holding the current position",
5 | "main": "lib/commonjs/index",
6 | "module": "lib/module/index",
7 | "types": "lib/typescript/index.d.ts",
8 | "react-native": "src/index",
9 | "source": "src/index",
10 | "files": [
11 | "src",
12 | "lib",
13 | "android",
14 | "ios",
15 | "cpp",
16 | "react-native-bidirectional-flatlist.podspec",
17 | "!lib/typescript/example",
18 | "!android/build",
19 | "!ios/build",
20 | "!**/__tests__",
21 | "!**/__fixtures__",
22 | "!**/__mocks__"
23 | ],
24 | "scripts": {
25 | "test": "jest",
26 | "typescript": "tsc --noEmit",
27 | "lint": "eslint \"**/*.{js,ts,tsx}\"",
28 | "prepare": "bob build",
29 | "release": "release-it",
30 | "example": "yarn --cwd example",
31 | "bootstrap": "yarn example && yarn && yarn example pods"
32 | },
33 | "keywords": [
34 | "react-native",
35 | "ios",
36 | "android"
37 | ],
38 | "repository": "https://github.com/steuerbot/react-native-bidirectional-flatlist",
39 | "author": "Friedolin Förder ",
40 | "license": "MIT",
41 | "bugs": {
42 | "url": "https://github.com/steuerbot/react-native-bidirectional-flatlist/issues"
43 | },
44 | "homepage": "https://github.com/steuerbot/react-native-bidirectional-flatlist#readme",
45 | "publishConfig": {
46 | "registry": "https://registry.npmjs.org/"
47 | },
48 | "devDependencies": {
49 | "@arkweid/lefthook": "^0.7.7",
50 | "@babel/eslint-parser": "^7.18.2",
51 | "@commitlint/config-conventional": "^17.0.2",
52 | "@react-native-community/eslint-config": "^3.0.2",
53 | "@release-it/conventional-changelog": "^5.0.0",
54 | "@types/jest": "^28.1.2",
55 | "@types/react": "~17.0.21",
56 | "@types/react-native": "0.68.0",
57 | "commitlint": "^17.0.2",
58 | "eslint": "8.22.0",
59 | "eslint-config-prettier": "^8.5.0",
60 | "eslint-plugin-prettier": "^4.0.0",
61 | "eslint-plugin-react-hooks": "4.6.0",
62 | "jest": "^28.1.1",
63 | "pod-install": "^0.1.0",
64 | "prettier": "^2.0.5",
65 | "react": "17.0.2",
66 | "react-native": "0.68.2",
67 | "react-native-builder-bob": "^0.18.3",
68 | "release-it": "^15.0.0",
69 | "typescript": "^4.5.2"
70 | },
71 | "resolutions": {
72 | "@types/react": "17.0.21"
73 | },
74 | "peerDependencies": {
75 | "react": "*",
76 | "react-native": "*"
77 | },
78 | "jest": {
79 | "preset": "react-native",
80 | "modulePathIgnorePatterns": [
81 | "/example/node_modules",
82 | "/lib/"
83 | ]
84 | },
85 | "commitlint": {
86 | "extends": [
87 | "@commitlint/config-conventional"
88 | ]
89 | },
90 | "release-it": {
91 | "git": {
92 | "commitMessage": "chore: release ${version}",
93 | "tagName": "v${version}"
94 | },
95 | "npm": {
96 | "publish": true
97 | },
98 | "github": {
99 | "release": true
100 | },
101 | "plugins": {
102 | "@release-it/conventional-changelog": {
103 | "preset": "angular"
104 | }
105 | }
106 | },
107 | "eslintConfig": {
108 | "root": true,
109 | "parser": "@babel/eslint-parser",
110 | "extends": [
111 | "@react-native-community",
112 | "prettier"
113 | ],
114 | "rules": {
115 | "prettier/prettier": [
116 | "error",
117 | {
118 | "quoteProps": "consistent",
119 | "singleQuote": true,
120 | "tabWidth": 2,
121 | "trailingComma": "es5",
122 | "useTabs": false
123 | }
124 | ]
125 | }
126 | },
127 | "eslintIgnore": [
128 | "node_modules/",
129 | "lib/"
130 | ],
131 | "prettier": {
132 | "quoteProps": "consistent",
133 | "singleQuote": true,
134 | "tabWidth": 2,
135 | "trailingComma": "es5",
136 | "useTabs": false
137 | },
138 | "react-native-builder-bob": {
139 | "source": "src",
140 | "output": "lib",
141 | "targets": [
142 | "commonjs",
143 | "module",
144 | [
145 | "typescript",
146 | {
147 | "project": "tsconfig.build.json"
148 | }
149 | ]
150 | ]
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-bidirectional-flatlist
2 | [](https://www.npmjs.com/package/react-native-bidirectional-flatlist)
3 | [](https://opensource.org/licenses/MIT)
4 |
5 | A FlatList replacement which uses the official React Native Implementation of FlatList and adds [Item height calculation](#item-height-calculation) of list items and [correction of the current scroll position](#adjust-the-current-scroll-position) on top of it.
6 | Tested with React Native 0.69 (for RN < 0.68 see [Troubleshooting](#troubleshooting))
7 |
8 | ## How is it done
9 |
10 | ### Item height calculation
11 | Whenever a new list item is added to the list, the height of this new item is calculated outside of the viewport and will be used later on in the `getItemLayout` function. You can skip this step by providing your own implementation / function of `getItemLayout`.
12 |
13 | ### Adjust the current scroll position
14 | When items will be prepended, the heights of the new items will be used to correct the current scroll position of the FlatList. The correction is made in the native part of the ScrollView component.
15 | For iOS, this is not necessary, because the property `maintainVisibleContentPosition` will be used.
16 |
17 | ## React Native Versions
18 |
19 | | react-native | react-native-bidirectional-flatlist |
20 | |-----------------|-------------------------------------|
21 | | 0.73.x | 0.6.0 |
22 | | 0.72.x | ? (untested) |
23 | | 0.71.x – 0.69.x | 0.5.0 |
24 |
25 | ## Examples
26 |
27 | ### Prepend items during scroll
28 | 
29 |
30 | ### Remove one item and prepend multiple
31 | 
32 |
33 | ## Installation
34 |
35 | ```sh
36 | npm install react-native-bidirectional-flatlist
37 | ```
38 |
39 | or
40 |
41 | ```sh
42 | yarn add react-native-bidirectional-flatlist
43 | ```
44 |
45 | ## Usage
46 |
47 | ```js
48 | import BidirectionalFlatlist from "react-native-bidirectional-flatlist";
49 |
50 | // ...
51 |
52 |
53 | ```
54 |
55 | ### Properties
56 | | Name | description | required | default |
57 | |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|---------|
58 | | data | The data array, see [RN doc](https://reactnative.dev/docs/flatlist#required-data) | ☑️ | |
59 | | renderItem | Render function, see [RN doc](https://reactnative.dev/docs/flatlist#required-renderitem). Difference to FlatList: Argument is {item: T; prerendering: boolean} | ☑️ | |
60 | | keyExtractor | Function, which returns the key / id of the item, see [RN doc](https://reactnative.dev/docs/flatlist#keyextractor). Difference to FlatList: The index-Parameter is missing | | (item) => item.id ?? item.key |
61 | | getItemLayout | If you know the dimensions of the items you can provide it, otherwise prerendering would be used to determine the height. See [RN doc](https://reactnative.dev/docs/flatlist#getitemlayout) | | |
62 | |...||||
63 |
64 | Separators are not allowed. For other properties see [RN doc](https://reactnative.dev/docs/flatlist).
65 |
66 | ## Typescript
67 |
68 | Built with Typescript, so works with Typescript out of the box.
69 |
70 | ## Contributing
71 |
72 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
73 |
74 | ## Troubleshooting
75 |
76 | If you use React Native Version < 0.68.0 the constructor of ReactScrollView is different and therefore you get a crash on Android.
77 | You can change (e.g. with [patch-package](https://github.com/ds300/patch-package)) the constructor like so:
78 | ```
79 | import com.facebook.react.bridge.ReactContext;
80 | ...
81 |
82 | public ScrollView(ReactContext context) {
83 | super(context, null);
84 | }
85 | ```
86 |
87 | ## License
88 |
89 | **[MIT](https://github.com/steuerbot/react-native-bidirectional-flatlist/blob/main/LICENSE)**
90 |
--------------------------------------------------------------------------------
/src/hooks/usePrerenderedData.tsx:
--------------------------------------------------------------------------------
1 | import React, { MutableRefObject, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
2 | import { FlatListProps, LayoutChangeEvent, View } from 'react-native';
3 | import type { FlatListType, KeyExtractor, OnUpdateData, RenderItem } from '../types';
4 | import { MIN_INDEX } from '../config';
5 |
6 | type OnLayout = (options: {id: string; height: number}) => void;
7 |
8 | const Prerender = ({id, onLayout, children}: {id: string; onLayout: OnLayout; children: ReactNode}) => {
9 | const onLayoutView = useCallback((e: LayoutChangeEvent) => {
10 | onLayout({
11 | id,
12 | height: e.nativeEvent.layout.height,
13 | });
14 | }, [id, onLayout]);
15 |
16 | return
17 | {children}
18 |
19 | }
20 |
21 | export const usePrerenderedData = ({data, keyExtractor, renderItem, scrollRef, onUpdateData, getItemLayout}: {
22 | data: readonly any[];
23 | keyExtractor: KeyExtractor;
24 | renderItem: RenderItem
25 | scrollRef: MutableRefObject;
26 | onUpdateData?: OnUpdateData;
27 | getItemLayout?: FlatListProps['getItemLayout'];
28 | }) => {
29 | const [finalData, setFinalData] = useState([]);
30 | const [newData, setNewData] = useState([]);
31 |
32 | const heightsRef = useRef>({});
33 | const getHeight = useCallback((list: any[], heights= heightsRef.current) => {
34 | return list.reduce((p, c) => p + heights[keyExtractor(c)], 0)
35 | }, [keyExtractor]);
36 |
37 | const shift = useCallback((newData: any[], oldHeights: Record) => {
38 | const removedData = [];
39 | for (const d of finalData) {
40 | if(!heightsRef.current[keyExtractor(d)]) {
41 | removedData.push(d);
42 | } else {
43 | break;
44 | }
45 | }
46 |
47 | const shiftValue = {
48 | height: -getHeight(removedData, oldHeights),
49 | offset: 0,
50 | };
51 | const index = data.findIndex((d) => d === newData[0]);
52 | if(index >= 0 && index <= MIN_INDEX) {
53 | shiftValue.height += getHeight(newData);
54 | shiftValue.offset = getHeight(data.slice(0, index))
55 | }
56 | if(shiftValue.height !== 0) {
57 | scrollRef.current?.shift(shiftValue);
58 | onUpdateData?.({heights: heightsRef.current, ...shiftValue});
59 | }
60 | setFinalData(data);
61 | }, [data, finalData, getHeight, keyExtractor, onUpdateData, scrollRef]);
62 |
63 | useEffect(() => {
64 | if(data === finalData) {
65 | return;
66 | }
67 | if(getItemLayout) {
68 | const newD = data.filter((d) => !heightsRef.current[keyExtractor(d)]);
69 | const oldHeights = heightsRef.current;
70 | heightsRef.current = data.reduce((p,c,i) => {
71 | p[keyExtractor(c)] = getItemLayout(data as any[], i).length;
72 | return p;
73 | }, {});
74 | shift(newD, oldHeights);
75 | return;
76 | }
77 | setNewData(data.filter((d) => !heightsRef.current[keyExtractor(d)]));
78 | }, [data, finalData, getHeight, getItemLayout, keyExtractor, onUpdateData, scrollRef, shift]);
79 |
80 | useEffect(() => {
81 | if(getItemLayout || !newData.length) {
82 | return;
83 | }
84 | }, [newData, getItemLayout]);
85 |
86 | const onLayout = useCallback(({id, height}) => {
87 | heightsRef.current[id] = height;
88 | // check if there are missing elements
89 | const missing = data.some((d) => heightsRef.current[keyExtractor(d)] === undefined);
90 | if(missing) {
91 | return;
92 | }
93 | const oldHeights = heightsRef.current;
94 | // clean current heights (=> remove old heights)
95 | heightsRef.current = data.reduce((p,c) => {
96 | const id = keyExtractor(c);
97 | p[id] = oldHeights[id];
98 | return p;
99 | }, {});
100 | shift(newData, oldHeights);
101 | setNewData([]);
102 | }, [data, keyExtractor, newData, shift]);
103 |
104 | return {
105 | finalData,
106 | prerender: newData.length ?
107 | {newData.map((d) => )}
108 | : undefined,
109 | getItemLayoutCustom: useCallback((data, index) => {
110 | const d = data[index];
111 | const id = keyExtractor(d);
112 | return {
113 | index,
114 | length: heightsRef.current[id],
115 | offset: getHeight(data.slice(0, index)),
116 | }
117 | }, [getHeight, keyExtractor]),
118 | };
119 | };
120 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativebidirectionalflatlist/newarchitecture/MainApplicationReactNativeHost.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativebidirectionalflatlist.newarchitecture;
2 |
3 | import android.app.Application;
4 | import androidx.annotation.NonNull;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactInstanceManager;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
10 | import com.facebook.react.bridge.JSIModulePackage;
11 | import com.facebook.react.bridge.JSIModuleProvider;
12 | import com.facebook.react.bridge.JSIModuleSpec;
13 | import com.facebook.react.bridge.JSIModuleType;
14 | import com.facebook.react.bridge.JavaScriptContextHolder;
15 | import com.facebook.react.bridge.ReactApplicationContext;
16 | import com.facebook.react.bridge.UIManager;
17 | import com.facebook.react.fabric.ComponentFactory;
18 | import com.facebook.react.fabric.CoreComponentsRegistry;
19 | import com.facebook.react.fabric.EmptyReactNativeConfig;
20 | import com.facebook.react.fabric.FabricJSIModuleProvider;
21 | import com.facebook.react.uimanager.ViewManagerRegistry;
22 | import com.example.reactnativebidirectionalflatlist.BuildConfig;
23 | import com.example.reactnativebidirectionalflatlist.newarchitecture.components.MainComponentsRegistry;
24 | import com.example.reactnativebidirectionalflatlist.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | /**
29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
30 | * TurboModule delegates and the Fabric Renderer.
31 | *
32 | * Please note that this class is used ONLY if you opt-in for the New Architecture (see the
33 | * `newArchEnabled` property). Is ignored otherwise.
34 | */
35 | public class MainApplicationReactNativeHost extends ReactNativeHost {
36 | public MainApplicationReactNativeHost(Application application) {
37 | super(application);
38 | }
39 |
40 | @Override
41 | public boolean getUseDeveloperSupport() {
42 | return BuildConfig.DEBUG;
43 | }
44 |
45 | @Override
46 | protected List getPackages() {
47 | List packages = new PackageList(this).getPackages();
48 | // Packages that cannot be autolinked yet can be added manually here, for example:
49 | // packages.add(new MyReactNativePackage());
50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
51 | // packages.add(new TurboReactPackage() { ... });
52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here
53 | // inside a ReactPackage.
54 | return packages;
55 | }
56 |
57 | @Override
58 | protected String getJSMainModuleName() {
59 | return "index";
60 | }
61 |
62 | @NonNull
63 | @Override
64 | protected ReactPackageTurboModuleManagerDelegate.Builder
65 | getReactPackageTurboModuleManagerDelegateBuilder() {
66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
67 | // for the new architecture and to use TurboModules correctly.
68 | return new MainApplicationTurboModuleManagerDelegate.Builder();
69 | }
70 |
71 | @Override
72 | protected JSIModulePackage getJSIModulePackage() {
73 | return new JSIModulePackage() {
74 | @Override
75 | public List getJSIModules(
76 | final ReactApplicationContext reactApplicationContext,
77 | final JavaScriptContextHolder jsContext) {
78 | final List specs = new ArrayList<>();
79 |
80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the
81 | // custom Fabric Components.
82 | specs.add(
83 | new JSIModuleSpec() {
84 | @Override
85 | public JSIModuleType getJSIModuleType() {
86 | return JSIModuleType.UIManager;
87 | }
88 |
89 | @Override
90 | public JSIModuleProvider getJSIModuleProvider() {
91 | final ComponentFactory componentFactory = new ComponentFactory();
92 | CoreComponentsRegistry.register(componentFactory);
93 |
94 | // Here we register a Components Registry.
95 | // The one that is generated with the template contains no components
96 | // and just provides you the one from React Native core.
97 | MainComponentsRegistry.register(componentFactory);
98 |
99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
100 |
101 | ViewManagerRegistry viewManagerRegistry =
102 | new ViewManagerRegistry(
103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));
104 |
105 | return new FabricJSIModuleProvider(
106 | reactApplicationContext,
107 | componentFactory,
108 | new EmptyReactNativeConfig(),
109 | viewManagerRegistry);
110 | }
111 | });
112 | return specs;
113 | }
114 | };
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MSYS* | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/src/ScrollView.tsx:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2 | // @ts-nocheck
3 |
4 | import React, { Component, forwardRef } from 'react';
5 | import { PixelRatio, Platform, ScrollView as ScrollViewRN, ScrollViewProps, StyleSheet, View } from 'react-native';
6 | import { BidirectionalFlatlist } from './BidirectionalFlatlist';
7 | import type { ShiftFunction } from './types';
8 |
9 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10 | // @ts-ignore
11 | const ScrollViewRNRaw: Component = ScrollViewRN.render().type; // hack to get inner type of ScrollView
12 |
13 | export class ScrollViewComponent extends ScrollViewRNRaw {
14 | constructor(props: ScrollViewProps) {
15 | super(props);
16 | }
17 |
18 | shift: ShiftFunction = ({ offset, height }: { offset: number; height: number }) => {
19 | this.getNativeScrollRef().setNativeProps({
20 | shiftOffset: PixelRatio.getPixelSizeForLayoutSize(offset),
21 | shiftHeight: PixelRatio.getPixelSizeForLayoutSize(height),
22 | });
23 | }
24 |
25 | render() {
26 | const NativeDirectionalScrollView = BidirectionalFlatlist;
27 | const NativeDirectionalScrollContentView = View;
28 |
29 | const contentContainerStyle = [this.props.contentContainerStyle];
30 | // if (__DEV__ && this.props.style !== undefined) {
31 | // const style = StyleSheet.flatten(this.props.style);
32 | // const childLayoutProps = ['alignItems', 'justifyContent'].filter(
33 | // (prop) => style && style[prop] !== undefined
34 | // );
35 | // invariant(
36 | // childLayoutProps.length === 0,
37 | // 'ScrollView child layout (' +
38 | // JSON.stringify(childLayoutProps) +
39 | // ') must be applied through the contentContainerStyle prop.'
40 | // );
41 | // }
42 |
43 | const contentSizeChangeProps =
44 | this.props.onContentSizeChange == null
45 | ? null
46 | : {
47 | onLayout: this._handleContentOnLayout,
48 | };
49 |
50 | const { stickyHeaderIndices } = this.props;
51 | const children = this.props.children;
52 |
53 | const hasStickyHeaders =
54 | Array.isArray(stickyHeaderIndices) && stickyHeaderIndices.length > 0;
55 |
56 | const contentContainer = (
57 |
70 | {children}
71 |
72 | );
73 |
74 | const alwaysBounceHorizontal =
75 | this.props.alwaysBounceHorizontal !== undefined
76 | ? this.props.alwaysBounceHorizontal
77 | : this.props.horizontal;
78 |
79 | const alwaysBounceVertical =
80 | this.props.alwaysBounceVertical !== undefined
81 | ? this.props.alwaysBounceVertical
82 | : !this.props.horizontal;
83 |
84 | const baseStyle = styles.baseVertical;
85 | const props = {
86 | ...this.props,
87 | alwaysBounceHorizontal,
88 | alwaysBounceVertical,
89 | style: StyleSheet.compose(baseStyle, this.props.style),
90 | // Override the onContentSizeChange from props, since this event can
91 | // bubble up from TextInputs
92 | onContentSizeChange: null,
93 | onLayout: this._handleLayout,
94 | onMomentumScrollBegin: this._handleMomentumScrollBegin,
95 | onMomentumScrollEnd: this._handleMomentumScrollEnd,
96 | onResponderGrant: this._handleResponderGrant,
97 | onResponderReject: this._handleResponderReject,
98 | onResponderRelease: this._handleResponderRelease,
99 | onResponderTerminationRequest: this._handleResponderTerminationRequest,
100 | onScrollBeginDrag: this._handleScrollBeginDrag,
101 | onScrollEndDrag: this._handleScrollEndDrag,
102 | onScrollShouldSetResponder: this._handleScrollShouldSetResponder,
103 | onStartShouldSetResponder: this._handleStartShouldSetResponder,
104 | onStartShouldSetResponderCapture:
105 | this._handleStartShouldSetResponderCapture,
106 | onTouchEnd: this._handleTouchEnd,
107 | onTouchMove: this._handleTouchMove,
108 | onTouchStart: this._handleTouchStart,
109 | onTouchCancel: this._handleTouchCancel,
110 | onScroll: this._handleScroll,
111 | scrollEventThrottle: hasStickyHeaders
112 | ? 1
113 | : this.props.scrollEventThrottle,
114 | sendMomentumEvents:
115 | this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd
116 | ? true
117 | : false,
118 | // default to true
119 | snapToStart: this.props.snapToStart !== false,
120 | // default to true
121 | snapToEnd: this.props.snapToEnd !== false,
122 | // pagingEnabled is overridden by snapToInterval / snapToOffsets
123 | pagingEnabled: Platform.select({
124 | // on iOS, pagingEnabled must be set to false to have snapToInterval / snapToOffsets work
125 | ios:
126 | this.props.pagingEnabled === true &&
127 | this.props.snapToInterval == null &&
128 | this.props.snapToOffsets == null,
129 | // on Android, pagingEnabled must be set to true to have snapToInterval / snapToOffsets work
130 | android:
131 | this.props.pagingEnabled === true ||
132 | this.props.snapToInterval != null ||
133 | this.props.snapToOffsets != null,
134 | }),
135 | };
136 |
137 | // const { decelerationRate } = this.props;
138 | // if (decelerationRate != null) {
139 | // props.decelerationRate = processDecelerationRate(decelerationRate);
140 | // }
141 |
142 | const scrollViewRef = this._scrollView.getForwardingRef(
143 | this.props.scrollViewRef,
144 | );
145 |
146 | return (
147 |
148 | {contentContainer}
149 |
150 | );
151 | }
152 | }
153 |
154 | const styles = StyleSheet.create({
155 | baseVertical: {
156 | flexGrow: 1,
157 | flexShrink: 1,
158 | flexDirection: 'column',
159 | overflow: 'scroll',
160 | },
161 | });
162 |
163 | export type ScrollViewType = typeof ScrollViewRN & {shift: (options: {offset: number; height: number}) => void};
164 |
165 | export const ScrollView: ScrollViewType = forwardRef((props, ref) => {
166 | return
167 | });
168 |
--------------------------------------------------------------------------------
/example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC, ReactNode, useCallback, useContext, useMemo, useState } from 'react';
2 |
3 | import { Button, FlatList, Text, TouchableOpacity, View } from 'react-native';
4 | import BidirectionalFlatList from 'react-native-bidirectional-flatlist';
5 | import Reanimated, { useAnimatedRef } from 'react-native-reanimated';
6 |
7 | const FlatListReanimated = Reanimated.createAnimatedComponent(BidirectionalFlatList);
8 |
9 | interface MessageType {
10 | id: string;
11 | color: string;
12 | height: number;
13 | }
14 |
15 | let counter = 1;
16 | const getIdNumber = () => counter++;
17 | let block = 1;
18 | const getBlockNumber = () => block++;
19 |
20 | const generateData = (howMany = 20, height: number | undefined = undefined): MessageType[] => {
21 | const colors = [
22 | 'red',
23 | 'green',
24 | 'blue',
25 | 'yellow',
26 | 'purple',
27 | 'brown',
28 | 'magenta',
29 | 'cyan',
30 | ];
31 | const color = colors[getBlockNumber() % colors.length] as string;
32 | return Array.from(new Array(howMany)).map(() => {
33 | const id = getIdNumber();
34 | return {
35 | id: id.toString(),
36 | color,
37 | height: height ?? Math.floor(50 + Math.random() * 100),
38 | };
39 | });
40 | };
41 |
42 | const Message: FC = ({ id, color, height }) => {
43 | if(!height) {
44 | return null;
45 | }
46 | return (
47 |
56 |
63 | {id}
64 |
65 |
66 | );
67 | };
68 |
69 |
70 | const types = ['FlatList', 'AnimatedFlatList', 'getItemLayout'] as const;
71 | type Type = typeof types[number];
72 |
73 | const ExampleLink = ({type}: {type: Type}) => {
74 | const {setType} = useContext(ExampleContext);
75 | const onPress = useCallback(() => {
76 | setType(type);
77 | }, [setType, type]);
78 | return {type};
79 | }
80 |
81 | const ExampleContext = React.createContext<{type: string | undefined; back: () => unknown; setType: (type: Type) => unknown}>({type: undefined, back: () => {/* placeholder */}, setType: (_type) => {/* placeholder */}});
82 |
83 | const Example = ({children}: {children: (props: any) => ReactNode}) => {
84 | const [puffer] = useState(() => generateData(20, 0));
85 | const [data, setData] = useState([]);
86 |
87 | const ref = useAnimatedRef();
88 |
89 | const renderItem = useCallback(({item}) => {
90 | return
91 | }, [])
92 |
93 | const keyExtractor = useCallback((item) => item.id, []);
94 |
95 | const removeFirst = useCallback(async () => {
96 | setData((x) => x.slice(1));
97 | }, []);
98 |
99 | const prependAndRemoveFirst = useCallback(async () => {
100 | const newData = generateData(5);
101 | setData((x) => [...newData, ...x.slice(1)]);
102 | }, []);
103 |
104 | const prepend = useCallback(async () => {
105 | const newData = generateData(20);
106 | setData((x) => [...newData, ...x]);
107 | }, []);
108 |
109 | const append = useCallback(async () => {
110 | const newData = generateData();
111 | setData((x) => [...x, ...newData]);
112 | }, []);
113 |
114 | const reset = useCallback(() => {
115 | setData([]);
116 | }, []);
117 |
118 | const finalData = useMemo(() => [...data, ...puffer], [data, puffer]);
119 |
120 | const props = {
121 | windowSize: 21,
122 | maxToRenderPerBatch: 20,
123 | initialNumToRender: 20,
124 | data: finalData,
125 | renderItem,
126 | keyExtractor,
127 | ref,
128 | }
129 |
130 | return
131 | {({type, back}) => <>
132 | {children(props)}
133 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
156 |
157 |
158 | 🔙 {type}
159 |
160 |
161 |
162 |
171 |
172 | {data.length}
173 |
174 |
175 | >}
176 |
177 | }
178 |
179 | const GetItemLayoutExample = (props: any) => {
180 | const getItemLayout = (data: MessageType[], index: number) => {
181 | return {
182 | index,
183 | length: data[index]?.height,
184 | offset: data.slice(0, index).reduce((p,c) => p + c.height, 0),
185 | }
186 | }
187 |
188 | return
189 | }
190 |
191 | export default function App() {
192 | const [type, setType] = useState();
193 |
194 | const back = useCallback(() => setType(undefined), [])
195 |
196 | return (
197 |
198 |
199 | {!type &&
200 | {types.map(t => )}
201 | }
202 | {type === 'FlatList' && {props => }}
203 | {type === 'AnimatedFlatList' && {props => }}
204 | {type === 'getItemLayout' && {props => }}
205 |
206 |
207 | );
208 | }
209 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | #
21 | # Gradle start up script for POSIX generated by Gradle.
22 | #
23 | # Important for running:
24 | #
25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26 | # noncompliant, but you have some other compliant shell such as ksh or
27 | # bash, then to run this script, type that shell name before the whole
28 | # command line, like:
29 | #
30 | # ksh Gradle
31 | #
32 | # Busybox and similar reduced shells will NOT work, because this script
33 | # requires all of these POSIX shell features:
34 | # * functions;
35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37 | # * compound commands having a testable exit status, especially «case»;
38 | # * various built-in commands including «command», «set», and «ulimit».
39 | #
40 | # Important for patching:
41 | #
42 | # (2) This script targets any POSIX shell, so it avoids extensions provided
43 | # by Bash, Ksh, etc; in particular arrays are avoided.
44 | #
45 | # The "traditional" practice of packing multiple parameters into a
46 | # space-separated string is a well documented source of bugs and security
47 | # problems, so this is (mostly) avoided, by progressively accumulating
48 | # options in "$@", and eventually passing that to Java.
49 | #
50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52 | # see the in-line comments for details.
53 | #
54 | # There are tweaks for specific operating systems such as AIX, CygWin,
55 | # Darwin, MinGW, and NonStop.
56 | #
57 | # (3) This script is generated from the Groovy template
58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59 | # within the Gradle project.
60 | #
61 | # You can find Gradle at https://github.com/gradle/gradle/.
62 | #
63 | ##############################################################################
64 |
65 | # Attempt to set APP_HOME
66 |
67 | # Resolve links: $0 may be a link
68 | app_path=$0
69 |
70 | # Need this for daisy-chained symlinks.
71 | while
72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73 | [ -h "$app_path" ]
74 | do
75 | ls=$( ls -ld "$app_path" )
76 | link=${ls#*' -> '}
77 | case $link in #(
78 | /*) app_path=$link ;; #(
79 | *) app_path=$APP_HOME$link ;;
80 | esac
81 | done
82 |
83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84 |
85 | APP_NAME="Gradle"
86 | APP_BASE_NAME=${0##*/}
87 |
88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137 |
138 | Please set the JAVA_HOME variable in your environment to match the
139 | location of your Java installation."
140 | fi
141 |
142 | # Increase the maximum file descriptors if we can.
143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144 | case $MAX_FD in #(
145 | max*)
146 | MAX_FD=$( ulimit -H -n ) ||
147 | warn "Could not query maximum file descriptor limit"
148 | esac
149 | case $MAX_FD in #(
150 | '' | soft) :;; #(
151 | *)
152 | ulimit -n "$MAX_FD" ||
153 | warn "Could not set maximum file descriptor limit to $MAX_FD"
154 | esac
155 | fi
156 |
157 | # Collect all arguments for the java command, stacking in reverse order:
158 | # * args from the command line
159 | # * the main class name
160 | # * -classpath
161 | # * -D...appname settings
162 | # * --module-path (only if needed)
163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
164 |
165 | # For Cygwin or MSYS, switch paths to Windows format before running java
166 | if "$cygwin" || "$msys" ; then
167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
169 |
170 | JAVACMD=$( cygpath --unix "$JAVACMD" )
171 |
172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
173 | for arg do
174 | if
175 | case $arg in #(
176 | -*) false ;; # don't mess with options #(
177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
178 | [ -e "$t" ] ;; #(
179 | *) false ;;
180 | esac
181 | then
182 | arg=$( cygpath --path --ignore --mixed "$arg" )
183 | fi
184 | # Roll the args list around exactly as many times as the number of
185 | # args, so each arg winds up back in the position where it started, but
186 | # possibly modified.
187 | #
188 | # NB: a `for` loop captures its iteration list before it begins, so
189 | # changing the positional parameters here affects neither the number of
190 | # iterations, nor the values presented in `arg`.
191 | shift # remove old arg
192 | set -- "$@" "$arg" # push replacement arg
193 | done
194 | fi
195 |
196 | # Collect all arguments for the java command;
197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198 | # shell script including quotes and variable substitutions, so put them in
199 | # double quotes to make sure that they get re-expanded; and
200 | # * put everything else in single quotes, so that it's not re-expanded.
201 |
202 | set -- \
203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
204 | -classpath "$CLASSPATH" \
205 | org.gradle.wrapper.GradleWrapperMain \
206 | "$@"
207 |
208 | # Use "xargs" to parse quoted args.
209 | #
210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
211 | #
212 | # In Bash we could simply go:
213 | #
214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
215 | # set -- "${ARGS[@]}" "$@"
216 | #
217 | # but POSIX shell has neither arrays nor command substitution, so instead we
218 | # post-process each arg (as a line of input to sed) to backslash-escape any
219 | # character that might be a shell metacharacter, then use eval to reverse
220 | # that process (while maintaining the separation between arguments), and wrap
221 | # the whole thing up as a single "set" statement.
222 | #
223 | # This will of course break if any of these variables contains a newline or
224 | # an unmatched quote.
225 | #
226 |
227 | eval "set -- $(
228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
229 | xargs -n1 |
230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
231 | tr '\n' ' '
232 | )" '"$@"'
233 |
234 | exec "$JAVACMD" "$@"
235 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4 |
5 | ## Development workflow
6 |
7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
8 |
9 | ```sh
10 | yarn
11 | ```
12 |
13 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
14 |
15 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
16 |
17 | To start the packager:
18 |
19 | ```sh
20 | yarn example start
21 | ```
22 |
23 | To run the example app on Android:
24 |
25 | ```sh
26 | yarn example android
27 | ```
28 |
29 | To run the example app on iOS:
30 |
31 | ```sh
32 | yarn example ios
33 | ```
34 |
35 |
36 | Make sure your code passes TypeScript and ESLint. Run the following to verify:
37 |
38 | ```sh
39 | yarn typescript
40 | yarn lint
41 | ```
42 |
43 | To fix formatting errors, run the following:
44 |
45 | ```sh
46 | yarn lint --fix
47 | ```
48 |
49 | Remember to add tests for your change if possible. Run the unit tests by:
50 |
51 | ```sh
52 | yarn test
53 | ```
54 | To edit the Objective-C files, open `example/ios/BidirectionalFlatlistExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bidirectional-flatlist`.
55 |
56 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativebidirectionalflatlist` under `Android`.
57 | ### Commit message convention
58 |
59 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
60 |
61 | - `fix`: bug fixes, e.g. fix crash due to deprecated method.
62 | - `feat`: new features, e.g. add new method to the module.
63 | - `refactor`: code refactor, e.g. migrate from class components to hooks.
64 | - `docs`: changes into documentation, e.g. add usage example for the module..
65 | - `test`: adding or updating tests, e.g. add integration tests using detox.
66 | - `chore`: tooling changes, e.g. change CI config.
67 |
68 | Our pre-commit hooks verify that your commit message matches this format when committing.
69 |
70 | ### Linting and tests
71 |
72 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
73 |
74 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
75 |
76 | Our pre-commit hooks verify that the linter and tests pass when committing.
77 |
78 | ### Publishing to npm
79 |
80 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
81 |
82 | To publish new versions, run the following:
83 |
84 | ```sh
85 | yarn release
86 | ```
87 |
88 | ### Scripts
89 |
90 | The `package.json` file contains various scripts for common tasks:
91 |
92 | - `yarn bootstrap`: setup project by installing all dependencies and pods.
93 | - `yarn typescript`: type-check files with TypeScript.
94 | - `yarn lint`: lint files with ESLint.
95 | - `yarn test`: run unit tests with Jest.
96 | - `yarn example start`: start the Metro server for the example app.
97 | - `yarn example android`: run the example app on Android.
98 | - `yarn example ios`: run the example app on iOS.
99 |
100 | ### Sending a pull request
101 |
102 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
103 |
104 | When you're sending a pull request:
105 |
106 | - Prefer small pull requests focused on one change.
107 | - Verify that linters and tests are passing.
108 | - Review the documentation to make sure it looks good.
109 | - Follow the pull request template when opening a pull request.
110 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
111 |
112 | ## Code of Conduct
113 |
114 | ### Our Pledge
115 |
116 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
117 |
118 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
119 |
120 | ### Our Standards
121 |
122 | Examples of behavior that contributes to a positive environment for our community include:
123 |
124 | - Demonstrating empathy and kindness toward other people
125 | - Being respectful of differing opinions, viewpoints, and experiences
126 | - Giving and gracefully accepting constructive feedback
127 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
128 | - Focusing on what is best not just for us as individuals, but for the overall community
129 |
130 | Examples of unacceptable behavior include:
131 |
132 | - The use of sexualized language or imagery, and sexual attention or
133 | advances of any kind
134 | - Trolling, insulting or derogatory comments, and personal or political attacks
135 | - Public or private harassment
136 | - Publishing others' private information, such as a physical or email
137 | address, without their explicit permission
138 | - Other conduct which could reasonably be considered inappropriate in a
139 | professional setting
140 |
141 | ### Enforcement Responsibilities
142 |
143 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
144 |
145 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
146 |
147 | ### Scope
148 |
149 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
150 |
151 | ### Enforcement
152 |
153 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
154 |
155 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
156 |
157 | ### Enforcement Guidelines
158 |
159 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
160 |
161 | #### 1. Correction
162 |
163 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
164 |
165 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
166 |
167 | #### 2. Warning
168 |
169 | **Community Impact**: A violation through a single incident or series of actions.
170 |
171 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
172 |
173 | #### 3. Temporary Ban
174 |
175 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
176 |
177 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
178 |
179 | #### 4. Permanent Ban
180 |
181 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
182 |
183 | **Consequence**: A permanent ban from any sort of public interaction within the community.
184 |
185 | ### Attribution
186 |
187 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
188 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
189 |
190 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
191 |
192 | [homepage]: https://www.contributor-covenant.org
193 |
194 | For answers to common questions about this code of conduct, see the FAQ at
195 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
196 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 | import org.apache.tools.ant.taskdefs.condition.Os
5 |
6 | /**
7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8 | * and bundleReleaseJsAndAssets).
9 | * These basically call `react-native bundle` with the correct arguments during the Android build
10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11 | * bundle directly from the development server. Below you can see all the possible configurations
12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
13 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
14 | *
15 | * project.ext.react = [
16 | * // the name of the generated asset file containing your JS bundle
17 | * bundleAssetName: "index.android.bundle",
18 | *
19 | * // the entry file for bundle generation. If none specified and
20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is
21 | * // default. Can be overridden with ENTRY_FILE environment variable.
22 | * entryFile: "index.android.js",
23 | *
24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
25 | * bundleCommand: "ram-bundle",
26 | *
27 | * // whether to bundle JS and assets in debug mode
28 | * bundleInDebug: false,
29 | *
30 | * // whether to bundle JS and assets in release mode
31 | * bundleInRelease: true,
32 | *
33 | * // whether to bundle JS and assets in another build variant (if configured).
34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
35 | * // The configuration property can be in the following formats
36 | * // 'bundleIn${productFlavor}${buildType}'
37 | * // 'bundleIn${buildType}'
38 | * // bundleInFreeDebug: true,
39 | * // bundleInPaidRelease: true,
40 | * // bundleInBeta: true,
41 | *
42 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
43 | * // for example: to disable dev mode in the staging build type (if configured)
44 | * devDisabledInStaging: true,
45 | * // The configuration property can be in the following formats
46 | * // 'devDisabledIn${productFlavor}${buildType}'
47 | * // 'devDisabledIn${buildType}'
48 | *
49 | * // the root of your project, i.e. where "package.json" lives
50 | * root: "../../",
51 | *
52 | * // where to put the JS bundle asset in debug mode
53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
54 | *
55 | * // where to put the JS bundle asset in release mode
56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
57 | *
58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
59 | * // require('./image.png')), in debug mode
60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
61 | *
62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
63 | * // require('./image.png')), in release mode
64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
65 | *
66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
70 | * // for example, you might want to remove it from here.
71 | * inputExcludes: ["android/**", "ios/**"],
72 | *
73 | * // override which node gets called and with what additional arguments
74 | * nodeExecutableAndArgs: ["node"],
75 | *
76 | * // supply additional arguments to the packager
77 | * extraPackagerArgs: []
78 | * ]
79 | */
80 |
81 | project.ext.react = [
82 | enableHermes: true, // clean and rebuild if changing
83 | ]
84 |
85 | apply from: "../../node_modules/react-native/react.gradle"
86 |
87 | /**
88 | * Set this to true to create two separate APKs instead of one:
89 | * - An APK that only works on ARM devices
90 | * - An APK that only works on x86 devices
91 | * The advantage is the size of the APK is reduced by about 4MB.
92 | * Upload all the APKs to the Play Store and people will download
93 | * the correct one based on the CPU architecture of their device.
94 | */
95 | def enableSeparateBuildPerCPUArchitecture = false
96 |
97 | /**
98 | * Run Proguard to shrink the Java bytecode in release builds.
99 | */
100 | def enableProguardInReleaseBuilds = false
101 |
102 | /**
103 | * The preferred build flavor of JavaScriptCore.
104 | *
105 | * For example, to use the international variant, you can use:
106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
107 | *
108 | * The international variant includes ICU i18n library and necessary data
109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
110 | * give correct results when using with locales other than en-US. Note that
111 | * this variant is about 6MiB larger per architecture than default.
112 | */
113 | def jscFlavor = 'org.webkit:android-jsc:+'
114 |
115 | /**
116 | * Whether to enable the Hermes VM.
117 | *
118 | * This should be set on project.ext.react and that value will be read here. If it is not set
119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
120 | * and the benefits of using Hermes will therefore be sharply reduced.
121 | */
122 | def enableHermes = project.ext.react.get("enableHermes", false);
123 |
124 | /**
125 | * Architectures to build native code for.
126 | */
127 | def reactNativeArchitectures() {
128 | def value = project.getProperties().get("reactNativeArchitectures")
129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
130 | }
131 |
132 | android {
133 | ndkVersion rootProject.ext.ndkVersion
134 |
135 | compileSdkVersion rootProject.ext.compileSdkVersion
136 |
137 | defaultConfig {
138 | applicationId "com.example.reactnativebidirectionalflatlist"
139 | minSdkVersion rootProject.ext.minSdkVersion
140 | targetSdkVersion rootProject.ext.targetSdkVersion
141 | versionCode 1
142 | versionName "1.0"
143 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144 |
145 | if (isNewArchitectureEnabled()) {
146 | // We configure the NDK build only if you decide to opt-in for the New Architecture.
147 | externalNativeBuild {
148 | ndkBuild {
149 | arguments "APP_PLATFORM=android-21",
150 | "APP_STL=c++_shared",
151 | "NDK_TOOLCHAIN_VERSION=clang",
152 | "GENERATED_SRC_DIR=$buildDir/generated/source",
153 | "PROJECT_BUILD_DIR=$buildDir",
154 | "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155 | "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
156 | cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157 | cppFlags "-std=c++17"
158 | // Make sure this target name is the same you specify inside the
159 | // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160 | targets "example_appmodules"
161 | // Fix for windows limit on number of character in file paths and in command lines
162 | if (Os.isFamily(Os.FAMILY_WINDOWS)) {
163 | arguments "NDK_APP_SHORT_COMMANDS=true"
164 | }
165 | }
166 | }
167 | if (!enableSeparateBuildPerCPUArchitecture) {
168 | ndk {
169 | abiFilters (*reactNativeArchitectures())
170 | }
171 | }
172 | }
173 | }
174 |
175 | if (isNewArchitectureEnabled()) {
176 | // We configure the NDK build only if you decide to opt-in for the New Architecture.
177 | externalNativeBuild {
178 | ndkBuild {
179 | path "$projectDir/src/main/jni/Android.mk"
180 | }
181 | }
182 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir
183 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
184 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
185 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
186 | into("$buildDir/react-ndk/exported")
187 | }
188 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
189 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
190 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
191 | into("$buildDir/react-ndk/exported")
192 | }
193 | afterEvaluate {
194 | // If you wish to add a custom TurboModule or component locally,
195 | // you should uncomment this line.
196 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
197 | preDebugBuild.dependsOn(packageReactNdkDebugLibs)
198 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
199 |
200 | // Due to a bug inside AGP, we have to explicitly set a dependency
201 | // between configureNdkBuild* tasks and the preBuild tasks.
202 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
203 | configureNdkBuildRelease.dependsOn(preReleaseBuild)
204 | configureNdkBuildDebug.dependsOn(preDebugBuild)
205 | reactNativeArchitectures().each { architecture ->
206 | tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
207 | dependsOn("preDebugBuild")
208 | }
209 | tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
210 | dependsOn("preReleaseBuild")
211 | }
212 | }
213 | }
214 | }
215 |
216 | splits {
217 | abi {
218 | reset()
219 | enable enableSeparateBuildPerCPUArchitecture
220 | universalApk false // If true, also generate a universal APK
221 | include (*reactNativeArchitectures())
222 | }
223 | }
224 | signingConfigs {
225 | debug {
226 | storeFile file('debug.keystore')
227 | storePassword 'android'
228 | keyAlias 'androiddebugkey'
229 | keyPassword 'android'
230 | }
231 | }
232 | buildTypes {
233 | debug {
234 | signingConfig signingConfigs.debug
235 | }
236 | release {
237 | // Caution! In production, you need to generate your own keystore file.
238 | // see https://reactnative.dev/docs/signed-apk-android.
239 | signingConfig signingConfigs.debug
240 | minifyEnabled enableProguardInReleaseBuilds
241 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
242 | }
243 | }
244 |
245 | // applicationVariants are e.g. debug, release
246 | applicationVariants.all { variant ->
247 | variant.outputs.each { output ->
248 | // For each separate APK per architecture, set a unique version code as described here:
249 | // https://developer.android.com/studio/build/configure-apk-splits.html
250 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
251 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
252 | def abi = output.getFilter(OutputFile.ABI)
253 | if (abi != null) { // null for the universal-debug, universal-release variants
254 | output.versionCodeOverride =
255 | defaultConfig.versionCode * 1000 + versionCodes.get(abi)
256 | }
257 |
258 | }
259 | }
260 | }
261 |
262 | dependencies {
263 | implementation fileTree(dir: "libs", include: ["*.jar"])
264 |
265 | //noinspection GradleDynamicVersion
266 | implementation "com.facebook.react:react-native:+" // From node_modules
267 |
268 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
269 |
270 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
271 | exclude group:'com.facebook.fbjni'
272 | }
273 |
274 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
275 | exclude group:'com.facebook.flipper'
276 | exclude group:'com.squareup.okhttp3', module:'okhttp'
277 | }
278 |
279 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
280 | exclude group:'com.facebook.flipper'
281 | }
282 |
283 | if (enableHermes) {
284 | def hermesPath = "../../node_modules/hermes-engine/android/";
285 | debugImplementation files(hermesPath + "hermes-debug.aar")
286 | releaseImplementation files(hermesPath + "hermes-release.aar")
287 | } else {
288 | implementation jscFlavor
289 | }
290 | }
291 |
292 | if (isNewArchitectureEnabled()) {
293 | // If new architecture is enabled, we let you build RN from source
294 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
295 | // This will be applied to all the imported transtitive dependency.
296 | configurations.all {
297 | resolutionStrategy.dependencySubstitution {
298 | substitute(module("com.facebook.react:react-native"))
299 | .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
300 | }
301 | }
302 | }
303 |
304 | // Run this once to be able to run the application with BUCK
305 | // puts all compile dependencies into folder libs for BUCK to use
306 | task copyDownloadableDepsToLibs(type: Copy) {
307 | from configurations.implementation
308 | into 'libs'
309 | }
310 |
311 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
312 |
313 | def isNewArchitectureEnabled() {
314 | // To opt-in for the New Architecture, you can either:
315 | // - Set `newArchEnabled` to true inside the `gradle.properties` file
316 | // - Invoke gradle with `-newArchEnabled=true`
317 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
318 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
319 | }
320 |
--------------------------------------------------------------------------------
/example/ios/BidirectionalFlatlistExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0C80B921A6F3F58F76C31292 /* libPods-BidirectionalFlatlistExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-BidirectionalFlatlistExample.a */; };
11 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXFileReference section */
18 | 13B07F961A680F5B00A75B9A /* BidirectionalFlatlistExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BidirectionalFlatlistExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
19 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BidirectionalFlatlistExample/AppDelegate.h; sourceTree = ""; };
20 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = BidirectionalFlatlistExample/AppDelegate.mm; sourceTree = ""; };
21 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = BidirectionalFlatlistExample/Images.xcassets; sourceTree = ""; };
22 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = BidirectionalFlatlistExample/Info.plist; sourceTree = ""; };
23 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = BidirectionalFlatlistExample/main.m; sourceTree = ""; };
24 | 3B4392A12AC88292D35C810B /* Pods-BidirectionalFlatlistExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BidirectionalFlatlistExample.debug.xcconfig"; path = "Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample.debug.xcconfig"; sourceTree = ""; };
25 | 5709B34CF0A7D63546082F79 /* Pods-BidirectionalFlatlistExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BidirectionalFlatlistExample.release.xcconfig"; path = "Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample.release.xcconfig"; sourceTree = ""; };
26 | 5DCACB8F33CDC322A6C60F78 /* libPods-BidirectionalFlatlistExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BidirectionalFlatlistExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
27 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = BidirectionalFlatlistExample/LaunchScreen.storyboard; sourceTree = ""; };
28 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | 0C80B921A6F3F58F76C31292 /* libPods-BidirectionalFlatlistExample.a in Frameworks */,
37 | );
38 | runOnlyForDeploymentPostprocessing = 0;
39 | };
40 | /* End PBXFrameworksBuildPhase section */
41 |
42 | /* Begin PBXGroup section */
43 | 13B07FAE1A68108700A75B9A /* BidirectionalFlatlistExample */ = {
44 | isa = PBXGroup;
45 | children = (
46 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
47 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */,
48 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
49 | 13B07FB61A68108700A75B9A /* Info.plist */,
50 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
51 | 13B07FB71A68108700A75B9A /* main.m */,
52 | );
53 | name = BidirectionalFlatlistExample;
54 | sourceTree = "";
55 | };
56 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
57 | isa = PBXGroup;
58 | children = (
59 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
60 | 5DCACB8F33CDC322A6C60F78 /* libPods-BidirectionalFlatlistExample.a */,
61 | );
62 | name = Frameworks;
63 | sourceTree = "";
64 | };
65 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
66 | isa = PBXGroup;
67 | children = (
68 | );
69 | name = Libraries;
70 | sourceTree = "";
71 | };
72 | 83CBB9F61A601CBA00E9B192 = {
73 | isa = PBXGroup;
74 | children = (
75 | 13B07FAE1A68108700A75B9A /* BidirectionalFlatlistExample */,
76 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
77 | 83CBBA001A601CBA00E9B192 /* Products */,
78 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
79 | BBD78D7AC51CEA395F1C20DB /* Pods */,
80 | );
81 | indentWidth = 2;
82 | sourceTree = "";
83 | tabWidth = 2;
84 | usesTabs = 0;
85 | };
86 | 83CBBA001A601CBA00E9B192 /* Products */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 13B07F961A680F5B00A75B9A /* BidirectionalFlatlistExample.app */,
90 | );
91 | name = Products;
92 | sourceTree = "";
93 | };
94 | BBD78D7AC51CEA395F1C20DB /* Pods */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 3B4392A12AC88292D35C810B /* Pods-BidirectionalFlatlistExample.debug.xcconfig */,
98 | 5709B34CF0A7D63546082F79 /* Pods-BidirectionalFlatlistExample.release.xcconfig */,
99 | );
100 | path = Pods;
101 | sourceTree = "";
102 | };
103 | /* End PBXGroup section */
104 |
105 | /* Begin PBXNativeTarget section */
106 | 13B07F861A680F5B00A75B9A /* BidirectionalFlatlistExample */ = {
107 | isa = PBXNativeTarget;
108 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BidirectionalFlatlistExample" */;
109 | buildPhases = (
110 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
111 | FD10A7F022414F080027D42C /* Start Packager */,
112 | 13B07F871A680F5B00A75B9A /* Sources */,
113 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
114 | 13B07F8E1A680F5B00A75B9A /* Resources */,
115 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
116 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
117 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
118 | );
119 | buildRules = (
120 | );
121 | dependencies = (
122 | );
123 | name = BidirectionalFlatlistExample;
124 | productName = BidirectionalFlatlistExample;
125 | productReference = 13B07F961A680F5B00A75B9A /* BidirectionalFlatlistExample.app */;
126 | productType = "com.apple.product-type.application";
127 | };
128 | /* End PBXNativeTarget section */
129 |
130 | /* Begin PBXProject section */
131 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
132 | isa = PBXProject;
133 | attributes = {
134 | LastUpgradeCheck = 1210;
135 | TargetAttributes = {
136 | 00E356ED1AD99517003FC87E = {
137 | CreatedOnToolsVersion = 6.2;
138 | TestTargetID = 13B07F861A680F5B00A75B9A;
139 | };
140 | 13B07F861A680F5B00A75B9A = {
141 | LastSwiftMigration = 1120;
142 | };
143 | };
144 | };
145 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BidirectionalFlatlistExample" */;
146 | compatibilityVersion = "Xcode 12.0";
147 | developmentRegion = en;
148 | hasScannedForEncodings = 0;
149 | knownRegions = (
150 | en,
151 | Base,
152 | );
153 | mainGroup = 83CBB9F61A601CBA00E9B192;
154 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
155 | projectDirPath = "";
156 | projectRoot = "";
157 | targets = (
158 | 13B07F861A680F5B00A75B9A /* BidirectionalFlatlistExample */,
159 | );
160 | };
161 | /* End PBXProject section */
162 |
163 | /* Begin PBXResourcesBuildPhase section */
164 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
165 | isa = PBXResourcesBuildPhase;
166 | buildActionMask = 2147483647;
167 | files = (
168 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
169 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
170 | );
171 | runOnlyForDeploymentPostprocessing = 0;
172 | };
173 | /* End PBXResourcesBuildPhase section */
174 |
175 | /* Begin PBXShellScriptBuildPhase section */
176 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
177 | isa = PBXShellScriptBuildPhase;
178 | buildActionMask = 2147483647;
179 | files = (
180 | );
181 | inputPaths = (
182 | );
183 | name = "Bundle React Native code and images";
184 | outputPaths = (
185 | );
186 | runOnlyForDeploymentPostprocessing = 0;
187 | shellPath = /bin/sh;
188 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
189 | };
190 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
191 | isa = PBXShellScriptBuildPhase;
192 | buildActionMask = 2147483647;
193 | files = (
194 | );
195 | inputFileListPaths = (
196 | "${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
197 | );
198 | name = "[CP] Embed Pods Frameworks";
199 | outputFileListPaths = (
200 | "${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
201 | );
202 | runOnlyForDeploymentPostprocessing = 0;
203 | shellPath = /bin/sh;
204 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-frameworks.sh\"\n";
205 | showEnvVarsInLog = 0;
206 | };
207 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
208 | isa = PBXShellScriptBuildPhase;
209 | buildActionMask = 2147483647;
210 | files = (
211 | );
212 | inputFileListPaths = (
213 | );
214 | inputPaths = (
215 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
216 | "${PODS_ROOT}/Manifest.lock",
217 | );
218 | name = "[CP] Check Pods Manifest.lock";
219 | outputFileListPaths = (
220 | );
221 | outputPaths = (
222 | "$(DERIVED_FILE_DIR)/Pods-BidirectionalFlatlistExample-checkManifestLockResult.txt",
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | shellPath = /bin/sh;
226 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
227 | showEnvVarsInLog = 0;
228 | };
229 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
230 | isa = PBXShellScriptBuildPhase;
231 | buildActionMask = 2147483647;
232 | files = (
233 | );
234 | inputFileListPaths = (
235 | "${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-resources-${CONFIGURATION}-input-files.xcfilelist",
236 | );
237 | name = "[CP] Copy Pods Resources";
238 | outputFileListPaths = (
239 | "${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-resources-${CONFIGURATION}-output-files.xcfilelist",
240 | );
241 | runOnlyForDeploymentPostprocessing = 0;
242 | shellPath = /bin/sh;
243 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BidirectionalFlatlistExample/Pods-BidirectionalFlatlistExample-resources.sh\"\n";
244 | showEnvVarsInLog = 0;
245 | };
246 | FD10A7F022414F080027D42C /* Start Packager */ = {
247 | isa = PBXShellScriptBuildPhase;
248 | buildActionMask = 2147483647;
249 | files = (
250 | );
251 | inputFileListPaths = (
252 | );
253 | inputPaths = (
254 | );
255 | name = "Start Packager";
256 | outputFileListPaths = (
257 | );
258 | outputPaths = (
259 | );
260 | runOnlyForDeploymentPostprocessing = 0;
261 | shellPath = /bin/sh;
262 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
263 | showEnvVarsInLog = 0;
264 | };
265 | /* End PBXShellScriptBuildPhase section */
266 |
267 | /* Begin PBXSourcesBuildPhase section */
268 | 13B07F871A680F5B00A75B9A /* Sources */ = {
269 | isa = PBXSourcesBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
273 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | /* End PBXSourcesBuildPhase section */
278 |
279 | /* Begin XCBuildConfiguration section */
280 | 13B07F941A680F5B00A75B9A /* Debug */ = {
281 | isa = XCBuildConfiguration;
282 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-BidirectionalFlatlistExample.debug.xcconfig */;
283 | buildSettings = {
284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
285 | CLANG_ENABLE_MODULES = YES;
286 | CURRENT_PROJECT_VERSION = 1;
287 | ENABLE_BITCODE = NO;
288 | INFOPLIST_FILE = BidirectionalFlatlistExample/Info.plist;
289 | LD_RUNPATH_SEARCH_PATHS = (
290 | "$(inherited)",
291 | "@executable_path/Frameworks",
292 | );
293 | OTHER_LDFLAGS = (
294 | "$(inherited)",
295 | "-ObjC",
296 | "-lc++",
297 | );
298 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativebidirectionalflatlist;
299 | PRODUCT_NAME = BidirectionalFlatlistExample;
300 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
301 | SWIFT_VERSION = 5.0;
302 | VERSIONING_SYSTEM = "apple-generic";
303 | };
304 | name = Debug;
305 | };
306 | 13B07F951A680F5B00A75B9A /* Release */ = {
307 | isa = XCBuildConfiguration;
308 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-BidirectionalFlatlistExample.release.xcconfig */;
309 | buildSettings = {
310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
311 | CLANG_ENABLE_MODULES = YES;
312 | CURRENT_PROJECT_VERSION = 1;
313 | INFOPLIST_FILE = BidirectionalFlatlistExample/Info.plist;
314 | LD_RUNPATH_SEARCH_PATHS = (
315 | "$(inherited)",
316 | "@executable_path/Frameworks",
317 | );
318 | OTHER_LDFLAGS = (
319 | "$(inherited)",
320 | "-ObjC",
321 | "-lc++",
322 | );
323 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativebidirectionalflatlist;
324 | PRODUCT_NAME = BidirectionalFlatlistExample;
325 | SWIFT_VERSION = 5.0;
326 | VERSIONING_SYSTEM = "apple-generic";
327 | };
328 | name = Release;
329 | };
330 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
331 | isa = XCBuildConfiguration;
332 | buildSettings = {
333 | ALWAYS_SEARCH_USER_PATHS = NO;
334 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
335 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
336 | CLANG_CXX_LIBRARY = "libc++";
337 | CLANG_ENABLE_MODULES = YES;
338 | CLANG_ENABLE_OBJC_ARC = YES;
339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
340 | CLANG_WARN_BOOL_CONVERSION = YES;
341 | CLANG_WARN_COMMA = YES;
342 | CLANG_WARN_CONSTANT_CONVERSION = YES;
343 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
345 | CLANG_WARN_EMPTY_BODY = YES;
346 | CLANG_WARN_ENUM_CONVERSION = YES;
347 | CLANG_WARN_INFINITE_RECURSION = YES;
348 | CLANG_WARN_INT_CONVERSION = YES;
349 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
350 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
351 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
352 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
353 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
355 | CLANG_WARN_STRICT_PROTOTYPES = YES;
356 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
357 | CLANG_WARN_UNREACHABLE_CODE = YES;
358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
360 | COPY_PHASE_STRIP = NO;
361 | ENABLE_STRICT_OBJC_MSGSEND = YES;
362 | ENABLE_TESTABILITY = YES;
363 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
364 | GCC_C_LANGUAGE_STANDARD = gnu99;
365 | GCC_DYNAMIC_NO_PIC = NO;
366 | GCC_NO_COMMON_BLOCKS = YES;
367 | GCC_OPTIMIZATION_LEVEL = 0;
368 | GCC_PREPROCESSOR_DEFINITIONS = (
369 | "DEBUG=1",
370 | "$(inherited)",
371 | );
372 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
375 | GCC_WARN_UNDECLARED_SELECTOR = YES;
376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
377 | GCC_WARN_UNUSED_FUNCTION = YES;
378 | GCC_WARN_UNUSED_VARIABLE = YES;
379 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
380 | LD_RUNPATH_SEARCH_PATHS = (
381 | /usr/lib/swift,
382 | "$(inherited)",
383 | );
384 | LIBRARY_SEARCH_PATHS = (
385 | "\"$(SDKROOT)/usr/lib/swift\"",
386 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
387 | "\"$(inherited)\"",
388 | );
389 | MTL_ENABLE_DEBUG_INFO = YES;
390 | ONLY_ACTIVE_ARCH = YES;
391 | OTHER_CPLUSPLUSFLAGS = (
392 | "$(OTHER_CFLAGS)",
393 | "-DFOLLY_NO_CONFIG",
394 | "-DFOLLY_MOBILE=1",
395 | "-DFOLLY_USE_LIBCPP=1",
396 | );
397 | SDKROOT = iphoneos;
398 | };
399 | name = Debug;
400 | };
401 | 83CBBA211A601CBA00E9B192 /* Release */ = {
402 | isa = XCBuildConfiguration;
403 | buildSettings = {
404 | ALWAYS_SEARCH_USER_PATHS = NO;
405 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
406 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
407 | CLANG_CXX_LIBRARY = "libc++";
408 | CLANG_ENABLE_MODULES = YES;
409 | CLANG_ENABLE_OBJC_ARC = YES;
410 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
411 | CLANG_WARN_BOOL_CONVERSION = YES;
412 | CLANG_WARN_COMMA = YES;
413 | CLANG_WARN_CONSTANT_CONVERSION = YES;
414 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
416 | CLANG_WARN_EMPTY_BODY = YES;
417 | CLANG_WARN_ENUM_CONVERSION = YES;
418 | CLANG_WARN_INFINITE_RECURSION = YES;
419 | CLANG_WARN_INT_CONVERSION = YES;
420 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
421 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
422 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
424 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
425 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
426 | CLANG_WARN_STRICT_PROTOTYPES = YES;
427 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
428 | CLANG_WARN_UNREACHABLE_CODE = YES;
429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
431 | COPY_PHASE_STRIP = YES;
432 | ENABLE_NS_ASSERTIONS = NO;
433 | ENABLE_STRICT_OBJC_MSGSEND = YES;
434 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
435 | GCC_C_LANGUAGE_STANDARD = gnu99;
436 | GCC_NO_COMMON_BLOCKS = YES;
437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
439 | GCC_WARN_UNDECLARED_SELECTOR = YES;
440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
441 | GCC_WARN_UNUSED_FUNCTION = YES;
442 | GCC_WARN_UNUSED_VARIABLE = YES;
443 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
444 | LD_RUNPATH_SEARCH_PATHS = (
445 | /usr/lib/swift,
446 | "$(inherited)",
447 | );
448 | LIBRARY_SEARCH_PATHS = (
449 | "\"$(SDKROOT)/usr/lib/swift\"",
450 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
451 | "\"$(inherited)\"",
452 | );
453 | MTL_ENABLE_DEBUG_INFO = NO;
454 | OTHER_CPLUSPLUSFLAGS = (
455 | "$(OTHER_CFLAGS)",
456 | "-DFOLLY_NO_CONFIG",
457 | "-DFOLLY_MOBILE=1",
458 | "-DFOLLY_USE_LIBCPP=1",
459 | );
460 | SDKROOT = iphoneos;
461 | VALIDATE_PRODUCT = YES;
462 | };
463 | name = Release;
464 | };
465 | /* End XCBuildConfiguration section */
466 |
467 | /* Begin XCConfigurationList section */
468 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BidirectionalFlatlistExample" */ = {
469 | isa = XCConfigurationList;
470 | buildConfigurations = (
471 | 13B07F941A680F5B00A75B9A /* Debug */,
472 | 13B07F951A680F5B00A75B9A /* Release */,
473 | );
474 | defaultConfigurationIsVisible = 0;
475 | defaultConfigurationName = Release;
476 | };
477 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "BidirectionalFlatlistExample" */ = {
478 | isa = XCConfigurationList;
479 | buildConfigurations = (
480 | 83CBBA201A601CBA00E9B192 /* Debug */,
481 | 83CBBA211A601CBA00E9B192 /* Release */,
482 | );
483 | defaultConfigurationIsVisible = 0;
484 | defaultConfigurationName = Release;
485 | };
486 | /* End XCConfigurationList section */
487 | };
488 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
489 | }
490 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost (1.76.0)
3 | - CocoaAsyncSocket (7.6.5)
4 | - DoubleConversion (1.1.6)
5 | - FBLazyVector (0.68.2)
6 | - FBReactNativeSpec (0.68.2):
7 | - RCT-Folly (= 2021.06.28.00-v2)
8 | - RCTRequired (= 0.68.2)
9 | - RCTTypeSafety (= 0.68.2)
10 | - React-Core (= 0.68.2)
11 | - React-jsi (= 0.68.2)
12 | - ReactCommon/turbomodule/core (= 0.68.2)
13 | - Flipper (0.125.0):
14 | - Flipper-Folly (~> 2.6)
15 | - Flipper-RSocket (~> 1.4)
16 | - Flipper-Boost-iOSX (1.76.0.1.11)
17 | - Flipper-DoubleConversion (3.2.0)
18 | - Flipper-Fmt (7.1.7)
19 | - Flipper-Folly (2.6.10):
20 | - Flipper-Boost-iOSX
21 | - Flipper-DoubleConversion
22 | - Flipper-Fmt (= 7.1.7)
23 | - Flipper-Glog
24 | - libevent (~> 2.1.12)
25 | - OpenSSL-Universal (= 1.1.1100)
26 | - Flipper-Glog (0.5.0.4)
27 | - Flipper-PeerTalk (0.0.4)
28 | - Flipper-RSocket (1.4.3):
29 | - Flipper-Folly (~> 2.6)
30 | - FlipperKit (0.125.0):
31 | - FlipperKit/Core (= 0.125.0)
32 | - FlipperKit/Core (0.125.0):
33 | - Flipper (~> 0.125.0)
34 | - FlipperKit/CppBridge
35 | - FlipperKit/FBCxxFollyDynamicConvert
36 | - FlipperKit/FBDefines
37 | - FlipperKit/FKPortForwarding
38 | - SocketRocket (~> 0.6.0)
39 | - FlipperKit/CppBridge (0.125.0):
40 | - Flipper (~> 0.125.0)
41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
42 | - Flipper-Folly (~> 2.6)
43 | - FlipperKit/FBDefines (0.125.0)
44 | - FlipperKit/FKPortForwarding (0.125.0):
45 | - CocoaAsyncSocket (~> 7.6)
46 | - Flipper-PeerTalk (~> 0.0.4)
47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0)
48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0):
49 | - FlipperKit/Core
50 | - FlipperKit/FlipperKitHighlightOverlay
51 | - FlipperKit/FlipperKitLayoutTextSearchable
52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
53 | - FlipperKit/Core
54 | - FlipperKit/FlipperKitHighlightOverlay
55 | - FlipperKit/FlipperKitLayoutHelpers
56 | - YogaKit (~> 1.18)
57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0):
58 | - FlipperKit/Core
59 | - FlipperKit/FlipperKitHighlightOverlay
60 | - FlipperKit/FlipperKitLayoutHelpers
61 | - FlipperKit/FlipperKitLayoutIOSDescriptors
62 | - FlipperKit/FlipperKitLayoutTextSearchable
63 | - YogaKit (~> 1.18)
64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0):
66 | - FlipperKit/Core
67 | - FlipperKit/FlipperKitReactPlugin (0.125.0):
68 | - FlipperKit/Core
69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
70 | - FlipperKit/Core
71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0):
72 | - FlipperKit/Core
73 | - FlipperKit/FlipperKitNetworkPlugin
74 | - fmt (6.2.1)
75 | - glog (0.3.5)
76 | - hermes-engine (0.11.0)
77 | - libevent (2.1.12)
78 | - OpenSSL-Universal (1.1.1100)
79 | - RCT-Folly (2021.06.28.00-v2):
80 | - boost
81 | - DoubleConversion
82 | - fmt (~> 6.2.1)
83 | - glog
84 | - RCT-Folly/Default (= 2021.06.28.00-v2)
85 | - RCT-Folly/Default (2021.06.28.00-v2):
86 | - boost
87 | - DoubleConversion
88 | - fmt (~> 6.2.1)
89 | - glog
90 | - RCT-Folly/Futures (2021.06.28.00-v2):
91 | - boost
92 | - DoubleConversion
93 | - fmt (~> 6.2.1)
94 | - glog
95 | - libevent
96 | - RCTRequired (0.68.2)
97 | - RCTTypeSafety (0.68.2):
98 | - FBLazyVector (= 0.68.2)
99 | - RCT-Folly (= 2021.06.28.00-v2)
100 | - RCTRequired (= 0.68.2)
101 | - React-Core (= 0.68.2)
102 | - React (0.68.2):
103 | - React-Core (= 0.68.2)
104 | - React-Core/DevSupport (= 0.68.2)
105 | - React-Core/RCTWebSocket (= 0.68.2)
106 | - React-RCTActionSheet (= 0.68.2)
107 | - React-RCTAnimation (= 0.68.2)
108 | - React-RCTBlob (= 0.68.2)
109 | - React-RCTImage (= 0.68.2)
110 | - React-RCTLinking (= 0.68.2)
111 | - React-RCTNetwork (= 0.68.2)
112 | - React-RCTSettings (= 0.68.2)
113 | - React-RCTText (= 0.68.2)
114 | - React-RCTVibration (= 0.68.2)
115 | - React-callinvoker (0.68.2)
116 | - React-Codegen (0.68.2):
117 | - FBReactNativeSpec (= 0.68.2)
118 | - RCT-Folly (= 2021.06.28.00-v2)
119 | - RCTRequired (= 0.68.2)
120 | - RCTTypeSafety (= 0.68.2)
121 | - React-Core (= 0.68.2)
122 | - React-jsi (= 0.68.2)
123 | - React-jsiexecutor (= 0.68.2)
124 | - ReactCommon/turbomodule/core (= 0.68.2)
125 | - React-Core (0.68.2):
126 | - glog
127 | - RCT-Folly (= 2021.06.28.00-v2)
128 | - React-Core/Default (= 0.68.2)
129 | - React-cxxreact (= 0.68.2)
130 | - React-jsi (= 0.68.2)
131 | - React-jsiexecutor (= 0.68.2)
132 | - React-perflogger (= 0.68.2)
133 | - Yoga
134 | - React-Core/CoreModulesHeaders (0.68.2):
135 | - glog
136 | - RCT-Folly (= 2021.06.28.00-v2)
137 | - React-Core/Default
138 | - React-cxxreact (= 0.68.2)
139 | - React-jsi (= 0.68.2)
140 | - React-jsiexecutor (= 0.68.2)
141 | - React-perflogger (= 0.68.2)
142 | - Yoga
143 | - React-Core/Default (0.68.2):
144 | - glog
145 | - RCT-Folly (= 2021.06.28.00-v2)
146 | - React-cxxreact (= 0.68.2)
147 | - React-jsi (= 0.68.2)
148 | - React-jsiexecutor (= 0.68.2)
149 | - React-perflogger (= 0.68.2)
150 | - Yoga
151 | - React-Core/DevSupport (0.68.2):
152 | - glog
153 | - RCT-Folly (= 2021.06.28.00-v2)
154 | - React-Core/Default (= 0.68.2)
155 | - React-Core/RCTWebSocket (= 0.68.2)
156 | - React-cxxreact (= 0.68.2)
157 | - React-jsi (= 0.68.2)
158 | - React-jsiexecutor (= 0.68.2)
159 | - React-jsinspector (= 0.68.2)
160 | - React-perflogger (= 0.68.2)
161 | - Yoga
162 | - React-Core/RCTActionSheetHeaders (0.68.2):
163 | - glog
164 | - RCT-Folly (= 2021.06.28.00-v2)
165 | - React-Core/Default
166 | - React-cxxreact (= 0.68.2)
167 | - React-jsi (= 0.68.2)
168 | - React-jsiexecutor (= 0.68.2)
169 | - React-perflogger (= 0.68.2)
170 | - Yoga
171 | - React-Core/RCTAnimationHeaders (0.68.2):
172 | - glog
173 | - RCT-Folly (= 2021.06.28.00-v2)
174 | - React-Core/Default
175 | - React-cxxreact (= 0.68.2)
176 | - React-jsi (= 0.68.2)
177 | - React-jsiexecutor (= 0.68.2)
178 | - React-perflogger (= 0.68.2)
179 | - Yoga
180 | - React-Core/RCTBlobHeaders (0.68.2):
181 | - glog
182 | - RCT-Folly (= 2021.06.28.00-v2)
183 | - React-Core/Default
184 | - React-cxxreact (= 0.68.2)
185 | - React-jsi (= 0.68.2)
186 | - React-jsiexecutor (= 0.68.2)
187 | - React-perflogger (= 0.68.2)
188 | - Yoga
189 | - React-Core/RCTImageHeaders (0.68.2):
190 | - glog
191 | - RCT-Folly (= 2021.06.28.00-v2)
192 | - React-Core/Default
193 | - React-cxxreact (= 0.68.2)
194 | - React-jsi (= 0.68.2)
195 | - React-jsiexecutor (= 0.68.2)
196 | - React-perflogger (= 0.68.2)
197 | - Yoga
198 | - React-Core/RCTLinkingHeaders (0.68.2):
199 | - glog
200 | - RCT-Folly (= 2021.06.28.00-v2)
201 | - React-Core/Default
202 | - React-cxxreact (= 0.68.2)
203 | - React-jsi (= 0.68.2)
204 | - React-jsiexecutor (= 0.68.2)
205 | - React-perflogger (= 0.68.2)
206 | - Yoga
207 | - React-Core/RCTNetworkHeaders (0.68.2):
208 | - glog
209 | - RCT-Folly (= 2021.06.28.00-v2)
210 | - React-Core/Default
211 | - React-cxxreact (= 0.68.2)
212 | - React-jsi (= 0.68.2)
213 | - React-jsiexecutor (= 0.68.2)
214 | - React-perflogger (= 0.68.2)
215 | - Yoga
216 | - React-Core/RCTSettingsHeaders (0.68.2):
217 | - glog
218 | - RCT-Folly (= 2021.06.28.00-v2)
219 | - React-Core/Default
220 | - React-cxxreact (= 0.68.2)
221 | - React-jsi (= 0.68.2)
222 | - React-jsiexecutor (= 0.68.2)
223 | - React-perflogger (= 0.68.2)
224 | - Yoga
225 | - React-Core/RCTTextHeaders (0.68.2):
226 | - glog
227 | - RCT-Folly (= 2021.06.28.00-v2)
228 | - React-Core/Default
229 | - React-cxxreact (= 0.68.2)
230 | - React-jsi (= 0.68.2)
231 | - React-jsiexecutor (= 0.68.2)
232 | - React-perflogger (= 0.68.2)
233 | - Yoga
234 | - React-Core/RCTVibrationHeaders (0.68.2):
235 | - glog
236 | - RCT-Folly (= 2021.06.28.00-v2)
237 | - React-Core/Default
238 | - React-cxxreact (= 0.68.2)
239 | - React-jsi (= 0.68.2)
240 | - React-jsiexecutor (= 0.68.2)
241 | - React-perflogger (= 0.68.2)
242 | - Yoga
243 | - React-Core/RCTWebSocket (0.68.2):
244 | - glog
245 | - RCT-Folly (= 2021.06.28.00-v2)
246 | - React-Core/Default (= 0.68.2)
247 | - React-cxxreact (= 0.68.2)
248 | - React-jsi (= 0.68.2)
249 | - React-jsiexecutor (= 0.68.2)
250 | - React-perflogger (= 0.68.2)
251 | - Yoga
252 | - React-CoreModules (0.68.2):
253 | - RCT-Folly (= 2021.06.28.00-v2)
254 | - RCTTypeSafety (= 0.68.2)
255 | - React-Codegen (= 0.68.2)
256 | - React-Core/CoreModulesHeaders (= 0.68.2)
257 | - React-jsi (= 0.68.2)
258 | - React-RCTImage (= 0.68.2)
259 | - ReactCommon/turbomodule/core (= 0.68.2)
260 | - React-cxxreact (0.68.2):
261 | - boost (= 1.76.0)
262 | - DoubleConversion
263 | - glog
264 | - RCT-Folly (= 2021.06.28.00-v2)
265 | - React-callinvoker (= 0.68.2)
266 | - React-jsi (= 0.68.2)
267 | - React-jsinspector (= 0.68.2)
268 | - React-logger (= 0.68.2)
269 | - React-perflogger (= 0.68.2)
270 | - React-runtimeexecutor (= 0.68.2)
271 | - React-hermes (0.68.2):
272 | - DoubleConversion
273 | - glog
274 | - hermes-engine
275 | - RCT-Folly (= 2021.06.28.00-v2)
276 | - RCT-Folly/Futures (= 2021.06.28.00-v2)
277 | - React-cxxreact (= 0.68.2)
278 | - React-jsi (= 0.68.2)
279 | - React-jsiexecutor (= 0.68.2)
280 | - React-jsinspector (= 0.68.2)
281 | - React-perflogger (= 0.68.2)
282 | - React-jsi (0.68.2):
283 | - boost (= 1.76.0)
284 | - DoubleConversion
285 | - glog
286 | - RCT-Folly (= 2021.06.28.00-v2)
287 | - React-jsi/Default (= 0.68.2)
288 | - React-jsi/Default (0.68.2):
289 | - boost (= 1.76.0)
290 | - DoubleConversion
291 | - glog
292 | - RCT-Folly (= 2021.06.28.00-v2)
293 | - React-jsiexecutor (0.68.2):
294 | - DoubleConversion
295 | - glog
296 | - RCT-Folly (= 2021.06.28.00-v2)
297 | - React-cxxreact (= 0.68.2)
298 | - React-jsi (= 0.68.2)
299 | - React-perflogger (= 0.68.2)
300 | - React-jsinspector (0.68.2)
301 | - React-logger (0.68.2):
302 | - glog
303 | - React-perflogger (0.68.2)
304 | - React-RCTActionSheet (0.68.2):
305 | - React-Core/RCTActionSheetHeaders (= 0.68.2)
306 | - React-RCTAnimation (0.68.2):
307 | - RCT-Folly (= 2021.06.28.00-v2)
308 | - RCTTypeSafety (= 0.68.2)
309 | - React-Codegen (= 0.68.2)
310 | - React-Core/RCTAnimationHeaders (= 0.68.2)
311 | - React-jsi (= 0.68.2)
312 | - ReactCommon/turbomodule/core (= 0.68.2)
313 | - React-RCTBlob (0.68.2):
314 | - RCT-Folly (= 2021.06.28.00-v2)
315 | - React-Codegen (= 0.68.2)
316 | - React-Core/RCTBlobHeaders (= 0.68.2)
317 | - React-Core/RCTWebSocket (= 0.68.2)
318 | - React-jsi (= 0.68.2)
319 | - React-RCTNetwork (= 0.68.2)
320 | - ReactCommon/turbomodule/core (= 0.68.2)
321 | - React-RCTImage (0.68.2):
322 | - RCT-Folly (= 2021.06.28.00-v2)
323 | - RCTTypeSafety (= 0.68.2)
324 | - React-Codegen (= 0.68.2)
325 | - React-Core/RCTImageHeaders (= 0.68.2)
326 | - React-jsi (= 0.68.2)
327 | - React-RCTNetwork (= 0.68.2)
328 | - ReactCommon/turbomodule/core (= 0.68.2)
329 | - React-RCTLinking (0.68.2):
330 | - React-Codegen (= 0.68.2)
331 | - React-Core/RCTLinkingHeaders (= 0.68.2)
332 | - React-jsi (= 0.68.2)
333 | - ReactCommon/turbomodule/core (= 0.68.2)
334 | - React-RCTNetwork (0.68.2):
335 | - RCT-Folly (= 2021.06.28.00-v2)
336 | - RCTTypeSafety (= 0.68.2)
337 | - React-Codegen (= 0.68.2)
338 | - React-Core/RCTNetworkHeaders (= 0.68.2)
339 | - React-jsi (= 0.68.2)
340 | - ReactCommon/turbomodule/core (= 0.68.2)
341 | - React-RCTSettings (0.68.2):
342 | - RCT-Folly (= 2021.06.28.00-v2)
343 | - RCTTypeSafety (= 0.68.2)
344 | - React-Codegen (= 0.68.2)
345 | - React-Core/RCTSettingsHeaders (= 0.68.2)
346 | - React-jsi (= 0.68.2)
347 | - ReactCommon/turbomodule/core (= 0.68.2)
348 | - React-RCTText (0.68.2):
349 | - React-Core/RCTTextHeaders (= 0.68.2)
350 | - React-RCTVibration (0.68.2):
351 | - RCT-Folly (= 2021.06.28.00-v2)
352 | - React-Codegen (= 0.68.2)
353 | - React-Core/RCTVibrationHeaders (= 0.68.2)
354 | - React-jsi (= 0.68.2)
355 | - ReactCommon/turbomodule/core (= 0.68.2)
356 | - React-runtimeexecutor (0.68.2):
357 | - React-jsi (= 0.68.2)
358 | - ReactCommon/turbomodule/core (0.68.2):
359 | - DoubleConversion
360 | - glog
361 | - RCT-Folly (= 2021.06.28.00-v2)
362 | - React-callinvoker (= 0.68.2)
363 | - React-Core (= 0.68.2)
364 | - React-cxxreact (= 0.68.2)
365 | - React-jsi (= 0.68.2)
366 | - React-logger (= 0.68.2)
367 | - React-perflogger (= 0.68.2)
368 | - RNReanimated (2.10.0):
369 | - DoubleConversion
370 | - FBLazyVector
371 | - FBReactNativeSpec
372 | - glog
373 | - RCT-Folly
374 | - RCTRequired
375 | - RCTTypeSafety
376 | - React-callinvoker
377 | - React-Core
378 | - React-Core/DevSupport
379 | - React-Core/RCTWebSocket
380 | - React-CoreModules
381 | - React-cxxreact
382 | - React-jsi
383 | - React-jsiexecutor
384 | - React-jsinspector
385 | - React-RCTActionSheet
386 | - React-RCTAnimation
387 | - React-RCTBlob
388 | - React-RCTImage
389 | - React-RCTLinking
390 | - React-RCTNetwork
391 | - React-RCTSettings
392 | - React-RCTText
393 | - ReactCommon/turbomodule/core
394 | - Yoga
395 | - SocketRocket (0.6.0)
396 | - Yoga (1.14.0)
397 | - YogaKit (1.18.1):
398 | - Yoga (~> 1.14)
399 |
400 | DEPENDENCIES:
401 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
402 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
403 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
404 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
405 | - Flipper (= 0.125.0)
406 | - Flipper-Boost-iOSX (= 1.76.0.1.11)
407 | - Flipper-DoubleConversion (= 3.2.0)
408 | - Flipper-Fmt (= 7.1.7)
409 | - Flipper-Folly (= 2.6.10)
410 | - Flipper-Glog (= 0.5.0.4)
411 | - Flipper-PeerTalk (= 0.0.4)
412 | - Flipper-RSocket (= 1.4.3)
413 | - FlipperKit (= 0.125.0)
414 | - FlipperKit/Core (= 0.125.0)
415 | - FlipperKit/CppBridge (= 0.125.0)
416 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
417 | - FlipperKit/FBDefines (= 0.125.0)
418 | - FlipperKit/FKPortForwarding (= 0.125.0)
419 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
420 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
421 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
422 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
423 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0)
424 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
425 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
426 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
427 | - hermes-engine (~> 0.11.0)
428 | - libevent (~> 2.1.12)
429 | - OpenSSL-Universal (= 1.1.1100)
430 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
431 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
432 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
433 | - React (from `../node_modules/react-native/`)
434 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
435 | - React-Codegen (from `build/generated/ios`)
436 | - React-Core (from `../node_modules/react-native/`)
437 | - React-Core/DevSupport (from `../node_modules/react-native/`)
438 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
439 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
440 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
441 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
442 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
443 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
444 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
445 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`)
446 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
447 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
448 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
449 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
450 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
451 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
452 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
453 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
454 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
455 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
456 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
457 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
458 | - RNReanimated (from `../node_modules/react-native-reanimated`)
459 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
460 |
461 | SPEC REPOS:
462 | trunk:
463 | - CocoaAsyncSocket
464 | - Flipper
465 | - Flipper-Boost-iOSX
466 | - Flipper-DoubleConversion
467 | - Flipper-Fmt
468 | - Flipper-Folly
469 | - Flipper-Glog
470 | - Flipper-PeerTalk
471 | - Flipper-RSocket
472 | - FlipperKit
473 | - fmt
474 | - hermes-engine
475 | - libevent
476 | - OpenSSL-Universal
477 | - SocketRocket
478 | - YogaKit
479 |
480 | EXTERNAL SOURCES:
481 | boost:
482 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
483 | DoubleConversion:
484 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
485 | FBLazyVector:
486 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
487 | FBReactNativeSpec:
488 | :path: "../node_modules/react-native/React/FBReactNativeSpec"
489 | glog:
490 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
491 | RCT-Folly:
492 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
493 | RCTRequired:
494 | :path: "../node_modules/react-native/Libraries/RCTRequired"
495 | RCTTypeSafety:
496 | :path: "../node_modules/react-native/Libraries/TypeSafety"
497 | React:
498 | :path: "../node_modules/react-native/"
499 | React-callinvoker:
500 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
501 | React-Codegen:
502 | :path: build/generated/ios
503 | React-Core:
504 | :path: "../node_modules/react-native/"
505 | React-CoreModules:
506 | :path: "../node_modules/react-native/React/CoreModules"
507 | React-cxxreact:
508 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
509 | React-hermes:
510 | :path: "../node_modules/react-native/ReactCommon/hermes"
511 | React-jsi:
512 | :path: "../node_modules/react-native/ReactCommon/jsi"
513 | React-jsiexecutor:
514 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
515 | React-jsinspector:
516 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
517 | React-logger:
518 | :path: "../node_modules/react-native/ReactCommon/logger"
519 | React-perflogger:
520 | :path: "../node_modules/react-native/ReactCommon/reactperflogger"
521 | React-RCTActionSheet:
522 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
523 | React-RCTAnimation:
524 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
525 | React-RCTBlob:
526 | :path: "../node_modules/react-native/Libraries/Blob"
527 | React-RCTImage:
528 | :path: "../node_modules/react-native/Libraries/Image"
529 | React-RCTLinking:
530 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
531 | React-RCTNetwork:
532 | :path: "../node_modules/react-native/Libraries/Network"
533 | React-RCTSettings:
534 | :path: "../node_modules/react-native/Libraries/Settings"
535 | React-RCTText:
536 | :path: "../node_modules/react-native/Libraries/Text"
537 | React-RCTVibration:
538 | :path: "../node_modules/react-native/Libraries/Vibration"
539 | React-runtimeexecutor:
540 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
541 | ReactCommon:
542 | :path: "../node_modules/react-native/ReactCommon"
543 | RNReanimated:
544 | :path: "../node_modules/react-native-reanimated"
545 | Yoga:
546 | :path: "../node_modules/react-native/ReactCommon/yoga"
547 |
548 | SPEC CHECKSUMS:
549 | boost: a7c83b31436843459a1961bfd74b96033dc77234
550 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
551 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
552 | FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648
553 | FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
554 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
555 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
556 | Flipper-DoubleConversion: 3d3d04a078d4f3a1b6c6916587f159dc11f232c4
557 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
558 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
559 | Flipper-Glog: 87bc98ff48de90cb5b0b5114ed3da79d85ee2dd4
560 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
561 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
562 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
563 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
564 | glog: 476ee3e89abb49e07f822b48323c51c57124b572
565 | hermes-engine: 84e3af1ea01dd7351ac5d8689cbbea1f9903ffc3
566 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
567 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
568 | RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
569 | RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0
570 | RCTTypeSafety: c43c072a4bd60feb49a9570b0517892b4305c45e
571 | React: 176dd882de001854ced260fad41bb68a31aa4bd0
572 | React-callinvoker: c2864d1818d6e64928d2faf774a3800dfc38fe1f
573 | React-Codegen: 98b6f97f0a7abf7d67e4ce435c77c05b7a95cf05
574 | React-Core: fdaa2916b1c893f39f02cff0476d1fb0cab1e352
575 | React-CoreModules: fd8705b80699ec36c2cdd635c2ce9d874b9cfdfc
576 | React-cxxreact: 1832d971f7b0cb2c7b943dc0ec962762c90c906e
577 | React-hermes: 14e0ea3ce4b44bb3ac7663d96d0e3e28857f7b62
578 | React-jsi: 72af715135abe8c3f0dcf3b2548b71d048b69a7e
579 | React-jsiexecutor: b7b553412f2ec768fe6c8f27cd6bafdb9d8719e6
580 | React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8
581 | React-logger: a0833912d93b36b791b7a521672d8ee89107aff1
582 | React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6
583 | React-RCTActionSheet: 547fe42fdb4b6089598d79f8e1d855d7c23e2162
584 | React-RCTAnimation: bc9440a1c37b06ae9ebbb532d244f607805c6034
585 | React-RCTBlob: a1295c8e183756d7ef30ba6e8f8144dfe8a19215
586 | React-RCTImage: a30d1ee09b1334067fbb6f30789aae2d7ac150c9
587 | React-RCTLinking: ffc6d5b88d1cb9aca13c54c2ec6507fbf07f2ac4
588 | React-RCTNetwork: f807a2facab6cf5cf36d592e634611de9cf12d81
589 | React-RCTSettings: 861806819226ed8332e6a8f90df2951a34bb3e7f
590 | React-RCTText: f3fb464cc41a50fc7a1aba4deeb76a9ad8282cb9
591 | React-RCTVibration: 79040b92bfa9c3c2d2cb4f57e981164ec7ab9374
592 | React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23
593 | ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2
594 | RNReanimated: 5bdcbcc3a72aedeee7bb099604262403aa75a1e5
595 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
596 | Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
597 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
598 |
599 | PODFILE CHECKSUM: 9a1bdf129e16ee315920cdc24f05564410109c4c
600 |
601 | COCOAPODS: 1.11.2
602 |
--------------------------------------------------------------------------------