Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump example apps to React Native 0.77 #6768

Merged
merged 48 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
93578ee
Refactor findNodeHandler
piaskowyk Nov 20, 2024
a4204f0
Update Fabric
piaskowyk Nov 20, 2024
37b6c87
Update events
piaskowyk Nov 22, 2024
835aca5
Linter
piaskowyk Nov 22, 2024
43305eb
Improvements after review
piaskowyk Nov 22, 2024
f699fb7
Conditions reorder
piaskowyk Nov 22, 2024
fdeee9f
Improvements after review
piaskowyk Nov 22, 2024
44fe723
Improve Fabric-Paper compatibility
piaskowyk Nov 22, 2024
c169616
Remove console log
piaskowyk Nov 22, 2024
3808092
Merge
piaskowyk Nov 22, 2024
6a0c4c6
Improvements
piaskowyk Nov 25, 2024
9413ae6
Bump React Native to 0.77.0-rc.0
tomekzaw Nov 27, 2024
ab851ae
Merge branch '@piaskowyk/findnodehandler-refactor' into @tomekzaw/rea…
tomekzaw Nov 27, 2024
7071b12
Run fabric-example on iOS
tomekzaw Nov 28, 2024
02191d9
Run paper-example on Android
tomekzaw Nov 28, 2024
8b21948
Try to run fabric-example on Android
tomekzaw Nov 29, 2024
65c4242
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Dec 7, 2024
954fdbd
Fix module override error on Android
tomekzaw Dec 8, 2024
7068334
Bump react-native to 0.77.0-rc.1
tomekzaw Dec 8, 2024
a885763
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Dec 10, 2024
1878fa9
Bump react-native to 0.77.0-rc.2
tomekzaw Dec 10, 2024
7c8c53a
Bump react-native to 0.77.0-rc.3
tomekzaw Dec 18, 2024
f3720b4
Bump react-native to 0.77.0-rc.5
tomekzaw Dec 31, 2024
02f4cd3
Bump react-native to 0.77.0-rc.6
tomekzaw Jan 7, 2025
c9ff363
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 8, 2025
93c9163
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 8, 2025
96093a1
Remove unnecessary import
tomekzaw Jan 8, 2025
30b1aaa
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 9, 2025
8375134
Restore `get` instead of `getEnforcing`
tomekzaw Jan 9, 2025
214d0d3
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 10, 2025
38ee9d2
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 10, 2025
d8bdae0
Restore app dependencies
tomekzaw Jan 10, 2025
bc163e5
Patch react-native-gesture-handler
tomekzaw Jan 10, 2025
d9f6dcc
Patch RNGestureHandlerPackage.kt
tomekzaw Jan 10, 2025
13005b4
Add nullcheck
piaskowyk Jan 10, 2025
c9eb1c0
Patch FlashList to fix `scrollTo` from UI thread
tomekzaw Jan 10, 2025
e864e7f
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 10, 2025
82a0c47
Bump react-native-screens to 4.5.0
tomekzaw Jan 10, 2025
717a75f
Add missing `@stylexjs/babel-plugin` in web-example
tomekzaw Jan 10, 2025
1423f96
Bump react-native-gesture-handler to 2.22.0
tomekzaw Jan 10, 2025
eaff01f
Update patch for `@shopify/flash-list` to fix building on RN 0.77
tomekzaw Jan 10, 2025
49b80a4
Restore common-app in paper-example
tomekzaw Jan 10, 2025
af1393a
Remove unused patch for react-native-gesture-handler
tomekzaw Jan 10, 2025
a57e13c
Update yarn.lock
tomekzaw Jan 10, 2025
149ec6c
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 10, 2025
4668987
Remove duplicate AppDelegate.swift in fabric-example
tomekzaw Jan 12, 2025
e30d134
Remove duplicate AppDelegate.swift in paper-example
tomekzaw Jan 12, 2025
e4d8ad3
Merge branch 'main' into @tomekzaw/react-native-0.77
tomekzaw Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improvements
  • Loading branch information
