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

Add support for React Native 0.74 #5815

Merged
merged 42 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4f2a40d
feat: update codebase
WoLewicki Feb 27, 2024
ac05330
chore: bump to rc1
WoLewicki Mar 1, 2024
76032a7
feat: all changes at once
WoLewicki Mar 1, 2024
2414a5b
feat: compat with old arch and 73
WoLewicki Mar 1, 2024
03ab7db
fix: use nativeState only if it is already available
WoLewicki Mar 1, 2024
2934057
restore proper code on Android
WoLewicki Mar 5, 2024
7276085
fix: inline fabric check
WoLewicki Mar 11, 2024
9f784d8
restore migrated libs to example and make ts work
WoLewicki Mar 11, 2024
043f74e
fix: quick fix for scrollviews
WoLewicki Mar 11, 2024
e5a24cf
chore: merge current main
WoLewicki Mar 11, 2024
4725d56
feat: merge changes from other PRs
WoLewicki Mar 19, 2024
d28993e
Fixes for Reanimated with Bridgeless (#5807)
tjzel Mar 20, 2024
3f8669c
still some screens issue on andrewid
tjzel Mar 20, 2024
a547079
WIP
tjzel Mar 21, 2024
4b6e3e5
isBridgeless
tjzel Mar 21, 2024
2e854ec
Merge branch '@tjzel/0.74' into @wolewicki/bridgeless-mode-with-runti…
tjzel Mar 21, 2024
4e3405f
fix iOS double event
tjzel Mar 24, 2024
194b99e
Merge branch '@tjzel/wolewosvgpls' into @tjzel/0.74
tjzel Mar 24, 2024
bd51be5
remove accidentally pulled changes from bridgeless
tjzel Mar 25, 2024
9fa93a1
mergele main
tjzel Mar 25, 2024
076c74f
init
tjzel Mar 25, 2024
ad4e27c
Merge branch '@tjzel/app-for-0.74' into @tjzel/0.74
tjzel Mar 25, 2024
8a0eb52
review changes
tjzel Mar 25, 2024
eb8790b
latest
tjzel Mar 25, 2024
b472251
many change
tjzel Mar 25, 2024
db03e9d
button
tjzel Mar 25, 2024
c8a1a1f
Merge branch '@tjzel/app-for-0.74' into @tjzel/0.74
tjzel Mar 25, 2024
f38b7f1
fix web example CI
tjzel Mar 26, 2024
c653371
fix andrewid"
tjzel Mar 26, 2024
0e11a89
Merge branch '@tjzel/app-for-0.74' into @tjzel/0.74
tjzel Mar 26, 2024
c76e29e
fix andrewid for good"
tjzel Mar 26, 2024
a51c0f7
review changes
tjzel Mar 26, 2024
1b43db3
use strict
tjzel Mar 26, 2024
f768047
piker piker
tjzel Mar 26, 2024
88f5a06
review changes for examples
tjzel Mar 26, 2024
489d4ab
Merge branch '@tjzel/app-for-0.74' into @tjzel/0.74
tjzel Mar 26, 2024
018bd0d
cleanup in android sources
tjzel Mar 26, 2024
2f2bfa8
format
tjzel Mar 26, 2024
d52773e
Replace var with standard types
piaskowyk Mar 26, 2024
17d64b8
remove patches older than 0.71 for android
tjzel Mar 27, 2024
7a23bcc
allow for nativeTag=0
tjzel Mar 27, 2024
c7e0064
Merge branch 'main' into @tjzel/0.74
tjzel Mar 27, 2024
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
4 changes: 3 additions & 1 deletion Common/cpp/Fabric/ShadowTreeCloner.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifdef RCT_NEW_ARCH_ENABLED

#include <utility>

#include "ShadowTreeCloner.h"

namespace reanimated {
Expand All @@ -22,7 +24,7 @@ ShadowNode::Unshared cloneShadowTreeWithNewProps(
PropsParserContext propsParserContext{
source->getSurfaceId(), *source->getContextContainer()};
const auto props = source->getComponentDescriptor().cloneProps(
propsParserContext, source->getProps(), rawProps);
propsParserContext, source->getProps(), std::move(rawProps));

auto newChildNode = source->clone({/* .props = */ props});

Expand Down
14 changes: 6 additions & 8 deletions Common/cpp/NativeModules/NativeReanimatedModule.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "NativeReanimatedModule.h"

#ifdef RCT_NEW_ARCH_ENABLED
#if REACT_NATIVE_MINOR_VERSION >= 72
#include <react/renderer/core/TraitCast.h>
#endif
tjzel marked this conversation as resolved.
Show resolved Hide resolved
#include <react/renderer/uimanager/UIManagerBinding.h>
#include <react/renderer/uimanager/primitives.h>
#if REACT_NATIVE_MINOR_VERSION >= 73 && defined(RCT_NEW_ARCH_ENABLED)
Expand Down Expand Up @@ -40,7 +37,7 @@

using namespace facebook;

#if REACT_NATIVE_MINOR_VERSION >= 73 && defined(RCT_NEW_ARCH_ENABLED)
#if REACT_NATIVE_MINOR_VERSION == 73 && defined(RCT_NEW_ARCH_ENABLED)
// Android can't find the definition of this static field
bool CoreFeatures::useNativeState;
#endif
Expand Down Expand Up @@ -88,7 +85,8 @@ NativeReanimatedModule::NativeReanimatedModule(
subscribeForKeyboardEventsFunction_(
platformDepMethodsHolder.subscribeForKeyboardEvents),
unsubscribeFromKeyboardEventsFunction_(
platformDepMethodsHolder.unsubscribeFromKeyboardEvents) {
platformDepMethodsHolder.unsubscribeFromKeyboardEvents),
isBridgeless_(jsInvoker == nullptr) {
tjzel marked this conversation as resolved.
Show resolved Hide resolved
auto requestAnimationFrame =
[this](jsi::Runtime &rt, const jsi::Value &callback) {
this->requestAnimationFrame(rt, callback);
Expand Down Expand Up @@ -261,8 +259,8 @@ std::string NativeReanimatedModule::obtainPropFromShadowNode(
if (propName == "width" || propName == "height" || propName == "top" ||
propName == "left") {
// These props are calculated from frame
auto layoutableShadowNode =
traitCast<LayoutableShadowNode const *>(newestCloneOfShadowNode.get());
auto layoutableShadowNode = dynamic_cast<LayoutableShadowNode const *>(
newestCloneOfShadowNode.get());
const auto &frame = layoutableShadowNode->layoutMetrics_.frame;

if (propName == "width") {
Expand Down Expand Up @@ -772,7 +770,7 @@ jsi::Value NativeReanimatedModule::measure(
uiManager_->getNewestCloneOfShadowNode(*shadowNode);

auto layoutableShadowNode =
traitCast<LayoutableShadowNode const *>(newestCloneOfShadowNode.get());
dynamic_cast<LayoutableShadowNode const *>(newestCloneOfShadowNode.get());
tjzel marked this conversation as resolved.
Show resolved Hide resolved
facebook::react::Point originRelativeToParent =
layoutableShadowNode != nullptr
? layoutableShadowNode->getLayoutMetrics().frame.origin
Expand Down
5 changes: 5 additions & 0 deletions Common/cpp/NativeModules/NativeReanimatedModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
return uiWorkletRuntime_->getJSIRuntime();
}

inline bool isBridgeless() const {
return isBridgeless_;
}

private:
void requestAnimationFrame(jsi::Runtime &rt, const jsi::Value &callback);

Expand Down Expand Up @@ -226,6 +230,7 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
#ifndef NDEBUG
SingleInstanceChecker<NativeReanimatedModule> singleInstanceChecker_;
#endif
const bool isBridgeless_;
};

} // namespace reanimated
3 changes: 3 additions & 0 deletions Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ void RNRuntimeDecorator::decorate(
#endif // RCT_NEW_ARCH_ENABLED
rnRuntime.global().setProperty(rnRuntime, "_IS_FABRIC", isFabric);

rnRuntime.global().setProperty(
rnRuntime, "_IS_BRIDGELESS", nativeReanimatedModule->isBridgeless());

#ifndef NDEBUG
checkJSVersion(rnRuntime, nativeReanimatedModule->getJSLogger());
#endif // NDEBUG
Expand Down
Loading
Loading