react-native 0.85.1 → 0.85.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTDevLoadingView.mm +17 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +4 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +58 -25
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +9 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +5 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +1 -0
- package/package.json +9 -9
package/React/Base/RCTVersion.m
CHANGED
|
@@ -51,10 +51,27 @@ RCT_EXPORT_MODULE()
|
|
|
51
51
|
selector:@selector(hide)
|
|
52
52
|
name:RCTJavaScriptDidFailToLoadNotification
|
|
53
53
|
object:nil];
|
|
54
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
55
|
+
selector:@selector(hide)
|
|
56
|
+
name:@"RCTInstanceDidLoadBundle"
|
|
57
|
+
object:nil];
|
|
54
58
|
}
|
|
55
59
|
return self;
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
- (void)dealloc
|
|
63
|
+
{
|
|
64
|
+
[self clearInitialMessageDelay];
|
|
65
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
66
|
+
UIWindow *window = _window;
|
|
67
|
+
_window = nil;
|
|
68
|
+
if (window) {
|
|
69
|
+
RCTExecuteOnMainQueue(^{
|
|
70
|
+
window.hidden = YES;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
+ (void)setEnabled:(BOOL)enabled
|
|
59
76
|
{
|
|
60
77
|
RCTDevLoadingViewSetEnabled(enabled);
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
#define REACT_NATIVE_VERSION_MAJOR 0
|
|
16
16
|
#define REACT_NATIVE_VERSION_MINOR 85
|
|
17
|
-
#define REACT_NATIVE_VERSION_PATCH
|
|
17
|
+
#define REACT_NATIVE_VERSION_PATCH 2
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
21
|
struct ReactNativeVersionType {
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 85;
|
|
24
|
-
int32_t Patch =
|
|
24
|
+
int32_t Patch = 2;
|
|
25
25
|
std::string_view Prerelease = "";
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -515,7 +515,10 @@ void NativeAnimatedNodesManager::handleAnimatedEvent(
|
|
|
515
515
|
// frames.
|
|
516
516
|
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
|
|
517
517
|
if (auto animationBackend = animationBackend_.lock()) {
|
|
518
|
-
animationBackend->
|
|
518
|
+
animationBackend->pushAnimationMutations(
|
|
519
|
+
[this](AnimationTimestamp timestamp) -> AnimationMutations {
|
|
520
|
+
return pullAnimationMutations(timestamp);
|
|
521
|
+
});
|
|
519
522
|
}
|
|
520
523
|
} else {
|
|
521
524
|
onRender();
|
|
@@ -24,10 +24,17 @@ static inline Props::Shared cloneProps(
|
|
|
24
24
|
shadowNode.getSurfaceId(), *shadowNode.getContextContainer()};
|
|
25
25
|
Props::Shared newProps;
|
|
26
26
|
if (animatedProps.rawProps) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (ReactNativeFeatureFlags::enableFabricCommitBranching()) {
|
|
28
|
+
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
29
|
+
propsParserContext,
|
|
30
|
+
shadowNode.getProps(),
|
|
31
|
+
std::move(*animatedProps.rawProps));
|
|
32
|
+
} else {
|
|
33
|
+
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
34
|
+
propsParserContext,
|
|
35
|
+
shadowNode.getProps(),
|
|
36
|
+
RawProps(*animatedProps.rawProps));
|
|
37
|
+
}
|
|
31
38
|
} else {
|
|
32
39
|
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
33
40
|
propsParserContext, shadowNode.getProps(), {});
|
|
@@ -51,31 +58,27 @@ AnimationBackend::AnimationBackend(
|
|
|
51
58
|
react_native_assert(uiManager_.expired() == false);
|
|
52
59
|
}
|
|
53
60
|
|
|
54
|
-
void AnimationBackend::
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
void AnimationBackend::unpackMutations(
|
|
62
|
+
AnimationMutations& mutations,
|
|
63
|
+
std::unordered_map<SurfaceId, SurfaceUpdates>& surfaceUpdates,
|
|
64
|
+
std::set<SurfaceId>& asyncFlushSurfaces) {
|
|
65
|
+
for (auto& mutation : mutations.batch) {
|
|
66
|
+
const auto family = mutation.family;
|
|
67
|
+
react_native_assert(family != nullptr);
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
auto& [families, updates, hasLayoutUpdates] =
|
|
70
|
+
surfaceUpdates[family->getSurfaceId()];
|
|
71
|
+
hasLayoutUpdates |= mutation.hasLayoutUpdates;
|
|
72
|
+
families.insert(family);
|
|
73
|
+
updates[mutation.tag] = std::move(mutation.props);
|
|
62
74
|
}
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
asyncFlushSurfaces.merge(mutations.asyncFlushSurfaces);
|
|
67
|
-
for (auto& mutation : mutations.batch) {
|
|
68
|
-
const auto family = mutation.family;
|
|
69
|
-
react_native_assert(family != nullptr);
|
|
70
|
-
|
|
71
|
-
auto& [families, updates, hasLayoutUpdates] =
|
|
72
|
-
surfaceUpdates[family->getSurfaceId()];
|
|
73
|
-
hasLayoutUpdates |= mutation.hasLayoutUpdates;
|
|
74
|
-
families.insert(family);
|
|
75
|
-
updates[mutation.tag] = std::move(mutation.props);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
76
|
+
asyncFlushSurfaces.merge(mutations.asyncFlushSurfaces);
|
|
77
|
+
}
|
|
78
78
|
|
|
79
|
+
void AnimationBackend::applySurfaceUpdates(
|
|
80
|
+
std::unordered_map<SurfaceId, SurfaceUpdates>& surfaceUpdates,
|
|
81
|
+
const std::set<SurfaceId>& asyncFlushSurfaces) {
|
|
79
82
|
animatedPropsRegistry_->update(surfaceUpdates);
|
|
80
83
|
|
|
81
84
|
for (auto& [surfaceId, updates] : surfaceUpdates) {
|
|
@@ -89,6 +92,30 @@ void AnimationBackend::onAnimationFrame(AnimationTimestamp timestamp) {
|
|
|
89
92
|
requestAsyncFlushForSurfaces(asyncFlushSurfaces);
|
|
90
93
|
}
|
|
91
94
|
|
|
95
|
+
void AnimationBackend::applyMutations(AnimationMutations mutations) {
|
|
96
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> surfaceUpdates;
|
|
97
|
+
std::set<SurfaceId> asyncFlushSurfaces;
|
|
98
|
+
unpackMutations(mutations, surfaceUpdates, asyncFlushSurfaces);
|
|
99
|
+
applySurfaceUpdates(surfaceUpdates, asyncFlushSurfaces);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void AnimationBackend::onAnimationFrame(AnimationTimestamp timestamp) {
|
|
103
|
+
std::vector<CallbackWithId> callbacksCopy;
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
std::lock_guard lock(mutex_);
|
|
107
|
+
callbacksCopy = callbacks;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> surfaceUpdates;
|
|
111
|
+
std::set<SurfaceId> asyncFlushSurfaces;
|
|
112
|
+
for (auto& callbackWithId : callbacksCopy) {
|
|
113
|
+
auto mutations = callbackWithId.callback(timestamp);
|
|
114
|
+
unpackMutations(mutations, surfaceUpdates, asyncFlushSurfaces);
|
|
115
|
+
}
|
|
116
|
+
applySurfaceUpdates(surfaceUpdates, asyncFlushSurfaces);
|
|
117
|
+
}
|
|
118
|
+
|
|
92
119
|
CallbackId AnimationBackend::start(const Callback& callback) {
|
|
93
120
|
std::lock_guard lock(mutex_);
|
|
94
121
|
|
|
@@ -123,6 +150,12 @@ void AnimationBackend::trigger() {
|
|
|
123
150
|
onAnimationFrame(std::chrono::steady_clock::now().time_since_epoch());
|
|
124
151
|
}
|
|
125
152
|
|
|
153
|
+
void AnimationBackend::pushAnimationMutations(const Callback& callback) {
|
|
154
|
+
auto timestamp = animationChoreographer_->now();
|
|
155
|
+
auto mutations = callback(timestamp);
|
|
156
|
+
applyMutations(std::move(mutations));
|
|
157
|
+
}
|
|
158
|
+
|
|
126
159
|
void AnimationBackend::commitUpdates(
|
|
127
160
|
SurfaceId surfaceId,
|
|
128
161
|
SurfaceUpdates& surfaceUpdates) {
|
|
@@ -60,10 +60,19 @@ class AnimationBackend : public UIManagerAnimationBackend {
|
|
|
60
60
|
|
|
61
61
|
void onAnimationFrame(AnimationTimestamp timestamp) override;
|
|
62
62
|
void trigger() override;
|
|
63
|
+
void pushAnimationMutations(const Callback &callback) override;
|
|
63
64
|
CallbackId start(const Callback &callback) override;
|
|
64
65
|
void stop(CallbackId callbackId) override;
|
|
65
66
|
|
|
66
67
|
private:
|
|
68
|
+
void unpackMutations(
|
|
69
|
+
AnimationMutations &mutations,
|
|
70
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> &surfaceUpdates,
|
|
71
|
+
std::set<SurfaceId> &asyncFlushSurfaces);
|
|
72
|
+
void applySurfaceUpdates(
|
|
73
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> &surfaceUpdates,
|
|
74
|
+
const std::set<SurfaceId> &asyncFlushSurfaces);
|
|
75
|
+
void applyMutations(AnimationMutations mutations);
|
|
67
76
|
std::vector<CallbackWithId> callbacks;
|
|
68
77
|
std::shared_ptr<AnimatedPropsRegistry> animatedPropsRegistry_;
|
|
69
78
|
std::shared_ptr<AnimationChoreographer> animationChoreographer_;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <react/renderer/uimanager/UIManagerAnimationBackend.h>
|
|
11
|
+
#include <react/timing/primitives.h>
|
|
11
12
|
|
|
12
13
|
namespace facebook::react {
|
|
13
14
|
|
|
@@ -21,6 +22,10 @@ class AnimationChoreographer {
|
|
|
21
22
|
|
|
22
23
|
virtual void resume() = 0;
|
|
23
24
|
virtual void pause() = 0;
|
|
25
|
+
virtual AnimationTimestamp now() const
|
|
26
|
+
{
|
|
27
|
+
return HighResTimeStamp::now().toChronoSteadyClockTimePoint().time_since_epoch();
|
|
28
|
+
}
|
|
24
29
|
void setAnimationBackend(std::weak_ptr<UIManagerAnimationBackend> animationBackend)
|
|
25
30
|
{
|
|
26
31
|
animationBackend_ = animationBackend;
|
|
@@ -31,6 +31,7 @@ class UIManagerAnimationBackend {
|
|
|
31
31
|
virtual void stop(CallbackId callbackId) = 0;
|
|
32
32
|
virtual void clearRegistry(SurfaceId surfaceId) = 0;
|
|
33
33
|
virtual void trigger() = 0;
|
|
34
|
+
virtual void pushAnimationMutations(const Callback &callback) = 0;
|
|
34
35
|
virtual void registerJSInvoker(std::shared_ptr<CallInvoker> jsInvoker) = 0;
|
|
35
36
|
};
|
|
36
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.85.
|
|
3
|
+
"version": "0.85.2",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"featureflags": "node ./scripts/featureflags/index.js"
|
|
150
150
|
},
|
|
151
151
|
"peerDependencies": {
|
|
152
|
-
"@react-native/jest-preset": "0.85.
|
|
152
|
+
"@react-native/jest-preset": "0.85.2",
|
|
153
153
|
"@types/react": "^19.1.1",
|
|
154
154
|
"react": "^19.2.3"
|
|
155
155
|
},
|
|
@@ -162,13 +162,13 @@
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
"dependencies": {
|
|
165
|
-
"@react-native/assets-registry": "0.85.
|
|
166
|
-
"@react-native/codegen": "0.85.
|
|
167
|
-
"@react-native/community-cli-plugin": "0.85.
|
|
168
|
-
"@react-native/gradle-plugin": "0.85.
|
|
169
|
-
"@react-native/js-polyfills": "0.85.
|
|
170
|
-
"@react-native/normalize-colors": "0.85.
|
|
171
|
-
"@react-native/virtualized-lists": "0.85.
|
|
165
|
+
"@react-native/assets-registry": "0.85.2",
|
|
166
|
+
"@react-native/codegen": "0.85.2",
|
|
167
|
+
"@react-native/community-cli-plugin": "0.85.2",
|
|
168
|
+
"@react-native/gradle-plugin": "0.85.2",
|
|
169
|
+
"@react-native/js-polyfills": "0.85.2",
|
|
170
|
+
"@react-native/normalize-colors": "0.85.2",
|
|
171
|
+
"@react-native/virtualized-lists": "0.85.2",
|
|
172
172
|
"abort-controller": "^3.0.0",
|
|
173
173
|
"anser": "^1.4.9",
|
|
174
174
|
"ansi-regex": "^5.0.0",
|