piaskowyk committed Nov 25, 2024
commit 6a0c4c6caea59f4b6ad818ff5169ab51f4333402
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Platform } from 'react-native';
import '../layoutReanimation/animationsManager';
import invariant from 'invariant';
import { adaptViewConfig } from '../ConfigHelper';
import { findHostInstance } from '../platform-specific/RNRenderer';
import { findHostInstance } from '../platform-specific/findHostInstance';
import { enableLayoutAnimations } from '../core';
import { SharedTransition } from '../layoutReanimation';
import { LayoutAnimationType } from '../commonTypes';
Expand Down Expand Up @@ -497,7 +497,7 @@ export function createAnimatedComponent(
>,
setLocalRef: (ref) => {
if (!ref) {
// component is unmounted
// component has been unmounted
return;
}
if (ref !== this._componentRef) {
Expand Down
7 changes: 5 additions & 2 deletions packages/react-native-reanimated/src/fabricUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
/* eslint-disable */

import type { ShadowNodeWrapper } from './commonTypes';
import { findHostInstance } from './platform-specific/RNRenderer';
import {
findHostInstance,
HostInstance,
} from './platform-specific/findHostInstance';

let getInternalInstanceHandleFromPublicInstance: (ref: unknown) => {
stateNode: { node: unknown };
};

export function getShadowNodeWrapperFromRef(
ref: React.Component,
hostInstance?: unknown
hostInstance?: HostInstance
): ShadowNodeWrapper {
if (getInternalInstanceHandleFromPublicInstance === undefined) {
try {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* eslint-disable camelcase */
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
'use strict';

import type { IAnimatedComponentInternal } from '../createAnimatedComponent/commonTypes';
import { ReanimatedError } from '../errors';
import { isFabric } from '../PlatformChecker';

export type HostInstance = {
// Fabric fields
__internalInstanceHandle?: Record<string, unknown>;
__nativeTag?: number;
_viewConfig?: Record<string, unknown>;
// Paper fields
_nativeTag?: number;
viewConfig?: Record<string, unknown>;
};

function findHostInstanceFastPath(maybeNativeRef: HostInstance) {
if (
maybeNativeRef.__internalInstanceHandle &&
maybeNativeRef.__nativeTag &&
maybeNativeRef._viewConfig
) {
// This is a native ref to a Fabric component
return maybeNativeRef;
}
if (maybeNativeRef._nativeTag && maybeNativeRef.viewConfig) {
// This is a native ref to a Paper component
return maybeNativeRef;
}
// That means it’s a ref to a non-native component, and it’s necessary
// to call `findHostInstance_DEPRECATED` on them.
return undefined;
}

function resolveFindHostInstance_DEPRECATED() {
if (findHostInstance_DEPRECATED !== undefined) {
return;
}
if (isFabric()) {
try {
findHostInstance_DEPRECATED =
require('react-native/Libraries/Renderer/shims/ReactFabric').findHostInstance_DEPRECATED;
} catch (e) {
throw new ReanimatedError(
'Failed to resolve findHostInstance_DEPRECATED'
);
}
} else {
findHostInstance_DEPRECATED =
require('react-native/Libraries/Renderer/shims/ReactNative').findHostInstance_DEPRECATED;
}
}

let findHostInstance_DEPRECATED: (ref: unknown) => HostInstance;
export function findHostInstance(
component: IAnimatedComponentInternal | React.Component
): HostInstance {
// Fast path for native refs
const hostInstance = findHostInstanceFastPath(
(component as IAnimatedComponentInternal)._componentRef as HostInstance
);
if (hostInstance !== undefined) {
return hostInstance;
}

resolveFindHostInstance_DEPRECATED();
// Fabric implementation of findHostInstance_DEPRECATED doesn't accept a ref as an argument
return findHostInstance_DEPRECATED(
isFabric()
? component
: (component as IAnimatedComponentInternal)._componentRef
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

export function findHostInstance(_component: any): void {}