@amazon-devices/react-native-worklets 1.0.0 → 1.0.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/Common/cpp/worklets/Registries/EventHandlerRegistry.h +5 -3
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +5 -6
- package/Common/cpp/worklets/RunLoop/EventLoop.cpp +6 -6
- package/Common/cpp/worklets/SharedItems/Serializable.h +9 -8
- package/Common/cpp/worklets/Tools/JSISerializer.h +4 -4
- package/Common/cpp/worklets/Tools/JSScheduler.h +5 -3
- package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +3 -2
- package/Common/cpp/worklets/Tools/UIScheduler.h +4 -4
- package/Common/cpp/worklets/Tools/VersionUtils.h +1 -4
- package/Common/cpp/worklets/Tools/WorkletsSystraceSection.h +0 -25
- package/SystemModules/amzn__react-native-worklets-1.private.modules.txt +57 -33
- package/kepler-compatibility.json +3 -1
- package/lib/module/index.js +0 -25
- package/oss-attribution/attribution.txt +2262 -0
- package/oss-attribution/licenseInfos.json +585 -0
- package/package.json +1 -153
- package/src/index.ts +0 -52
- package/SystemBundles/cc12deac6e91c435b76698c8445aed85612f2f88e733218d14f88a35d06fb0f4.bundle +0 -10512
- package/SystemBundles/cc12deac6e91c435b76698c8445aed85612f2f88e733218d14f88a35d06fb0f4.map +0 -3771
- package/bundleMode/index.js +0 -59
- package/lib/module/PlatformChecker/PlatformChecker.js +0 -8
- package/lib/module/PlatformChecker/index.js +0 -18
- package/lib/module/WorkletsError.js +0 -29
- package/lib/module/WorkletsModule/JSWorklets.js +0 -111
- package/lib/module/WorkletsModule/NativeWorklets.js +0 -126
- package/lib/module/WorkletsModule/index.js +0 -4
- package/lib/module/WorkletsModule/workletsModuleInstance.js +0 -7
- package/lib/module/WorkletsModule/workletsModuleInstance.web.js +0 -5
- package/lib/module/WorkletsModule/workletsModuleProxy.js +0 -4
- package/lib/module/bundleUnpacker.js +0 -47
- package/lib/module/callGuard.js +0 -30
- package/lib/module/deprecated.js +0 -20
- package/lib/module/errors.js +0 -69
- package/lib/module/featureFlags/index.js +0 -48
- package/lib/module/initializers.js +0 -221
- package/lib/module/isSynchronizable.js +0 -6
- package/lib/module/logger.js +0 -15
- package/lib/module/privateGlobals.d.js +0 -7
- package/lib/module/publicGlobals.js +0 -6
- package/lib/module/runLoop/common/setImmediatePolyfill.js +0 -15
- package/lib/module/runLoop/common/setIntervalPolyfill.js +0 -26
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js +0 -10
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +0 -52
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js +0 -32
- package/lib/module/runLoop/workletRuntime/index.js +0 -19
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js +0 -11
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js +0 -48
- package/lib/module/runLoop/workletRuntime/setTimeout.js +0 -28
- package/lib/module/runLoop/workletRuntime/taskQueue.js +0 -37
- package/lib/module/runtimeKind.js +0 -39
- package/lib/module/runtimes.js +0 -100
- package/lib/module/serializable.js +0 -568
- package/lib/module/serializableMappingCache.js +0 -37
- package/lib/module/specs/NativeWorkletsModule.js +0 -5
- package/lib/module/specs/NativeWorkletsModule.kepler.js +0 -7
- package/lib/module/specs/index.js +0 -10
- package/lib/module/synchronizable.js +0 -9
- package/lib/module/synchronizableUnpacker.js +0 -42
- package/lib/module/threads.js +0 -347
- package/lib/module/utils/checkCppVersion.js +0 -30
- package/lib/module/utils/jsVersion.js +0 -9
- package/lib/module/valueUnpacker.js +0 -60
- package/lib/module/workletFunction.js +0 -37
- package/lib/module/workletRuntimeEntry.js +0 -32
- package/lib/module/workletTypes.js +0 -12
- package/scripts/validate-react-native-version.js +0 -43
- package/src/PlatformChecker/PlatformChecker.ts +0 -7
- package/src/PlatformChecker/index.ts +0 -30
- package/src/WorkletsError.ts +0 -36
- package/src/WorkletsModule/JSWorklets.ts +0 -200
- package/src/WorkletsModule/NativeWorklets.ts +0 -256
- package/src/WorkletsModule/index.ts +0 -7
- package/src/WorkletsModule/workletsModuleInstance.ts +0 -9
- package/src/WorkletsModule/workletsModuleInstance.web.ts +0 -5
- package/src/WorkletsModule/workletsModuleProxy.ts +0 -126
- package/src/bundleUnpacker.ts +0 -75
- package/src/callGuard.ts +0 -33
- package/src/deprecated.ts +0 -32
- package/src/errors.ts +0 -80
- package/src/featureFlags/index.ts +0 -72
- package/src/initializers.ts +0 -262
- package/src/isSynchronizable.ts +0 -13
- package/src/logger.ts +0 -16
- package/src/publicGlobals.ts +0 -39
- package/src/runLoop/common/setImmediatePolyfill.ts +0 -20
- package/src/runLoop/common/setIntervalPolyfill.ts +0 -38
- package/src/runLoop/uiRuntime/mockedRequestAnimationFrame.ts +0 -11
- package/src/runLoop/uiRuntime/requestAnimationFrame.ts +0 -66
- package/src/runLoop/uiRuntime/setTimeoutPolyfill.ts +0 -40
- package/src/runLoop/workletRuntime/index.ts +0 -18
- package/src/runLoop/workletRuntime/queueMicrotask.ts +0 -13
- package/src/runLoop/workletRuntime/requestAnimationFramePolyfill.ts +0 -61
- package/src/runLoop/workletRuntime/setTimeout.ts +0 -37
- package/src/runLoop/workletRuntime/taskQueue.ts +0 -44
- package/src/runtimeKind.ts +0 -37
- package/src/runtimes.ts +0 -193
- package/src/serializable.ts +0 -801
- package/src/serializableMappingCache.ts +0 -42
- package/src/specs/NativeWorkletsModule.kepler.ts +0 -11
- package/src/specs/NativeWorkletsModule.ts +0 -9
- package/src/specs/index.ts +0 -13
- package/src/synchronizable.ts +0 -32
- package/src/synchronizableUnpacker.ts +0 -67
- package/src/threads.ts +0 -452
- package/src/utils/checkCppVersion.ts +0 -34
- package/src/utils/jsVersion.ts +0 -7
- package/src/valueUnpacker.ts +0 -90
- package/src/workletFunction.ts +0 -42
- package/src/workletRuntimeEntry.ts +0 -35
- package/src/workletTypes.ts +0 -81
package/src/serializable.ts
DELETED
|
@@ -1,801 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
import { registerWorkletStackDetails } from './errors';
|
|
3
|
-
import { isSynchronizable } from './isSynchronizable';
|
|
4
|
-
import { logger } from './logger';
|
|
5
|
-
import { SHOULD_BE_USE_WEB } from './PlatformChecker';
|
|
6
|
-
import {
|
|
7
|
-
serializableMappingCache,
|
|
8
|
-
serializableMappingFlag,
|
|
9
|
-
} from './serializableMappingCache';
|
|
10
|
-
import type { Synchronizable } from './synchronizable';
|
|
11
|
-
import { jsVersion } from './utils/jsVersion';
|
|
12
|
-
import { isWorkletFunction } from './workletFunction';
|
|
13
|
-
import { WorkletsError } from './WorkletsError';
|
|
14
|
-
import { WorkletsModule } from './WorkletsModule';
|
|
15
|
-
import type {
|
|
16
|
-
FlatSerializableRef,
|
|
17
|
-
SerializableRef,
|
|
18
|
-
WorkletFunction,
|
|
19
|
-
WorkletImport,
|
|
20
|
-
} from './workletTypes';
|
|
21
|
-
|
|
22
|
-
// for web and jest environments this file provides a stub implementation
|
|
23
|
-
// where no serializable references are used. Instead, the objects themselves are used
|
|
24
|
-
// instead of serializable references, because of the fact that we don't have to deal with
|
|
25
|
-
// running the code on separate VMs.
|
|
26
|
-
|
|
27
|
-
const MAGIC_KEY = 'REANIMATED_MAGIC_KEY';
|
|
28
|
-
|
|
29
|
-
function isHostObject(value: NonNullable<object>) {
|
|
30
|
-
'worklet';
|
|
31
|
-
// We could use JSI to determine whether an object is a host object, however
|
|
32
|
-
// the below workaround works well and is way faster than an additional JSI call.
|
|
33
|
-
// We use the fact that host objects have broken implementation of `hasOwnProperty`
|
|
34
|
-
// and hence return true for all `in` checks regardless of the key we ask for.
|
|
35
|
-
return MAGIC_KEY in value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function isSerializableRef(value: unknown): value is SerializableRef {
|
|
39
|
-
return (
|
|
40
|
-
typeof value === 'object' && value !== null && '__serializableRef' in value
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function isPlainJSObject(object: object): object is Record<string, unknown> {
|
|
45
|
-
'worklet';
|
|
46
|
-
return Object.getPrototypeOf(object) === Object.prototype;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function isTurboModuleLike(object: object): object is Record<string, unknown> {
|
|
50
|
-
return isHostObject(Object.getPrototypeOf(object));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function getFromCache(value: object) {
|
|
54
|
-
const cached = serializableMappingCache.get(value);
|
|
55
|
-
if (cached === serializableMappingFlag) {
|
|
56
|
-
// This means that `value` was already a clone and we should return it as is.
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
return cached;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// The below object is used as a replacement for objects that cannot be transferred
|
|
63
|
-
// as serializable values. In createSerializable we detect if an object is of
|
|
64
|
-
// a plain Object.prototype and only allow such objects to be transferred. This lets
|
|
65
|
-
// us avoid all sorts of react internals from leaking into the UI runtime. To make it
|
|
66
|
-
// possible to catch errors when someone actually tries to access such object on the UI
|
|
67
|
-
// runtime, we use the below Proxy object which is instantiated on the UI runtime and
|
|
68
|
-
// throws whenever someone tries to access its fields.
|
|
69
|
-
const INACCESSIBLE_OBJECT = {
|
|
70
|
-
__init: () => {
|
|
71
|
-
'worklet';
|
|
72
|
-
return new Proxy(
|
|
73
|
-
{},
|
|
74
|
-
{
|
|
75
|
-
get: (_: unknown, prop: string | symbol) => {
|
|
76
|
-
if (
|
|
77
|
-
prop === '_isReanimatedSharedValue' ||
|
|
78
|
-
prop === '__remoteFunction'
|
|
79
|
-
) {
|
|
80
|
-
// not very happy about this check here, but we need to allow for
|
|
81
|
-
// "inaccessible" objects to be tested with isSerializableRef check
|
|
82
|
-
// as it is being used in the mappers when extracting inputs recursively
|
|
83
|
-
// as well as with isRemoteFunction when cloning objects recursively.
|
|
84
|
-
// Apparently we can't check if a key exists there as HostObjects always
|
|
85
|
-
// return true for such tests, so the only possibility for us is to
|
|
86
|
-
// actually access that key and see if it is set to true. We therefore
|
|
87
|
-
// need to allow for this key to be accessed here.
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
throw new WorkletsError(
|
|
91
|
-
`Trying to access property \`${String(
|
|
92
|
-
prop
|
|
93
|
-
)}\` of an object which cannot be sent to the UI runtime.`
|
|
94
|
-
);
|
|
95
|
-
},
|
|
96
|
-
set: () => {
|
|
97
|
-
throw new WorkletsError(
|
|
98
|
-
'Trying to write to an object which cannot be sent to the UI runtime.'
|
|
99
|
-
);
|
|
100
|
-
},
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const VALID_ARRAY_VIEWS_NAMES = [
|
|
107
|
-
'Int8Array',
|
|
108
|
-
'Uint8Array',
|
|
109
|
-
'Uint8ClampedArray',
|
|
110
|
-
'Int16Array',
|
|
111
|
-
'Uint16Array',
|
|
112
|
-
'Int32Array',
|
|
113
|
-
'Uint32Array',
|
|
114
|
-
'Float32Array',
|
|
115
|
-
'Float64Array',
|
|
116
|
-
'BigInt64Array',
|
|
117
|
-
'BigUint64Array',
|
|
118
|
-
'DataView',
|
|
119
|
-
];
|
|
120
|
-
|
|
121
|
-
const DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD = 30;
|
|
122
|
-
// Below variable stores object that we process in createSerializable at the specified depth.
|
|
123
|
-
// We use it to check if later on the function reenters with the same object
|
|
124
|
-
let processedObjectAtThresholdDepth: unknown;
|
|
125
|
-
|
|
126
|
-
function createSerializableWeb<T>(value: T): SerializableRef<T> {
|
|
127
|
-
return value as SerializableRef<T>;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function createSerializableNative<T>(
|
|
131
|
-
value: T,
|
|
132
|
-
shouldPersistRemote = false,
|
|
133
|
-
depth = 0
|
|
134
|
-
): SerializableRef<T> {
|
|
135
|
-
detectCyclicObject(value, depth);
|
|
136
|
-
|
|
137
|
-
const isObject = typeof value === 'object';
|
|
138
|
-
const isFunction = typeof value === 'function';
|
|
139
|
-
|
|
140
|
-
if (typeof value === 'string') {
|
|
141
|
-
return cloneString(value) as SerializableRef<T>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (typeof value === 'number') {
|
|
145
|
-
return cloneNumber(value) as SerializableRef<T>;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (typeof value === 'boolean') {
|
|
149
|
-
return cloneBoolean(value) as SerializableRef<T>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (typeof value === 'bigint') {
|
|
153
|
-
return cloneBigInt(value) as SerializableRef<T>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (value === undefined) {
|
|
157
|
-
return cloneUndefined() as SerializableRef<T>;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (value === null) {
|
|
161
|
-
return cloneNull() as SerializableRef<T>;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if ((!isObject && !isFunction) || value === null) {
|
|
165
|
-
return clonePrimitive(value, shouldPersistRemote);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const cached = getFromCache(value);
|
|
169
|
-
if (cached !== undefined) {
|
|
170
|
-
return cached as SerializableRef<T>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (Array.isArray(value)) {
|
|
174
|
-
return cloneArray(value, shouldPersistRemote, depth);
|
|
175
|
-
}
|
|
176
|
-
if (
|
|
177
|
-
globalThis._WORKLETS_BUNDLE_MODE &&
|
|
178
|
-
isFunction &&
|
|
179
|
-
(value as WorkletImport).__bundleData
|
|
180
|
-
) {
|
|
181
|
-
return cloneImport(value as WorkletImport) as SerializableRef<T>;
|
|
182
|
-
}
|
|
183
|
-
if (isFunction && !isWorkletFunction(value)) {
|
|
184
|
-
return cloneRemoteFunction(value);
|
|
185
|
-
}
|
|
186
|
-
// RN has introduced a new representation of TurboModules as a JS object whose prototype is the host object
|
|
187
|
-
// More details: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp#L182
|
|
188
|
-
if (isTurboModuleLike(value)) {
|
|
189
|
-
return cloneTurboModuleLike(value, shouldPersistRemote, depth);
|
|
190
|
-
}
|
|
191
|
-
if (isHostObject(value)) {
|
|
192
|
-
return cloneHostObject(value);
|
|
193
|
-
}
|
|
194
|
-
if (isPlainJSObject(value) && value.__init) {
|
|
195
|
-
return cloneInitializer(
|
|
196
|
-
value,
|
|
197
|
-
shouldPersistRemote,
|
|
198
|
-
depth
|
|
199
|
-
) as SerializableRef<T>;
|
|
200
|
-
}
|
|
201
|
-
if (isPlainJSObject(value) && value.__workletContextObjectFactory) {
|
|
202
|
-
return cloneContextObject(value);
|
|
203
|
-
}
|
|
204
|
-
if ((isPlainJSObject(value) || isFunction) && isWorkletFunction(value)) {
|
|
205
|
-
return cloneWorklet(value, shouldPersistRemote, depth);
|
|
206
|
-
}
|
|
207
|
-
if (isSynchronizable(value)) {
|
|
208
|
-
return cloneSynchronizable(value) as SerializableRef<T>;
|
|
209
|
-
}
|
|
210
|
-
if (isPlainJSObject(value) || isFunction) {
|
|
211
|
-
return clonePlainJSObject(value, shouldPersistRemote, depth);
|
|
212
|
-
}
|
|
213
|
-
if (value instanceof Set) {
|
|
214
|
-
return cloneSet(value);
|
|
215
|
-
}
|
|
216
|
-
if (value instanceof Map) {
|
|
217
|
-
return cloneMap(value);
|
|
218
|
-
}
|
|
219
|
-
if (value instanceof RegExp) {
|
|
220
|
-
return cloneRegExp(value);
|
|
221
|
-
}
|
|
222
|
-
if (value instanceof Error) {
|
|
223
|
-
return cloneError(value);
|
|
224
|
-
}
|
|
225
|
-
if (value instanceof ArrayBuffer) {
|
|
226
|
-
return cloneArrayBuffer(value, shouldPersistRemote);
|
|
227
|
-
}
|
|
228
|
-
if (ArrayBuffer.isView(value)) {
|
|
229
|
-
// typed array (e.g. Int32Array, Uint8ClampedArray) or DataView
|
|
230
|
-
return cloneArrayBufferView(value);
|
|
231
|
-
}
|
|
232
|
-
return inaccessibleObject(value);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (globalThis._WORKLETS_BUNDLE_MODE) {
|
|
236
|
-
// TODO: Do it programatically.
|
|
237
|
-
createSerializableNative.__bundleData = {
|
|
238
|
-
imported: 'createSerializable',
|
|
239
|
-
// @ts-expect-error resolveWeak is defined by Metro
|
|
240
|
-
source: require.resolveWeak('./index'),
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
interface CreateSerializable {
|
|
245
|
-
<T>(value: T): SerializableRef<T>;
|
|
246
|
-
<T>(
|
|
247
|
-
value: T,
|
|
248
|
-
shouldPersistRemote: boolean,
|
|
249
|
-
depth: number
|
|
250
|
-
): SerializableRef<T>;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export const createSerializable: CreateSerializable = SHOULD_BE_USE_WEB
|
|
254
|
-
? createSerializableWeb
|
|
255
|
-
: createSerializableNative;
|
|
256
|
-
|
|
257
|
-
function detectCyclicObject(value: unknown, depth: number) {
|
|
258
|
-
if (depth >= DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) {
|
|
259
|
-
// if we reach certain recursion depth we suspect that we are dealing with a cyclic object.
|
|
260
|
-
// this type of objects are not supported and cannot be transferred as serializable, so we
|
|
261
|
-
// implement a simple detection mechanism that remembers the value at a given depth and
|
|
262
|
-
// tests whether we try reenter this method later on with the same value. If that happens
|
|
263
|
-
// we throw an appropriate error.
|
|
264
|
-
if (depth === DETECT_CYCLIC_OBJECT_DEPTH_THRESHOLD) {
|
|
265
|
-
processedObjectAtThresholdDepth = value;
|
|
266
|
-
} else if (value === processedObjectAtThresholdDepth) {
|
|
267
|
-
throw new WorkletsError(
|
|
268
|
-
'Trying to convert a cyclic object to a serializable. This is not supported.'
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
} else {
|
|
272
|
-
processedObjectAtThresholdDepth = undefined;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function clonePrimitive<T>(
|
|
277
|
-
value: T,
|
|
278
|
-
shouldPersistRemote: boolean
|
|
279
|
-
): SerializableRef<T> {
|
|
280
|
-
return WorkletsModule.createSerializable(value, shouldPersistRemote);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function cloneString(value: string): SerializableRef<string> {
|
|
284
|
-
return WorkletsModule.createSerializableString(value);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function cloneNumber(value: number): SerializableRef<number> {
|
|
288
|
-
return WorkletsModule.createSerializableNumber(value);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function cloneBoolean(value: boolean): SerializableRef<boolean> {
|
|
292
|
-
return WorkletsModule.createSerializableBoolean(value);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
function cloneBigInt(value: bigint): SerializableRef<bigint> {
|
|
296
|
-
return WorkletsModule.createSerializableBigInt(value);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function cloneUndefined(): SerializableRef<undefined> {
|
|
300
|
-
return WorkletsModule.createSerializableUndefined();
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function cloneNull(): SerializableRef<null> {
|
|
304
|
-
return WorkletsModule.createSerializableNull();
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function cloneObjectProperties<T extends object>(
|
|
308
|
-
value: T,
|
|
309
|
-
shouldPersistRemote: boolean,
|
|
310
|
-
depth: number
|
|
311
|
-
): Record<string, unknown> {
|
|
312
|
-
const clonedProps: Record<string, unknown> = {};
|
|
313
|
-
for (const [key, element] of Object.entries(value)) {
|
|
314
|
-
// We don't need to clone __initData field as it contains long strings
|
|
315
|
-
// representing the worklet code, source map, and location, and we will
|
|
316
|
-
// serialize/deserialize it once.
|
|
317
|
-
if (key === '__initData' && clonedProps.__initData !== undefined) {
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
clonedProps[key] = createSerializable(
|
|
321
|
-
element,
|
|
322
|
-
shouldPersistRemote,
|
|
323
|
-
depth + 1
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
return clonedProps;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function cloneInitializer(
|
|
330
|
-
value: object,
|
|
331
|
-
shouldPersistRemote = false,
|
|
332
|
-
depth = 0
|
|
333
|
-
): SerializableRef<object> {
|
|
334
|
-
const clonedProps: Record<string, unknown> = cloneObjectProperties(
|
|
335
|
-
value,
|
|
336
|
-
shouldPersistRemote,
|
|
337
|
-
depth
|
|
338
|
-
);
|
|
339
|
-
return WorkletsModule.createSerializableInitializer(clonedProps);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function cloneArray<T extends unknown[]>(
|
|
343
|
-
value: T,
|
|
344
|
-
shouldPersistRemote: boolean,
|
|
345
|
-
depth: number
|
|
346
|
-
): SerializableRef<T> {
|
|
347
|
-
const clonedElements = value.map((element) =>
|
|
348
|
-
createSerializable(element, shouldPersistRemote, depth + 1)
|
|
349
|
-
);
|
|
350
|
-
const clone = WorkletsModule.createSerializableArray(
|
|
351
|
-
clonedElements,
|
|
352
|
-
shouldPersistRemote
|
|
353
|
-
) as SerializableRef<T>;
|
|
354
|
-
serializableMappingCache.set(value, clone);
|
|
355
|
-
serializableMappingCache.set(clone);
|
|
356
|
-
|
|
357
|
-
freezeObjectInDev(value);
|
|
358
|
-
return clone;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function cloneRemoteFunction<TArgs extends unknown[], TReturn>(
|
|
362
|
-
value: (...args: TArgs) => TReturn
|
|
363
|
-
): SerializableRef<TReturn> {
|
|
364
|
-
const clone = WorkletsModule.createSerializableFunction(value);
|
|
365
|
-
serializableMappingCache.set(value, clone);
|
|
366
|
-
serializableMappingCache.set(clone);
|
|
367
|
-
|
|
368
|
-
freezeObjectInDev(value);
|
|
369
|
-
return clone;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
function cloneHostObject<T extends object>(value: T): SerializableRef<T> {
|
|
373
|
-
// for host objects we pass the reference to the object as serializable and
|
|
374
|
-
// then recreate new host object wrapping the same instance on the UI thread.
|
|
375
|
-
// there is no point of iterating over keys as we do for regular objects.
|
|
376
|
-
const clone = WorkletsModule.createSerializableHostObject(value);
|
|
377
|
-
serializableMappingCache.set(value, clone);
|
|
378
|
-
serializableMappingCache.set(clone);
|
|
379
|
-
|
|
380
|
-
return clone;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
function cloneWorklet<T extends WorkletFunction>(
|
|
384
|
-
value: T,
|
|
385
|
-
shouldPersistRemote: boolean,
|
|
386
|
-
depth: number
|
|
387
|
-
): SerializableRef<T> {
|
|
388
|
-
if (__DEV__) {
|
|
389
|
-
const babelVersion = (value as WorkletFunction).__pluginVersion;
|
|
390
|
-
if (babelVersion !== undefined && babelVersion !== jsVersion) {
|
|
391
|
-
throw new WorkletsError(
|
|
392
|
-
`Mismatch between JavaScript code version and Worklets Babel plugin version (${jsVersion} vs. ${babelVersion}).
|
|
393
|
-
See \`https://docs.swmansion.com/react-native-worklets/docs/guides/troubleshooting#mismatch-between-javascript-code-version-and-worklets-babel-plugin-version\` for more details.
|
|
394
|
-
Offending code was: \`${getWorkletCode(value)}\``
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
registerWorkletStackDetails(
|
|
398
|
-
value.__workletHash,
|
|
399
|
-
(value as WorkletFunction).__stackDetails!
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
if ((value as WorkletFunction).__stackDetails) {
|
|
403
|
-
// `Error` type of value cannot be copied to the UI thread, so we
|
|
404
|
-
// remove it after we handled it in dev mode or delete it to ignore it in production mode.
|
|
405
|
-
// Not removing this would cause an infinite loop in production mode and it just
|
|
406
|
-
// seems more elegant to handle it this way.
|
|
407
|
-
delete (value as WorkletFunction).__stackDetails;
|
|
408
|
-
}
|
|
409
|
-
const clonedProps: Record<string, unknown> = cloneObjectProperties(
|
|
410
|
-
value,
|
|
411
|
-
true,
|
|
412
|
-
depth
|
|
413
|
-
);
|
|
414
|
-
// to save on transferring static __initData field of worklet structure
|
|
415
|
-
// we request serializable value to persist its UI counterpart. This means
|
|
416
|
-
// that the __initData field that contains long strings representing the
|
|
417
|
-
// worklet code, source map, and location, will always be
|
|
418
|
-
// serialized/deserialized once.
|
|
419
|
-
clonedProps.__initData = createSerializable(
|
|
420
|
-
value.__initData,
|
|
421
|
-
true,
|
|
422
|
-
depth + 1
|
|
423
|
-
);
|
|
424
|
-
|
|
425
|
-
const clone = WorkletsModule.createSerializableWorklet(
|
|
426
|
-
clonedProps,
|
|
427
|
-
// TODO: Check after refactor if we can remove shouldPersistRemote parameter (imho it's redundant here since worklets are always persistent)
|
|
428
|
-
// retain all worklets
|
|
429
|
-
true
|
|
430
|
-
) as SerializableRef<T>;
|
|
431
|
-
serializableMappingCache.set(value, clone);
|
|
432
|
-
serializableMappingCache.set(clone);
|
|
433
|
-
|
|
434
|
-
freezeObjectInDev(value);
|
|
435
|
-
return clone;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* TurboModuleLike objects are JS objects that have a TurboModule as their
|
|
440
|
-
* prototype.
|
|
441
|
-
*/
|
|
442
|
-
function cloneTurboModuleLike<T extends object>(
|
|
443
|
-
value: T,
|
|
444
|
-
shouldPersistRemote: boolean,
|
|
445
|
-
depth: number
|
|
446
|
-
): SerializableRef<T> {
|
|
447
|
-
const proto = Object.getPrototypeOf(value);
|
|
448
|
-
const clonedProps = cloneObjectProperties(value, shouldPersistRemote, depth);
|
|
449
|
-
const clone = WorkletsModule.createSerializableTurboModuleLike(
|
|
450
|
-
clonedProps,
|
|
451
|
-
proto
|
|
452
|
-
) as SerializableRef<T>;
|
|
453
|
-
return clone;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
function cloneContextObject<T extends object>(value: T): SerializableRef<T> {
|
|
457
|
-
const workletContextObjectFactory = (value as Record<string, unknown>)
|
|
458
|
-
.__workletContextObjectFactory as () => T;
|
|
459
|
-
const handle = cloneInitializer({
|
|
460
|
-
__init: () => {
|
|
461
|
-
'worklet';
|
|
462
|
-
return workletContextObjectFactory();
|
|
463
|
-
},
|
|
464
|
-
});
|
|
465
|
-
serializableMappingCache.set(value, handle);
|
|
466
|
-
return handle as SerializableRef<T>;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
function clonePlainJSObject<T extends object>(
|
|
470
|
-
value: T,
|
|
471
|
-
shouldPersistRemote: boolean,
|
|
472
|
-
depth: number
|
|
473
|
-
): SerializableRef<T> {
|
|
474
|
-
const clonedProps: Record<string, unknown> = cloneObjectProperties(
|
|
475
|
-
value,
|
|
476
|
-
shouldPersistRemote,
|
|
477
|
-
depth
|
|
478
|
-
);
|
|
479
|
-
const clone = WorkletsModule.createSerializableObject(
|
|
480
|
-
clonedProps,
|
|
481
|
-
shouldPersistRemote,
|
|
482
|
-
value
|
|
483
|
-
) as SerializableRef<T>;
|
|
484
|
-
serializableMappingCache.set(value, clone);
|
|
485
|
-
serializableMappingCache.set(clone);
|
|
486
|
-
|
|
487
|
-
freezeObjectInDev(value);
|
|
488
|
-
return clone;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
function cloneMap<T extends Map<unknown, unknown>>(
|
|
492
|
-
value: T
|
|
493
|
-
): SerializableRef<T> {
|
|
494
|
-
const clonedKeys: unknown[] = [];
|
|
495
|
-
const clonedValues: unknown[] = [];
|
|
496
|
-
for (const [key, element] of value.entries()) {
|
|
497
|
-
clonedKeys.push(createSerializable(key));
|
|
498
|
-
clonedValues.push(createSerializable(element));
|
|
499
|
-
}
|
|
500
|
-
const clone = WorkletsModule.createSerializableMap(
|
|
501
|
-
clonedKeys,
|
|
502
|
-
clonedValues
|
|
503
|
-
) as SerializableRef<T>;
|
|
504
|
-
serializableMappingCache.set(value, clone);
|
|
505
|
-
serializableMappingCache.set(clone);
|
|
506
|
-
|
|
507
|
-
freezeObjectInDev(value);
|
|
508
|
-
return clone;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
function cloneSet<T extends Set<unknown>>(value: T): SerializableRef<T> {
|
|
512
|
-
const clonedElements: unknown[] = [];
|
|
513
|
-
for (const element of value) {
|
|
514
|
-
clonedElements.push(createSerializable(element));
|
|
515
|
-
}
|
|
516
|
-
const clone = WorkletsModule.createSerializableSet(
|
|
517
|
-
clonedElements
|
|
518
|
-
) as SerializableRef<T>;
|
|
519
|
-
serializableMappingCache.set(value, clone);
|
|
520
|
-
serializableMappingCache.set(clone);
|
|
521
|
-
|
|
522
|
-
freezeObjectInDev(value);
|
|
523
|
-
return clone;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
function cloneRegExp<T extends RegExp>(value: T): SerializableRef<T> {
|
|
527
|
-
const pattern = value.source;
|
|
528
|
-
const flags = value.flags;
|
|
529
|
-
const handle = cloneInitializer({
|
|
530
|
-
__init: () => {
|
|
531
|
-
'worklet';
|
|
532
|
-
return new RegExp(pattern, flags);
|
|
533
|
-
},
|
|
534
|
-
}) as unknown as SerializableRef<T>;
|
|
535
|
-
serializableMappingCache.set(value, handle);
|
|
536
|
-
|
|
537
|
-
return handle;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function cloneError<T extends Error>(value: T): SerializableRef<T> {
|
|
541
|
-
const { name, message, stack } = value;
|
|
542
|
-
const handle = cloneInitializer({
|
|
543
|
-
__init: () => {
|
|
544
|
-
'worklet';
|
|
545
|
-
// eslint-disable-next-line reanimated/use-worklets-error
|
|
546
|
-
const error = new Error();
|
|
547
|
-
error.name = name;
|
|
548
|
-
error.message = message;
|
|
549
|
-
error.stack = stack;
|
|
550
|
-
return error;
|
|
551
|
-
},
|
|
552
|
-
});
|
|
553
|
-
serializableMappingCache.set(value, handle);
|
|
554
|
-
return handle as unknown as SerializableRef<T>;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
function cloneArrayBuffer<T extends ArrayBuffer>(
|
|
558
|
-
value: T,
|
|
559
|
-
shouldPersistRemote: boolean
|
|
560
|
-
): SerializableRef<T> {
|
|
561
|
-
const clone = WorkletsModule.createSerializable(
|
|
562
|
-
value,
|
|
563
|
-
shouldPersistRemote,
|
|
564
|
-
value
|
|
565
|
-
);
|
|
566
|
-
serializableMappingCache.set(value, clone);
|
|
567
|
-
serializableMappingCache.set(clone);
|
|
568
|
-
|
|
569
|
-
return clone;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
function cloneArrayBufferView<T extends ArrayBufferView>(
|
|
573
|
-
value: T
|
|
574
|
-
): SerializableRef<T> {
|
|
575
|
-
const buffer = value.buffer;
|
|
576
|
-
const typeName = value.constructor.name;
|
|
577
|
-
const handle = cloneInitializer({
|
|
578
|
-
__init: () => {
|
|
579
|
-
'worklet';
|
|
580
|
-
if (!VALID_ARRAY_VIEWS_NAMES.includes(typeName)) {
|
|
581
|
-
throw new WorkletsError(`Invalid array view name \`${typeName}\`.`);
|
|
582
|
-
}
|
|
583
|
-
const constructor = global[typeName as keyof typeof global];
|
|
584
|
-
if (constructor === undefined) {
|
|
585
|
-
throw new WorkletsError(`Constructor for \`${typeName}\` not found.`);
|
|
586
|
-
}
|
|
587
|
-
return new constructor(buffer);
|
|
588
|
-
},
|
|
589
|
-
}) as unknown as SerializableRef<T>;
|
|
590
|
-
serializableMappingCache.set(value, handle);
|
|
591
|
-
|
|
592
|
-
return handle;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
function cloneSynchronizable<TValue>(
|
|
596
|
-
value: Synchronizable<TValue>
|
|
597
|
-
): SerializableRef<TValue> {
|
|
598
|
-
serializableMappingCache.set(value);
|
|
599
|
-
return value;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
function cloneImport<TValue extends WorkletImport>(
|
|
603
|
-
value: TValue
|
|
604
|
-
): SerializableRef<TValue> {
|
|
605
|
-
const { source, imported } = value.__bundleData;
|
|
606
|
-
const clone = WorkletsModule.createSerializableImport(source, imported);
|
|
607
|
-
|
|
608
|
-
serializableMappingCache.set(value, clone);
|
|
609
|
-
serializableMappingCache.set(clone);
|
|
610
|
-
|
|
611
|
-
return clone as SerializableRef<TValue>;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
function inaccessibleObject<T extends object>(value: T): SerializableRef<T> {
|
|
615
|
-
// This is reached for object types that are not of plain Object.prototype.
|
|
616
|
-
// We don't support such objects from being transferred as serializables to
|
|
617
|
-
// the UI runtime and hence we replace them with "inaccessible object"
|
|
618
|
-
// which is implemented as a Proxy object that throws on any attempt
|
|
619
|
-
// of accessing its fields. We argue that such objects can sometimes leak
|
|
620
|
-
// as attributes of objects being captured by worklets but should never
|
|
621
|
-
// be used on the UI runtime regardless. If they are being accessed, the user
|
|
622
|
-
// will get an appropriate error message.
|
|
623
|
-
const clone = createSerializable<T>(INACCESSIBLE_OBJECT as T);
|
|
624
|
-
serializableMappingCache.set(value, clone);
|
|
625
|
-
return clone;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
const WORKLET_CODE_THRESHOLD = 255;
|
|
629
|
-
|
|
630
|
-
function getWorkletCode(value: WorkletFunction) {
|
|
631
|
-
const code = value?.__initData?.code;
|
|
632
|
-
if (!code) {
|
|
633
|
-
return 'unknown';
|
|
634
|
-
}
|
|
635
|
-
if (code.length > WORKLET_CODE_THRESHOLD) {
|
|
636
|
-
return `${code.substring(0, WORKLET_CODE_THRESHOLD)}...`;
|
|
637
|
-
}
|
|
638
|
-
return code;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
type RemoteFunction<T> = {
|
|
642
|
-
__remoteFunction: FlatSerializableRef<T>;
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
function isRemoteFunction<T>(value: {
|
|
646
|
-
__remoteFunction?: unknown;
|
|
647
|
-
}): value is RemoteFunction<T> {
|
|
648
|
-
'worklet';
|
|
649
|
-
return !!value.__remoteFunction;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* We freeze
|
|
654
|
-
*
|
|
655
|
-
* - Arrays,
|
|
656
|
-
* - Remote functions,
|
|
657
|
-
* - Plain JS objects,
|
|
658
|
-
*
|
|
659
|
-
* That are transformed to a serializable with a meaningful warning. This should
|
|
660
|
-
* help detect issues when someone modifies data after it's been converted.
|
|
661
|
-
* Meaning that they may be doing a faulty assumption in their code expecting
|
|
662
|
-
* that the updates are going to automatically propagate to the object sent to
|
|
663
|
-
* the UI thread. If the user really wants some objects to be mutable they
|
|
664
|
-
* should use shared values instead.
|
|
665
|
-
*/
|
|
666
|
-
function freezeObjectInDev<T extends object>(value: T) {
|
|
667
|
-
if (!__DEV__) {
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
Object.entries(value).forEach(([key, element]) => {
|
|
671
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key)!;
|
|
672
|
-
if (!descriptor.configurable) {
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
Object.defineProperty(value, key, {
|
|
676
|
-
get() {
|
|
677
|
-
return element;
|
|
678
|
-
},
|
|
679
|
-
set() {
|
|
680
|
-
logger.warn(
|
|
681
|
-
`Tried to modify key \`${key}\` of an object which has been already passed to a worklet. See
|
|
682
|
-
https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#tried-to-modify-key-of-an-object-which-has-been-converted-to-a-serializable
|
|
683
|
-
for more details.`
|
|
684
|
-
);
|
|
685
|
-
},
|
|
686
|
-
});
|
|
687
|
-
});
|
|
688
|
-
Object.preventExtensions(value);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
function makeShareableCloneOnUIRecursiveLEGACY<T>(
|
|
692
|
-
value: T
|
|
693
|
-
): FlatSerializableRef<T> {
|
|
694
|
-
'worklet';
|
|
695
|
-
if (SHOULD_BE_USE_WEB) {
|
|
696
|
-
// @ts-ignore web is an interesting place where we don't run a secondary VM on the UI thread
|
|
697
|
-
// see more details in the comment where USE_STUB_IMPLEMENTATION is defined.
|
|
698
|
-
return value;
|
|
699
|
-
}
|
|
700
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
701
|
-
function cloneRecursive(value: T): FlatSerializableRef<T> {
|
|
702
|
-
if (
|
|
703
|
-
(typeof value === 'object' && value !== null) ||
|
|
704
|
-
typeof value === 'function'
|
|
705
|
-
) {
|
|
706
|
-
if (isHostObject(value)) {
|
|
707
|
-
// We call `_createSerializableClone` to wrap the provided HostObject
|
|
708
|
-
// inside SerializableJSRef.
|
|
709
|
-
return global._createSerializableHostObject(
|
|
710
|
-
value
|
|
711
|
-
) as FlatSerializableRef<T>;
|
|
712
|
-
}
|
|
713
|
-
if (isRemoteFunction<T>(value)) {
|
|
714
|
-
// RemoteFunctions are created by us therefore they are
|
|
715
|
-
// a Serializable out of the box and there is no need to
|
|
716
|
-
// call `_createSerializableClone`.
|
|
717
|
-
return value.__remoteFunction;
|
|
718
|
-
}
|
|
719
|
-
if (Array.isArray(value)) {
|
|
720
|
-
return global._createSerializableArray(
|
|
721
|
-
value.map(cloneRecursive)
|
|
722
|
-
) as FlatSerializableRef<T>;
|
|
723
|
-
}
|
|
724
|
-
if ((value as Record<string, unknown>).__synchronizableRef) {
|
|
725
|
-
return global._createSerializableSynchronizable(
|
|
726
|
-
value
|
|
727
|
-
) as FlatSerializableRef<T>;
|
|
728
|
-
}
|
|
729
|
-
const toAdapt: Record<string, FlatSerializableRef<T>> = {};
|
|
730
|
-
for (const [key, element] of Object.entries(value)) {
|
|
731
|
-
toAdapt[key] = cloneRecursive(element);
|
|
732
|
-
}
|
|
733
|
-
return global._createSerializable(
|
|
734
|
-
toAdapt,
|
|
735
|
-
value
|
|
736
|
-
) as FlatSerializableRef<T>;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
if (typeof value === 'string') {
|
|
740
|
-
return global._createSerializableString(value);
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
if (typeof value === 'number') {
|
|
744
|
-
return global._createSerializableNumber(value);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
if (typeof value === 'boolean') {
|
|
748
|
-
return global._createSerializableBoolean(value);
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
if (typeof value === 'bigint') {
|
|
752
|
-
return global._createSerializableBigInt(value);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
if (value === undefined) {
|
|
756
|
-
return global._createSerializableUndefined();
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
if (value === null) {
|
|
760
|
-
return global._createSerializableNull();
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
return global._createSerializable(value, undefined);
|
|
764
|
-
}
|
|
765
|
-
return cloneRecursive(value);
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
/** @deprecated This function is no longer supported. */
|
|
769
|
-
export const makeShareableCloneOnUIRecursive = (
|
|
770
|
-
globalThis._WORKLETS_BUNDLE_MODE
|
|
771
|
-
? createSerializable
|
|
772
|
-
: makeShareableCloneOnUIRecursiveLEGACY
|
|
773
|
-
) as typeof makeShareableCloneOnUIRecursiveLEGACY;
|
|
774
|
-
|
|
775
|
-
function makeShareableJS<T>(value: T): T {
|
|
776
|
-
return value;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
function makeShareableNative<T extends object>(value: T): T {
|
|
780
|
-
if (serializableMappingCache.get(value)) {
|
|
781
|
-
return value;
|
|
782
|
-
}
|
|
783
|
-
const handle = createSerializable({
|
|
784
|
-
__init: () => {
|
|
785
|
-
'worklet';
|
|
786
|
-
return value;
|
|
787
|
-
},
|
|
788
|
-
});
|
|
789
|
-
serializableMappingCache.set(value, handle);
|
|
790
|
-
return value;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* This function creates a value on UI with persistent state - changes to it on
|
|
795
|
-
* the UI thread will be seen by all worklets. Use it when you want to create a
|
|
796
|
-
* value that is read and written only on the UI thread.
|
|
797
|
-
*/
|
|
798
|
-
/** @deprecated This function is no longer supported. */
|
|
799
|
-
export const makeShareable = SHOULD_BE_USE_WEB
|
|
800
|
-
? makeShareableJS
|
|
801
|
-
: makeShareableNative;
|