Merge commit 'a50fa552a7e07f611d626fae99a6ef80845d9d4d' into amgleitman/0.64-merge-2020-mm-dd
This commit is contained in:
Коммит
0dd5ae73b4
|
@ -86,4 +86,4 @@ untyped-import
|
||||||
untyped-type-import
|
untyped-type-import
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.125.0
|
^0.126.1
|
||||||
|
|
|
@ -89,4 +89,4 @@ untyped-import
|
||||||
untyped-type-import
|
untyped-type-import
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.125.0
|
^0.126.1
|
||||||
|
|
|
@ -89,4 +89,4 @@ untyped-import
|
||||||
untyped-type-import
|
untyped-type-import
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.125.0
|
^0.126.1
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
*
|
*
|
||||||
* @flow
|
* @flow
|
||||||
* @format
|
* @format
|
||||||
* @preventMunge
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
|
@ -112,13 +112,6 @@ class MessageQueue {
|
||||||
return this.flushedQueue();
|
return this.flushedQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated. T61834641: Remove me once native clients have updated
|
|
||||||
callFunctionReturnResultAndFlushedQueue(
|
|
||||||
module: string,
|
|
||||||
method: string,
|
|
||||||
args: any[],
|
|
||||||
): void {}
|
|
||||||
|
|
||||||
invokeCallbackAndReturnFlushedQueue(
|
invokeCallbackAndReturnFlushedQueue(
|
||||||
cbID: number,
|
cbID: number,
|
||||||
args: any[],
|
args: any[],
|
||||||
|
|
|
@ -23,4 +23,38 @@ export interface Spec extends TurboModule {
|
||||||
+release: (blobId: string) => void;
|
+release: (blobId: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (TurboModuleRegistry.get<Spec>('BlobModule'): ?Spec);
|
const NativeModule = TurboModuleRegistry.get<Spec>('BlobModule');
|
||||||
|
|
||||||
|
let constants = null;
|
||||||
|
let NativeBlobModule = null;
|
||||||
|
|
||||||
|
if (NativeModule != null) {
|
||||||
|
NativeBlobModule = {
|
||||||
|
getConstants(): {|BLOB_URI_SCHEME: ?string, BLOB_URI_HOST: ?string|} {
|
||||||
|
if (constants == null) {
|
||||||
|
constants = NativeModule.getConstants();
|
||||||
|
}
|
||||||
|
return constants;
|
||||||
|
},
|
||||||
|
addNetworkingHandler(): void {
|
||||||
|
NativeModule.addNetworkingHandler();
|
||||||
|
},
|
||||||
|
addWebSocketHandler(id: number): void {
|
||||||
|
NativeModule.addWebSocketHandler(id);
|
||||||
|
},
|
||||||
|
removeWebSocketHandler(id: number): void {
|
||||||
|
NativeModule.removeWebSocketHandler(id);
|
||||||
|
},
|
||||||
|
sendOverSocket(blob: Object, socketID: number): void {
|
||||||
|
NativeModule.sendOverSocket(blob, socketID);
|
||||||
|
},
|
||||||
|
createFromParts(parts: Array<Object>, withId: string): void {
|
||||||
|
NativeModule.createFromParts(parts, withId);
|
||||||
|
},
|
||||||
|
release(blobId: string): void {
|
||||||
|
NativeModule.release(blobId);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default (NativeBlobModule: ?Spec);
|
||||||
|
|
|
@ -31,6 +31,40 @@ export interface Spec extends TurboModule {
|
||||||
+setHidden: (hidden: boolean) => void;
|
+setHidden: (hidden: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
const NativeModule = TurboModuleRegistry.getEnforcing<Spec>('StatusBarManager');
|
||||||
'StatusBarManager',
|
let constants = null;
|
||||||
): Spec);
|
|
||||||
|
const NativeStatusBarManager = {
|
||||||
|
getConstants(): {|
|
||||||
|
+HEIGHT: number,
|
||||||
|
+DEFAULT_BACKGROUND_COLOR?: number,
|
||||||
|
|} {
|
||||||
|
if (constants == null) {
|
||||||
|
constants = NativeModule.getConstants();
|
||||||
|
}
|
||||||
|
return constants;
|
||||||
|
},
|
||||||
|
|
||||||
|
setColor(color: number, animated: boolean): void {
|
||||||
|
NativeModule.setColor(color, animated);
|
||||||
|
},
|
||||||
|
|
||||||
|
setTranslucent(translucent: boolean): void {
|
||||||
|
NativeModule.setTranslucent(translucent);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - statusBarStyles can be:
|
||||||
|
* - 'default'
|
||||||
|
* - 'dark-content'
|
||||||
|
*/
|
||||||
|
setStyle(statusBarStyle?: ?string): void {
|
||||||
|
NativeModule.setStyle(statusBarStyle);
|
||||||
|
},
|
||||||
|
|
||||||
|
setHidden(hidden: boolean): void {
|
||||||
|
NativeModule.setHidden(hidden);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NativeStatusBarManager;
|
||||||
|
|
|
@ -38,6 +38,53 @@ export interface Spec extends TurboModule {
|
||||||
+setHidden: (hidden: boolean, withAnimation: string) => void;
|
+setHidden: (hidden: boolean, withAnimation: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
const NativeModule = TurboModuleRegistry.getEnforcing<Spec>('StatusBarManager');
|
||||||
'StatusBarManager',
|
let constants = null;
|
||||||
): Spec);
|
|
||||||
|
const NativeStatusBarManager = {
|
||||||
|
getConstants(): {|
|
||||||
|
+HEIGHT: number,
|
||||||
|
+DEFAULT_BACKGROUND_COLOR?: number,
|
||||||
|
|} {
|
||||||
|
if (constants == null) {
|
||||||
|
constants = NativeModule.getConstants();
|
||||||
|
}
|
||||||
|
return constants;
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO(T47754272) Can we remove this method?
|
||||||
|
getHeight(callback: (result: {|height: number|}) => void): void {
|
||||||
|
NativeModule.getHeight(callback);
|
||||||
|
},
|
||||||
|
|
||||||
|
setNetworkActivityIndicatorVisible(visible: boolean): void {
|
||||||
|
NativeModule.setNetworkActivityIndicatorVisible(visible);
|
||||||
|
},
|
||||||
|
|
||||||
|
addListener(eventType: string): void {
|
||||||
|
NativeModule.addListener(eventType);
|
||||||
|
},
|
||||||
|
|
||||||
|
removeListeners(count: number): void {
|
||||||
|
NativeModule.removeListeners(count);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - statusBarStyles can be:
|
||||||
|
* - 'default'
|
||||||
|
* - 'dark-content'
|
||||||
|
* - 'light-content'
|
||||||
|
*/
|
||||||
|
setStyle(statusBarStyle?: ?string, animated: boolean): void {
|
||||||
|
NativeModule.setStyle(statusBarStyle, animated);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* - withAnimation can be: 'none' | 'fade' | 'slide'
|
||||||
|
*/
|
||||||
|
setHidden(hidden: boolean, withAnimation: string): void {
|
||||||
|
NativeModule.setHidden(hidden, withAnimation);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NativeStatusBarManager;
|
||||||
|
|
|
@ -1133,8 +1133,7 @@ function InternalTextInput(props: Props): React.Node {
|
||||||
const style = [props.style];
|
const style = [props.style];
|
||||||
const autoCapitalize = props.autoCapitalize || 'sentences';
|
const autoCapitalize = props.autoCapitalize || 'sentences';
|
||||||
let children = props.children;
|
let children = props.children;
|
||||||
let childCount = 0;
|
const childCount = React.Children.count(children);
|
||||||
React.Children.forEach(children, () => ++childCount);
|
|
||||||
invariant(
|
invariant(
|
||||||
!(props.value && childCount),
|
!(props.value && childCount),
|
||||||
'Cannot specify both value and children.',
|
'Cannot specify both value and children.',
|
||||||
|
|
|
@ -32,14 +32,16 @@ import NativeToastAndroid from './NativeToastAndroid';
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const ToastAndroidConstants = NativeToastAndroid.getConstants();
|
||||||
|
|
||||||
const ToastAndroid = {
|
const ToastAndroid = {
|
||||||
// Toast duration constants
|
// Toast duration constants
|
||||||
SHORT: (NativeToastAndroid.getConstants().SHORT: number),
|
SHORT: (ToastAndroidConstants.SHORT: number),
|
||||||
LONG: (NativeToastAndroid.getConstants().LONG: number),
|
LONG: (ToastAndroidConstants.LONG: number),
|
||||||
// Toast gravity constants
|
// Toast gravity constants
|
||||||
TOP: (NativeToastAndroid.getConstants().TOP: number),
|
TOP: (ToastAndroidConstants.TOP: number),
|
||||||
BOTTOM: (NativeToastAndroid.getConstants().BOTTOM: number),
|
BOTTOM: (ToastAndroidConstants.BOTTOM: number),
|
||||||
CENTER: (NativeToastAndroid.getConstants().CENTER: number),
|
CENTER: (ToastAndroidConstants.CENTER: number),
|
||||||
|
|
||||||
show: function(message: string, duration: number): void {
|
show: function(message: string, duration: number): void {
|
||||||
NativeToastAndroid.show(message, duration);
|
NativeToastAndroid.show(message, duration);
|
||||||
|
|
|
@ -278,18 +278,6 @@ type AndroidViewProps = $ReadOnly<{|
|
||||||
*/
|
*/
|
||||||
renderToHardwareTextureAndroid?: ?boolean,
|
renderToHardwareTextureAndroid?: ?boolean,
|
||||||
|
|
||||||
/**
|
|
||||||
* Views that are only used to layout their children or otherwise don't draw
|
|
||||||
* anything may be automatically removed from the native hierarchy as an
|
|
||||||
* optimization. Set this property to `false` to disable this optimization and
|
|
||||||
* ensure that this `View` exists in the native view hierarchy.
|
|
||||||
*
|
|
||||||
* @platform android
|
|
||||||
*
|
|
||||||
* See https://reactnative.dev/docs/view.html#collapsable
|
|
||||||
*/
|
|
||||||
collapsable?: ?boolean,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this `View` needs to rendered offscreen and composited with an
|
* Whether this `View` needs to rendered offscreen and composited with an
|
||||||
* alpha in order to preserve 100% correct colors and blending behavior.
|
* alpha in order to preserve 100% correct colors and blending behavior.
|
||||||
|
@ -508,6 +496,19 @@ export type ViewProps = $ReadOnly<{|
|
||||||
*/
|
*/
|
||||||
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Views that are only used to layout their children or otherwise don't draw
|
||||||
|
* anything may be automatically removed from the native hierarchy as an
|
||||||
|
* optimization. Set this property to `false` to disable this optimization and
|
||||||
|
* ensure that this `View` exists in the native view hierarchy.
|
||||||
|
*
|
||||||
|
* @platform android
|
||||||
|
* In Fabric, this prop is used in ios as well.
|
||||||
|
*
|
||||||
|
* See https://reactnative.dev/docs/view.html#collapsable
|
||||||
|
*/
|
||||||
|
collapsable?: ?boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to locate this view in end-to-end tests.
|
* Used to locate this view in end-to-end tests.
|
||||||
*
|
*
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import type {ExtendedError} from './Devtools/parseErrorStack';
|
import type {ExtendedError} from './Devtools/parseErrorStack';
|
||||||
import * as LogBoxData from '../LogBox/Data/LogBoxData';
|
|
||||||
import type {ExceptionData} from './NativeExceptionsManager';
|
import type {ExceptionData} from './NativeExceptionsManager';
|
||||||
|
|
||||||
class SyntheticError extends Error {
|
class SyntheticError extends Error {
|
||||||
|
@ -104,7 +103,8 @@ function reportException(
|
||||||
console.error(data.message);
|
console.error(data.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isHandledByLogBox) {
|
if (__DEV__ && isHandledByLogBox) {
|
||||||
|
const LogBoxData = require('../LogBox/Data/LogBoxData');
|
||||||
LogBoxData.addException({
|
LogBoxData.addException({
|
||||||
...data,
|
...data,
|
||||||
isComponentError: !!e.isComponentError,
|
isComponentError: !!e.isComponentError,
|
||||||
|
|
|
@ -56,6 +56,7 @@ class InspectorOverlay extends React.Component<Props> {
|
||||||
<View
|
<View
|
||||||
onStartShouldSetResponder={this.shouldSetResponser}
|
onStartShouldSetResponder={this.shouldSetResponser}
|
||||||
onResponderMove={this.findViewForTouchEvent}
|
onResponderMove={this.findViewForTouchEvent}
|
||||||
|
nativeID="inspectorOverlay"
|
||||||
style={[styles.inspector, {height: Dimensions.get('window').height}]}>
|
style={[styles.inspector, {height: Dimensions.get('window').height}]}>
|
||||||
{content}
|
{content}
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
|
|
||||||
import Platform from '../Utilities/Platform';
|
import Platform from '../Utilities/Platform';
|
||||||
import RCTLog from '../Utilities/RCTLog';
|
import RCTLog from '../Utilities/RCTLog';
|
||||||
import * as LogBoxData from './Data/LogBoxData';
|
|
||||||
import {parseLogBoxLog, parseInterpolation} from './Data/parseLogBoxLog';
|
|
||||||
|
|
||||||
import type {IgnorePattern} from './Data/LogBoxData';
|
import type {IgnorePattern} from './Data/LogBoxData';
|
||||||
|
|
||||||
|
@ -23,6 +21,9 @@ let LogBox;
|
||||||
* LogBox displays logs in the app.
|
* LogBox displays logs in the app.
|
||||||
*/
|
*/
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
|
const LogBoxData = require('./Data/LogBoxData');
|
||||||
|
const {parseLogBoxLog, parseInterpolation} = require('./Data/parseLogBoxLog');
|
||||||
|
|
||||||
// LogBox needs to insert itself early,
|
// LogBox needs to insert itself early,
|
||||||
// in order to access the component stacks appended by React DevTools.
|
// in order to access the component stacks appended by React DevTools.
|
||||||
const {error, warn} = console;
|
const {error, warn} = console;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const AppContainer = require('../ReactNative/AppContainer');
|
const AppContainer = require('../ReactNative/AppContainer');
|
||||||
|
const {RootTagContext} = require('../ReactNative/RootTag');
|
||||||
const I18nManager = require('../ReactNative/I18nManager');
|
const I18nManager = require('../ReactNative/I18nManager');
|
||||||
const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter');
|
const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter');
|
||||||
import NativeModalManager from './NativeModalManager';
|
import NativeModalManager from './NativeModalManager';
|
||||||
|
@ -21,6 +22,7 @@ const ScrollView = require('../Components/ScrollView/ScrollView');
|
||||||
const StyleSheet = require('../StyleSheet/StyleSheet');
|
const StyleSheet = require('../StyleSheet/StyleSheet');
|
||||||
const View = require('../Components/View/View');
|
const View = require('../Components/View/View');
|
||||||
|
|
||||||
|
import type {RootTag} from '../ReactNative/RootTag';
|
||||||
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
||||||
import type {DirectEventHandler} from '../Types/CodegenTypes';
|
import type {DirectEventHandler} from '../Types/CodegenTypes';
|
||||||
import type EmitterSubscription from '../vendor/emitter/EmitterSubscription';
|
import type EmitterSubscription from '../vendor/emitter/EmitterSubscription';
|
||||||
|
@ -156,9 +158,7 @@ class Modal extends React.Component<Props> {
|
||||||
hardwareAccelerated: false,
|
hardwareAccelerated: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
static contextTypes: any | {|rootTag: React$PropType$Primitive<number>|} = {
|
static contextType: React.Context<RootTag> = RootTagContext;
|
||||||
rootTag: PropTypes.number,
|
|
||||||
};
|
|
||||||
|
|
||||||
_identifier: number;
|
_identifier: number;
|
||||||
_eventSubscription: ?EmitterSubscription;
|
_eventSubscription: ?EmitterSubscription;
|
||||||
|
@ -224,9 +224,7 @@ class Modal extends React.Component<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const innerChildren = __DEV__ ? (
|
const innerChildren = __DEV__ ? (
|
||||||
<AppContainer rootTag={this.context.rootTag}>
|
<AppContainer rootTag={this.context}>{this.props.children}</AppContainer>
|
||||||
{this.props.children}
|
|
||||||
</AppContainer>
|
|
||||||
) : (
|
) : (
|
||||||
this.props.children
|
this.props.children
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,4 +19,19 @@ export interface Spec extends TurboModule {
|
||||||
|};
|
|};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (TurboModuleRegistry.getEnforcing<Spec>('SourceCode'): Spec);
|
const NativeModule = TurboModuleRegistry.getEnforcing<Spec>('SourceCode');
|
||||||
|
let constants = null;
|
||||||
|
|
||||||
|
const NativeSourceCode = {
|
||||||
|
getConstants(): {|
|
||||||
|
scriptURL: string,
|
||||||
|
|} {
|
||||||
|
if (constants == null) {
|
||||||
|
constants = NativeModule.getConstants();
|
||||||
|
}
|
||||||
|
|
||||||
|
return constants;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NativeSourceCode;
|
||||||
|
|
|
@ -91,7 +91,7 @@ export type PressEvent = ResponderSyntheticEvent<
|
||||||
button?: ?number, // TODO(macOS GH#774)
|
button?: ?number, // TODO(macOS GH#774)
|
||||||
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
||||||
ctrlKey?: ?boolean, // TODO(macOS GH#774)
|
ctrlKey?: ?boolean, // TODO(macOS GH#774)
|
||||||
force: number,
|
force?: number,
|
||||||
identifier: number,
|
identifier: number,
|
||||||
locationX: number,
|
locationX: number,
|
||||||
locationY: number,
|
locationY: number,
|
||||||
|
|
|
@ -43,7 +43,18 @@ export interface Spec extends TurboModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
const NativeModule: Spec = TurboModuleRegistry.getEnforcing<Spec>('DeviceInfo');
|
const NativeModule: Spec = TurboModuleRegistry.getEnforcing<Spec>('DeviceInfo');
|
||||||
|
let constants = null;
|
||||||
|
|
||||||
const NativeDeviceInfo = NativeModule;
|
const NativeDeviceInfo = {
|
||||||
|
getConstants(): {|
|
||||||
|
+Dimensions: DimensionsPayload,
|
||||||
|
+isIPhoneX_deprecated?: boolean,
|
||||||
|
|} {
|
||||||
|
if (constants == null) {
|
||||||
|
constants = NativeModule.getConstants();
|
||||||
|
}
|
||||||
|
return constants;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default NativeDeviceInfo;
|
export default NativeDeviceInfo;
|
||||||
|
|
|
@ -251,6 +251,7 @@ PODS:
|
||||||
- glog
|
- glog
|
||||||
- RCT-Folly (= 2020.01.13.00)
|
- RCT-Folly (= 2020.01.13.00)
|
||||||
- React-callinvoker (= 1000.0.0)
|
- React-callinvoker (= 1000.0.0)
|
||||||
|
- React-jsi (= 1000.0.0)
|
||||||
- React-jsinspector (= 1000.0.0)
|
- React-jsinspector (= 1000.0.0)
|
||||||
- React-perflogger (= 1000.0.0)
|
- React-perflogger (= 1000.0.0)
|
||||||
- React-runtimeexecutor (= 1000.0.0)
|
- React-runtimeexecutor (= 1000.0.0)
|
||||||
|
@ -523,8 +524,8 @@ SPEC CHECKSUMS:
|
||||||
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
|
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
|
||||||
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
|
||||||
DoubleConversion: 2b45d0f8e156a5b02354c8a4062de64d41ccb4e0
|
DoubleConversion: 2b45d0f8e156a5b02354c8a4062de64d41ccb4e0
|
||||||
FBLazyVector: 612364849df0026a8fdea446ac929d32f9f0a423
|
FBLazyVector: 473624d6d8a95dddea531181b5fe074296b849d4
|
||||||
FBReactNativeSpec: 30d621de10913f14a0a5905ce088ea18b85c2dbb
|
FBReactNativeSpec: aa5face1bbc5054a321b7a71a7a9f63fb9b9ed7f
|
||||||
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
|
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
|
||||||
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
|
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
|
||||||
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
|
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
|
||||||
|
@ -535,34 +536,34 @@ SPEC CHECKSUMS:
|
||||||
glog: 789873d01e4b200777d0a09bc23d548446758699
|
glog: 789873d01e4b200777d0a09bc23d548446758699
|
||||||
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
||||||
RCT-Folly: 55d0039b24e192081ec0b2257f7bd9f42e382fb7
|
RCT-Folly: 55d0039b24e192081ec0b2257f7bd9f42e382fb7
|
||||||
RCTRequired: 6d90ba4846a58d45539e8118ebf7a06d2db379cc
|
RCTRequired: c2b55a638af545470baa7e1953525cbdd249f071
|
||||||
RCTTypeSafety: 9e0a77a9f2c4e0688c985ec1243307d6777805ab
|
RCTTypeSafety: 6f8075941c3b0a18fe2dc4b343aea938d0bad5e2
|
||||||
React: 7070d4f9baf939baedfcd1358acdaf0a259b023d
|
React: 8ebf7e7f105fbcea86199badd55a6bb67a5b8afa
|
||||||
React-ART: 531f0b78884eecc02b0088330e1b820ca7ef186f
|
React-ART: a75138364a2681f5189fe24af2a645a4f9069353
|
||||||
React-callinvoker: 94940d7aa248934637b2a6020aab6c1de893e5c7
|
React-callinvoker: 497cecd63f6e72c269c808e8529b36e31816175f
|
||||||
React-Core: 84250af569c182909120182e89914ae17be2b6ed
|
React-Core: 21186234ce1a0dfdd68bb885f36953f03f6ad595
|
||||||
React-CoreModules: 2c51a966aa8dfb075c85caee7fdc0f1a02062f8a
|
React-CoreModules: 20deecbc9727971b94d8b7e36addba9ee5b3df7b
|
||||||
React-cxxreact: f5a570f0eeea78b7eabf322dc01ed7c54b092320
|
React-cxxreact: 78dadb6f1c308aac81c14cc5fa55eee1bf4e509a
|
||||||
React-jsi: f63877d063edf2a614d67f454ea68825953079ff
|
React-jsi: 04aa49b53eb6627f22a208b7a453b7c695c23f13
|
||||||
React-jsiexecutor: ba971320209048169e0d9e7b0d1d25758e266a2f
|
React-jsiexecutor: 68b861e21c43a19980374229f98003860e389eb7
|
||||||
React-jsinspector: 9a3e9449f88a9abe091b13f6b8a214dd26465b26
|
React-jsinspector: b75196b3c0ed12a6608798366cd627fd93d8aef5
|
||||||
React-perflogger: 0fad4dd40022e77107f74a593204945d78b52876
|
React-perflogger: 1e95f386e69d2531429be35018b9e3a7e7319f0d
|
||||||
React-RCTActionSheet: 5890411c18dcd860bd792882fb20b81f22f25bc4
|
React-RCTActionSheet: 2f5024fba47f6bbae7cd7035bcfe3a2a9ceab828
|
||||||
React-RCTAnimation: ae52c02def54ee24f7522088bffbe33874265ca8
|
React-RCTAnimation: c5daba3acc6601ed49befc73314f3a4a3dffac7e
|
||||||
React-RCTBlob: 6bfe0eab854c0ea95dea90a9f2d9b555502503e0
|
React-RCTBlob: e88442441bf43cb1733faf5ee0369cb77ef9a9c5
|
||||||
React-RCTImage: 16232a23bdb07d5a06705f95b3b40ee28ba3054c
|
React-RCTImage: 0d6613af0b99b24bb2f10d951c36d682b15ba90f
|
||||||
React-RCTLinking: 3d4dcd2e7f15dd11bb18861bdf7b4781f76d4d64
|
React-RCTLinking: b47cd2eda4ad15424f1ad02f4eb9ff027f212f6c
|
||||||
React-RCTNetwork: 0cbd4b96fcf726438f9814631e447cfe4db714c9
|
React-RCTNetwork: 1bdb44306b36686fcdf51fb353cd5bea1910c9dc
|
||||||
React-RCTPushNotification: 61f472384037a2d15fa3c76e069ccde9979c8a89
|
React-RCTPushNotification: 0d9ef4d1acc93d00828de47763834ef9f7e825c7
|
||||||
React-RCTSettings: a9952a40a7d89e4f3aec025185f197e58a1a22a2
|
React-RCTSettings: 606a93f1f422bb1e33e8178715edcbeb00ef0e29
|
||||||
React-RCTTest: b86c663b9dc6b0dccd6b37a794b6a7d8c164c4f3
|
React-RCTTest: 61a59b3db0d728bd3f2e4c477aa39f5308f58d3d
|
||||||
React-RCTText: ee61e09fc11975b5669bcddc36549ee848ad3b83
|
React-RCTText: 377bcb96f1626badf03d4e7cb08efc1e49ca8654
|
||||||
React-RCTVibration: 37bb78ecacc0cfeb619b3b46a436b31246b8fcb1
|
React-RCTVibration: a68e8de67fd7d6fe24f027965291dff20a7e1ecf
|
||||||
React-runtimeexecutor: a0adc3b14832a771a58bdee656a775a096be3d7a
|
React-runtimeexecutor: b5c501cbb838fb190272567117469ba89ca4095c
|
||||||
React-TurboModuleCxx-RNW: 18bb71af41fe34c8b12a56bef60aae7ee32b0817
|
React-TurboModuleCxx-RNW: 18bb71af41fe34c8b12a56bef60aae7ee32b0817
|
||||||
React-TurboModuleCxx-WinRTPort: c5ee8d0f7fd49453996a980a8646afb251339acb
|
React-TurboModuleCxx-WinRTPort: bbf5afaa8aa712919a56b270bee8a83a74d7c6f5
|
||||||
ReactCommon: 37c88457c9e4896daaa6a7aa699f9d54ae5e148e
|
ReactCommon: d4fccf43589bf37d7e3b94c32ce3722a0889d98c
|
||||||
Yoga: 8838387cf620983b4e0e6e6c0486c6041b3faee3
|
Yoga: 4fec242f984a794825ad52bc24af3c0c91da2d7d
|
||||||
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
|
||||||
|
|
||||||
PODFILE CHECKSUM: 7d43a928a9b9ad27329da110adbfadd923a39ba8
|
PODFILE CHECKSUM: 7d43a928a9b9ad27329da110adbfadd923a39ba8
|
||||||
|
|
|
@ -115,7 +115,10 @@ NSString *kBundleNameJS = @"RNTesterApp";
|
||||||
}
|
}
|
||||||
__typeof(self) strongSelf = weakSelf;
|
__typeof(self) strongSelf = weakSelf;
|
||||||
if (strongSelf) {
|
if (strongSelf) {
|
||||||
[strongSelf->_turboModuleManager installJSBindingWithRuntime:&runtime];
|
facebook::react::RuntimeExecutor syncRuntimeExecutor = [&](std::function<void(facebook::jsi::Runtime &runtime_)> &&callback) {
|
||||||
|
callback(runtime);
|
||||||
|
};
|
||||||
|
[strongSelf->_turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -178,7 +178,10 @@
|
||||||
}
|
}
|
||||||
__typeof(self) strongSelf = weakSelf;
|
__typeof(self) strongSelf = weakSelf;
|
||||||
if (strongSelf) {
|
if (strongSelf) {
|
||||||
[strongSelf->_turboModuleManager installJSBindingWithRuntime:&runtime];
|
facebook::react::RuntimeExecutor syncRuntimeExecutor = [&](std::function<void(facebook::jsi::Runtime &runtime_)> &&callback) {
|
||||||
|
callback(runtime);
|
||||||
|
};
|
||||||
|
[strongSelf->_turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -20,12 +20,24 @@ static NSURL *mainBundleURL()
|
||||||
|
|
||||||
static NSURL *localhostBundleURL()
|
static NSURL *localhostBundleURL()
|
||||||
{
|
{
|
||||||
return [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.bundle?platform=%@&dev=true&minify=false&app=com.apple.dt.xctest.tool", testFile, kRCTPlatformName]]; // TODO(macOS ISS#3536887)
|
return [NSURL
|
||||||
|
URLWithString:
|
||||||
|
[NSString
|
||||||
|
stringWithFormat:
|
||||||
|
@"http://localhost:8081/%@.bundle?platform=%@&dev=true&minify=false&modulesOnly=false&runMdoule=true&app=com.apple.dt.xctest.tool",
|
||||||
|
testFile,
|
||||||
|
kRCTPlatformName]]; // TODO(macOS GH#774)
|
||||||
}
|
}
|
||||||
|
|
||||||
static NSURL *ipBundleURL()
|
static NSURL *ipBundleURL()
|
||||||
{
|
{
|
||||||
return [NSURL URLWithString:[NSString stringWithFormat:@"http://192.168.1.1:8081/%@.bundle?platform=%@&dev=true&minify=false&app=com.apple.dt.xctest.tool", testFile, kRCTPlatformName]]; // TODO(macOS ISS#3536887)
|
return [NSURL
|
||||||
|
URLWithString:
|
||||||
|
[NSString
|
||||||
|
stringWithFormat:
|
||||||
|
@"http://192.168.1.1:8081/%@.bundle?platform=%@&dev=true&minify=false&modulesOnly=false&runMdoule=true&app=com.apple.dt.xctest.tool",
|
||||||
|
testFile,
|
||||||
|
kRCTPlatformName]]; // TODO(macOS GH#774)
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation NSBundle (RCTBundleURLProviderTests)
|
@implementation NSBundle (RCTBundleURLProviderTests)
|
||||||
|
@ -50,16 +62,14 @@ static NSURL *ipBundleURL()
|
||||||
{
|
{
|
||||||
[super setUp];
|
[super setUp];
|
||||||
|
|
||||||
RCTSwapInstanceMethods([NSBundle class],
|
RCTSwapInstanceMethods(
|
||||||
@selector(URLForResource:withExtension:),
|
[NSBundle class], @selector(URLForResource:withExtension:), @selector(RCT_URLForResource:withExtension:));
|
||||||
@selector(RCT_URLForResource:withExtension:));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tearDown
|
- (void)tearDown
|
||||||
{
|
{
|
||||||
RCTSwapInstanceMethods([NSBundle class],
|
RCTSwapInstanceMethods(
|
||||||
@selector(URLForResource:withExtension:),
|
[NSBundle class], @selector(URLForResource:withExtension:), @selector(RCT_URLForResource:withExtension:));
|
||||||
@selector(RCT_URLForResource:withExtension:));
|
|
||||||
|
|
||||||
[super tearDown];
|
[super tearDown];
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ function ForceTouchExample() {
|
||||||
style={styles.wrapper}
|
style={styles.wrapper}
|
||||||
testID="pressable_3dtouch_button"
|
testID="pressable_3dtouch_button"
|
||||||
onStartShouldSetResponder={() => true}
|
onStartShouldSetResponder={() => true}
|
||||||
onResponderMove={event => setForce(event.nativeEvent.force)}
|
onResponderMove={event => setForce(event.nativeEvent?.force || 1)}
|
||||||
onResponderRelease={event => setForce(0)}>
|
onResponderRelease={event => setForce(0)}>
|
||||||
<Text style={styles.button}>Press Me</Text>
|
<Text style={styles.button}>Press Me</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -47,6 +47,11 @@ extern NSString *const kRCTPlatformName; // TODO(macOS GH#774)
|
||||||
*/
|
*/
|
||||||
- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL * (^)(void))fallbackURLProvider;
|
- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL * (^)(void))fallbackURLProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the jsBundleURL for a given split bundle entrypoint in development
|
||||||
|
*/
|
||||||
|
- (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the jsBundleURL for a given bundle entrypoint and
|
* Returns the jsBundleURL for a given bundle entrypoint and
|
||||||
* the fallback offline JS bundle if the packager is not running.
|
* the fallback offline JS bundle if the packager is not running.
|
||||||
|
@ -91,15 +96,30 @@ extern NSString *const kRCTPlatformName; // TODO(macOS GH#774)
|
||||||
+ (instancetype)sharedSettings;
|
+ (instancetype)sharedSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Given a hostname for the packager and a bundle root, returns the URL to the js bundle. Generally you should use the
|
* Given a hostname for the packager and a bundle root, returns the URL to the js bundle. Generally you should use the
|
||||||
instance method -jsBundleURLForBundleRoot:fallbackResource: which includes logic to guess if the packager is running
|
* instance method -jsBundleURLForBundleRoot:fallbackResource: which includes logic to guess if the packager is running
|
||||||
and fall back to a pre-packaged bundle if it is not.
|
* and fall back to a pre-packaged bundle if it is not.
|
||||||
|
*
|
||||||
|
* The options here mirror some of Metro's Bundling Options:
|
||||||
|
* - enableDev: Whether to keep or remove `__DEV__` blocks from the bundle.
|
||||||
|
* - enableMinification: Enables or disables minification. Usually production bundles are minified and development
|
||||||
|
* bundles are not.
|
||||||
|
* - modulesOnly: When true, will only send module definitions without polyfills and without the require-runtime.
|
||||||
|
* - runModule: When true, will run the main module after defining all modules. This is used in the main bundle but not
|
||||||
|
* in split bundles.
|
||||||
*/
|
*/
|
||||||
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
||||||
packagerHost:(NSString *)packagerHost
|
packagerHost:(NSString *)packagerHost
|
||||||
enableDev:(BOOL)enableDev
|
enableDev:(BOOL)enableDev
|
||||||
enableMinification:(BOOL)enableMinification;
|
enableMinification:(BOOL)enableMinification;
|
||||||
|
|
||||||
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
||||||
|
packagerHost:(NSString *)packagerHost
|
||||||
|
enableDev:(BOOL)enableDev
|
||||||
|
enableMinification:(BOOL)enableMinification
|
||||||
|
modulesOnly:(BOOL)modulesOnly
|
||||||
|
runModule:(BOOL)runModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
|
* Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
|
||||||
* In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
|
* In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
|
||||||
|
|
|
@ -151,6 +151,16 @@ static NSURL *serverRootWithHostPort(NSString *hostPort)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot
|
||||||
|
{
|
||||||
|
return [RCTBundleURLProvider jsBundleURLForBundleRoot:bundleRoot
|
||||||
|
packagerHost:[self packagerServerHost]
|
||||||
|
enableDev:[self enableDev]
|
||||||
|
enableMinification:[self enableMinification]
|
||||||
|
modulesOnly:YES
|
||||||
|
runModule:NO];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
||||||
fallbackResource:(NSString *)resourceName
|
fallbackResource:(NSString *)resourceName
|
||||||
fallbackExtension:(NSString *)extension
|
fallbackExtension:(NSString *)extension
|
||||||
|
@ -192,13 +202,31 @@ static NSURL *serverRootWithHostPort(NSString *hostPort)
|
||||||
packagerHost:(NSString *)packagerHost
|
packagerHost:(NSString *)packagerHost
|
||||||
enableDev:(BOOL)enableDev
|
enableDev:(BOOL)enableDev
|
||||||
enableMinification:(BOOL)enableMinification
|
enableMinification:(BOOL)enableMinification
|
||||||
|
|
||||||
|
{
|
||||||
|
return [self jsBundleURLForBundleRoot:bundleRoot
|
||||||
|
packagerHost:packagerHost
|
||||||
|
enableDev:enableDev
|
||||||
|
enableMinification:enableMinification
|
||||||
|
modulesOnly:NO
|
||||||
|
runModule:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
||||||
|
packagerHost:(NSString *)packagerHost
|
||||||
|
enableDev:(BOOL)enableDev
|
||||||
|
enableMinification:(BOOL)enableMinification
|
||||||
|
modulesOnly:(BOOL)modulesOnly
|
||||||
|
runModule:(BOOL)runModule
|
||||||
{
|
{
|
||||||
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
|
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
|
||||||
// When we support only iOS 8 and above, use queryItems for a better API.
|
// When we support only iOS 8 and above, use queryItems for a better API.
|
||||||
NSString *query = [NSString stringWithFormat:@"platform=%@&dev=%@&minify=%@",
|
NSString *query = [NSString stringWithFormat:@"platform=%@&dev=%@&minify=%@&modulesOnly=%@&runMdoule=%@",
|
||||||
kRCTPlatformName, // TODO(macOS GH#774)
|
kRCTPlatformName, // TODO(macOS GH#774)
|
||||||
enableDev ? @"true" : @"false",
|
enableDev ? @"true" : @"false",
|
||||||
enableMinification ? @"true" : @"false"];
|
enableMinification ? @"true" : @"false",
|
||||||
|
modulesOnly ? @"true" : @"false",
|
||||||
|
runModule ? @"true" : @"false"];
|
||||||
NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
|
NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
|
||||||
if (bundleID) {
|
if (bundleID) {
|
||||||
query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
|
query = [NSString stringWithFormat:@"%@&app=%@", query, bundleID];
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#import <React/RCTInvalidating.h>
|
#import <React/RCTInvalidating.h>
|
||||||
|
#import "RCTDefines.h"
|
||||||
|
|
||||||
@protocol RCTBridgeMethod;
|
@protocol RCTBridgeMethod;
|
||||||
@protocol RCTBridgeModule;
|
@protocol RCTBridgeModule;
|
||||||
|
@ -94,3 +95,6 @@ typedef id<RCTBridgeModule> (^RCTBridgeModuleProvider)(void);
|
||||||
@property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush;
|
@property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
RCT_EXTERN void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val);
|
||||||
|
RCT_EXTERN BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled();
|
||||||
|
|
|
@ -29,6 +29,17 @@ int32_t getUniqueId()
|
||||||
return counter++;
|
return counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static BOOL isMainQueueExecutionOfConstantToExportDisabled = NO;
|
||||||
|
|
||||||
|
void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val)
|
||||||
|
{
|
||||||
|
isMainQueueExecutionOfConstantToExportDisabled = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled()
|
||||||
|
{
|
||||||
|
return isMainQueueExecutionOfConstantToExportDisabled;
|
||||||
|
}
|
||||||
|
|
||||||
@implementation RCTModuleData {
|
@implementation RCTModuleData {
|
||||||
NSDictionary<NSString *, id> *_constantsToExport;
|
NSDictionary<NSString *, id> *_constantsToExport;
|
||||||
|
@ -389,7 +400,8 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init);
|
||||||
* require.
|
* require.
|
||||||
*/
|
*/
|
||||||
BridgeNativeModulePerfLogger::moduleJSRequireEndingStart([moduleName UTF8String]);
|
BridgeNativeModulePerfLogger::moduleJSRequireEndingStart([moduleName UTF8String]);
|
||||||
if (_requiresMainQueueSetup) {
|
|
||||||
|
if (!RCTIsMainQueueExecutionOfConstantsToExportDisabled() && _requiresMainQueueSetup) {
|
||||||
if (!RCTIsMainQueue()) {
|
if (!RCTIsMainQueue()) {
|
||||||
RCTLogWarn(@"Required dispatch_sync to load constants for %@. This may lead to deadlocks", _moduleClass);
|
RCTLogWarn(@"Required dispatch_sync to load constants for %@. This may lead to deadlocks", _moduleClass);
|
||||||
}
|
}
|
||||||
|
@ -400,6 +412,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init);
|
||||||
} else {
|
} else {
|
||||||
_constantsToExport = [_instance constantsToExport] ?: @{};
|
_constantsToExport = [_instance constantsToExport] ?: @{};
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -67,9 +67,14 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)getConstants
|
- (facebook::react::ModuleConstants<JS::NativeAppState::Constants>)getConstants
|
||||||
{
|
{
|
||||||
return facebook::react::typedConstants<JS::NativeAppState::Constants>({
|
__block facebook::react::ModuleConstants<JS::NativeAppState::Constants> constants;
|
||||||
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||||
|
constants = facebook::react::typedConstants<JS::NativeAppState::Constants>({
|
||||||
.initialAppState = RCTCurrentAppState(),
|
.initialAppState = RCTCurrentAppState(),
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Lifecycle
|
#pragma mark - Lifecycle
|
||||||
|
|
|
@ -138,9 +138,11 @@ NSDictionary *RCTExportedDimensions(RCTPlatformView *rootView)
|
||||||
|
|
||||||
- (NSDictionary<NSString *, id> *)getConstants
|
- (NSDictionary<NSString *, id> *)getConstants
|
||||||
{
|
{
|
||||||
return @{
|
__block NSDictionary<NSString *, id> *constants;
|
||||||
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||||
|
constants = @{
|
||||||
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
||||||
@"Dimensions" : RCTExportedDimensions(_bridge),
|
@"Dimensions" : RCTExportedDimensions(self->_bridge),
|
||||||
#else // [TODO(macOS GH#774)
|
#else // [TODO(macOS GH#774)
|
||||||
@"Dimensions": RCTExportedDimensions(nil),
|
@"Dimensions": RCTExportedDimensions(nil),
|
||||||
#endif // ]TODO(macOS GH#774)
|
#endif // ]TODO(macOS GH#774)
|
||||||
|
@ -150,6 +152,9 @@ NSDictionary *RCTExportedDimensions(RCTPlatformView *rootView)
|
||||||
// Use <SafeAreaView> instead.
|
// Use <SafeAreaView> instead.
|
||||||
@"isIPhoneX_deprecated" : @(RCTIsIPhoneX()),
|
@"isIPhoneX_deprecated" : @(RCTIsIPhoneX()),
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)didReceiveNewContentSizeMultiplier
|
- (void)didReceiveNewContentSizeMultiplier
|
||||||
|
|
|
@ -58,9 +58,11 @@ RCT_EXPORT_MODULE(PlatformConstants)
|
||||||
|
|
||||||
- (ModuleConstants<JS::NativePlatformConstantsIOS::Constants>)getConstants
|
- (ModuleConstants<JS::NativePlatformConstantsIOS::Constants>)getConstants
|
||||||
{
|
{
|
||||||
|
__block ModuleConstants<JS::NativePlatformConstantsIOS::Constants> constants;
|
||||||
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||||
UIDevice *device = [UIDevice currentDevice];
|
UIDevice *device = [UIDevice currentDevice];
|
||||||
auto versions = RCTGetReactNativeVersion();
|
auto versions = RCTGetReactNativeVersion();
|
||||||
return typedConstants<JS::NativePlatformConstantsIOS::Constants>({
|
constants = typedConstants<JS::NativePlatformConstantsIOS::Constants>({
|
||||||
.forceTouchAvailable = RCTForceTouchAvailable() ? true : false,
|
.forceTouchAvailable = RCTForceTouchAvailable() ? true : false,
|
||||||
.osVersion = [device systemVersion],
|
.osVersion = [device systemVersion],
|
||||||
.systemName = [device systemName],
|
.systemName = [device systemName],
|
||||||
|
@ -74,6 +76,9 @@ RCT_EXPORT_MODULE(PlatformConstants)
|
||||||
? folly::Optional<double>{}
|
? folly::Optional<double>{}
|
||||||
: [versions[@"prerelease"] doubleValue]}),
|
: [versions[@"prerelease"] doubleValue]}),
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (std::shared_ptr<TurboModule>)getTurboModule:(const ObjCTurboModule::InitParams &)params
|
- (std::shared_ptr<TurboModule>)getTurboModule:(const ObjCTurboModule::InitParams &)params
|
||||||
|
|
|
@ -185,10 +185,15 @@ RCT_EXPORT_METHOD(setNetworkActivityIndicatorVisible : (BOOL)visible)
|
||||||
|
|
||||||
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants
|
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)getConstants
|
||||||
{
|
{
|
||||||
return facebook::react::typedConstants<JS::NativeStatusBarManagerIOS::Constants>({
|
__block facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants> constants;
|
||||||
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||||
|
constants = facebook::react::typedConstants<JS::NativeStatusBarManagerIOS::Constants>({
|
||||||
.HEIGHT = RCTSharedApplication().statusBarFrame.size.height,
|
.HEIGHT = RCTSharedApplication().statusBarFrame.size.height,
|
||||||
.DEFAULT_BACKGROUND_COLOR = folly::none,
|
.DEFAULT_BACKGROUND_COLOR = folly::none,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)constantsToExport
|
- (facebook::react::ModuleConstants<JS::NativeStatusBarManagerIOS::Constants>)constantsToExport
|
||||||
|
|
|
@ -265,10 +265,24 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||||
_moduleDataByID = [NSMutableArray new];
|
_moduleDataByID = [NSMutableArray new];
|
||||||
|
|
||||||
[RCTBridge setCurrentBridge:self];
|
[RCTBridge setCurrentBridge:self];
|
||||||
|
|
||||||
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(handleMemoryWarning)
|
||||||
|
name:UIApplicationDidReceiveMemoryWarningNotification
|
||||||
|
object:nil];
|
||||||
|
#endif // TODO(macOS GH#774)
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
#endif // TODO9macOS GH#774)
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)runRunLoop
|
+ (void)runRunLoop
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
@ -302,6 +316,20 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)handleMemoryWarning
|
||||||
|
{
|
||||||
|
if (!_valid || !_loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We need to hold a local retaining pointer to react instance
|
||||||
|
// in case if some other tread resets it.
|
||||||
|
auto reactInstance = _reactInstance;
|
||||||
|
if (reactInstance) {
|
||||||
|
reactInstance->handleMemoryPressure(15 /* TRIM_MEMORY_RUNNING_CRITICAL */);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure block is run on the JS thread. If we're already on the JS thread, the block will execute synchronously.
|
* Ensure block is run on the JS thread. If we're already on the JS thread, the block will execute synchronously.
|
||||||
* If we're not on the JS thread, the block is dispatched to that thread. Any errors encountered while executing
|
* If we're not on the JS thread, the block is dispatched to that thread. Any errors encountered while executing
|
||||||
|
@ -911,7 +939,9 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||||
if (self.valid && ![moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) {
|
if (self.valid && ![moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) {
|
||||||
[self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread];
|
[self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread];
|
||||||
(void)[moduleData instance];
|
(void)[moduleData instance];
|
||||||
|
if (!RCTIsMainQueueExecutionOfConstantsToExportDisabled()) {
|
||||||
[moduleData gatherConstants];
|
[moduleData gatherConstants];
|
||||||
|
}
|
||||||
[self->_performanceLogger appendStopForTag:RCTPLNativeModuleMainThread];
|
[self->_performanceLogger appendStopForTag:RCTPLNativeModuleMainThread];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,7 +114,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||||
|
|
||||||
if (_layoutAnimationsEnabled) {
|
if (_layoutAnimationsEnabled) {
|
||||||
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
|
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
|
||||||
_animationDriver = std::make_unique<LayoutAnimationDriver>(_layoutAnimationDelegateProxy.get());
|
_animationDriver = std::make_shared<LayoutAnimationDriver>(_layoutAnimationDelegateProxy.get());
|
||||||
_uiRunLoopObserver =
|
_uiRunLoopObserver =
|
||||||
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
|
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
|
||||||
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
|
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
|
||||||
|
@ -152,12 +152,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||||
|
|
||||||
auto props = convertIdToFollyDynamic(initialProps);
|
auto props = convertIdToFollyDynamic(initialProps);
|
||||||
_scheduler->startSurface(
|
_scheduler->startSurface(
|
||||||
surfaceId,
|
surfaceId, RCTStringFromNSString(moduleName), props, layoutConstraints, layoutContext, _animationDriver);
|
||||||
RCTStringFromNSString(moduleName),
|
|
||||||
props,
|
|
||||||
layoutConstraints,
|
|
||||||
layoutContext,
|
|
||||||
(_animationDriver ? _animationDriver.get() : nullptr));
|
|
||||||
_scheduler->renderTemplateToSurface(
|
_scheduler->renderTemplateToSurface(
|
||||||
surfaceId, props.getDefault("navigationConfig").getDefault("initialUITemplate", "").getString());
|
surfaceId, props.getDefault("navigationConfig").getDefault("initialUITemplate", "").getString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,9 +655,9 @@ public class ReactInstanceManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Temporary: due to T62192299, log sources of destroy calls. TODO T62192299: delete */
|
/** Temporary: due to T67035147, log sources of destroy calls. TODO T67035147: delete */
|
||||||
private void logOnDestroy() {
|
private void logOnDestroy() {
|
||||||
FLog.e(
|
FLog.d(
|
||||||
TAG,
|
TAG,
|
||||||
"ReactInstanceManager.destroy called",
|
"ReactInstanceManager.destroy called",
|
||||||
new RuntimeException("ReactInstanceManager.destroy called"));
|
new RuntimeException("ReactInstanceManager.destroy called"));
|
||||||
|
@ -669,7 +669,6 @@ public class ReactInstanceManager {
|
||||||
UiThreadUtil.assertOnUiThread();
|
UiThreadUtil.assertOnUiThread();
|
||||||
PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: Destroy");
|
PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: Destroy");
|
||||||
|
|
||||||
// TODO T62192299: remove when investigation is complete
|
|
||||||
logOnDestroy();
|
logOnDestroy();
|
||||||
|
|
||||||
if (mHasStartedDestroying) {
|
if (mHasStartedDestroying) {
|
||||||
|
@ -1134,8 +1133,7 @@ public class ReactInstanceManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void attachRootViewToInstance(final ReactRoot reactRoot) {
|
private void attachRootViewToInstance(final ReactRoot reactRoot) {
|
||||||
// TODO: downgrade back to FLog.d once T62192299 is resolved.
|
FLog.d(ReactConstants.TAG, "ReactInstanceManager.attachRootViewToInstance()");
|
||||||
FLog.e(ReactConstants.TAG, "ReactInstanceManager.attachRootViewToInstance()");
|
|
||||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachRootViewToInstance");
|
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachRootViewToInstance");
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -1281,39 +1279,15 @@ public class ReactInstanceManager {
|
||||||
|
|
||||||
reactContext.initializeWithInstance(catalystInstance);
|
reactContext.initializeWithInstance(catalystInstance);
|
||||||
|
|
||||||
if (ReactFeatureFlags.enableTurboModuleDebugLogs) {
|
|
||||||
// TODO(T46487253): Remove after task is closed
|
|
||||||
FLog.e(
|
|
||||||
ReactConstants.TAG,
|
|
||||||
"ReactInstanceManager.createReactContext: mJSIModulePackage "
|
|
||||||
+ (mJSIModulePackage != null ? "not null" : "null"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mJSIModulePackage != null) {
|
if (mJSIModulePackage != null) {
|
||||||
catalystInstance.addJSIModules(
|
catalystInstance.addJSIModules(
|
||||||
mJSIModulePackage.getJSIModules(
|
mJSIModulePackage.getJSIModules(
|
||||||
reactContext, catalystInstance.getJavaScriptContextHolder()));
|
reactContext, catalystInstance.getJavaScriptContextHolder()));
|
||||||
|
|
||||||
if (ReactFeatureFlags.enableTurboModuleDebugLogs) {
|
|
||||||
// TODO(T46487253): Remove after task is closed
|
|
||||||
FLog.e(
|
|
||||||
ReactConstants.TAG,
|
|
||||||
"ReactInstanceManager.createReactContext: ReactFeatureFlags.useTurboModules == "
|
|
||||||
+ (ReactFeatureFlags.useTurboModules == false ? "false" : "true"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ReactFeatureFlags.useTurboModules) {
|
if (ReactFeatureFlags.useTurboModules) {
|
||||||
JSIModule turboModuleManager =
|
JSIModule turboModuleManager =
|
||||||
catalystInstance.getJSIModule(JSIModuleType.TurboModuleManager);
|
catalystInstance.getJSIModule(JSIModuleType.TurboModuleManager);
|
||||||
|
|
||||||
if (ReactFeatureFlags.enableTurboModuleDebugLogs) {
|
|
||||||
// TODO(T46487253): Remove after task is closed
|
|
||||||
FLog.e(
|
|
||||||
ReactConstants.TAG,
|
|
||||||
"ReactInstanceManager.createReactContext: TurboModuleManager "
|
|
||||||
+ (turboModuleManager == null ? "not created" : "created"));
|
|
||||||
}
|
|
||||||
|
|
||||||
catalystInstance.setTurboModuleManager(turboModuleManager);
|
catalystInstance.setTurboModuleManager(turboModuleManager);
|
||||||
|
|
||||||
TurboModuleRegistry registry = (TurboModuleRegistry) turboModuleManager;
|
TurboModuleRegistry registry = (TurboModuleRegistry) turboModuleManager;
|
||||||
|
|
|
@ -523,8 +523,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||||
|
|
||||||
mShouldLogContentAppeared = true;
|
mShouldLogContentAppeared = true;
|
||||||
|
|
||||||
// TODO T62192299: remove this
|
|
||||||
FLog.e(TAG, "runApplication: call AppRegistry.runApplication");
|
|
||||||
catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams);
|
catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams);
|
||||||
} finally {
|
} finally {
|
||||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
|
|
|
@ -10,7 +10,6 @@ package com.facebook.react.animated;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.UiThread;
|
import androidx.annotation.UiThread;
|
||||||
import com.facebook.common.logging.FLog;
|
|
||||||
import com.facebook.fbreact.specs.NativeAnimatedModuleSpec;
|
import com.facebook.fbreact.specs.NativeAnimatedModuleSpec;
|
||||||
import com.facebook.infer.annotation.Assertions;
|
import com.facebook.infer.annotation.Assertions;
|
||||||
import com.facebook.react.bridge.Arguments;
|
import com.facebook.react.bridge.Arguments;
|
||||||
|
@ -21,7 +20,6 @@ import com.facebook.react.bridge.ReadableMap;
|
||||||
import com.facebook.react.bridge.UIManager;
|
import com.facebook.react.bridge.UIManager;
|
||||||
import com.facebook.react.bridge.UIManagerListener;
|
import com.facebook.react.bridge.UIManagerListener;
|
||||||
import com.facebook.react.bridge.WritableMap;
|
import com.facebook.react.bridge.WritableMap;
|
||||||
import com.facebook.react.common.ReactConstants;
|
|
||||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||||
import com.facebook.react.module.annotations.ReactModule;
|
import com.facebook.react.module.annotations.ReactModule;
|
||||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||||
|
@ -108,23 +106,23 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||||
protected void doFrameGuarded(final long frameTimeNanos) {
|
protected void doFrameGuarded(final long frameTimeNanos) {
|
||||||
try {
|
try {
|
||||||
NativeAnimatedNodesManager nodesManager = getNodesManager();
|
NativeAnimatedNodesManager nodesManager = getNodesManager();
|
||||||
if (nodesManager.hasActiveAnimations()) {
|
if (nodesManager != null && nodesManager.hasActiveAnimations()) {
|
||||||
nodesManager.runUpdates(frameTimeNanos);
|
nodesManager.runUpdates(frameTimeNanos);
|
||||||
}
|
}
|
||||||
|
// This is very unlikely to ever be hit.
|
||||||
|
if (nodesManager == null && mReactChoreographer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Would be great to avoid adding this callback in case there are no active
|
// TODO: Would be great to avoid adding this callback in case there are no active
|
||||||
// animations
|
// animations and no outstanding tasks on the operations queue. Apparently frame
|
||||||
// and no outstanding tasks on the operations queue. Apparently frame callbacks can
|
// callbacks can only be posted from the UI thread and therefore we cannot schedule
|
||||||
// only
|
// them directly from other threads.
|
||||||
// be posted from the UI thread and therefore we cannot schedule them directly from
|
|
||||||
// @Override
|
|
||||||
Assertions.assertNotNull(mReactChoreographer)
|
Assertions.assertNotNull(mReactChoreographer)
|
||||||
.postFrameCallback(
|
.postFrameCallback(
|
||||||
ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
|
ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
|
||||||
mAnimatedFrameCallback);
|
mAnimatedFrameCallback);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// TODO T57341690 remove this when T57341690 is resolved
|
|
||||||
FLog.e(ReactConstants.TAG, "Exception while executing animated frame callback.", ex);
|
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +244,8 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHostDestroy() {
|
public void onHostDestroy() {
|
||||||
// do nothing
|
// Is it possible for onHostDestroy to be called without a corresponding onHostPause?
|
||||||
|
clearFrameCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -254,6 +253,13 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||||
return NAME;
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a {@link NativeAnimatedNodesManager}, either the existing instance or a new one. Will
|
||||||
|
* return null if and only if the {@link ReactApplicationContext} is also null.
|
||||||
|
*
|
||||||
|
* @return {@link NativeAnimatedNodesManager}
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
private NativeAnimatedNodesManager getNodesManager() {
|
private NativeAnimatedNodesManager getNodesManager() {
|
||||||
if (mNodesManager == null) {
|
if (mNodesManager == null) {
|
||||||
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
|
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
|
||||||
|
|
|
@ -582,16 +582,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
public NativeModule getNativeModule(String moduleName) {
|
public NativeModule getNativeModule(String moduleName) {
|
||||||
if (getTurboModuleRegistry() != null) {
|
if (getTurboModuleRegistry() != null) {
|
||||||
TurboModule turboModule = getTurboModuleRegistry().getModule(moduleName);
|
TurboModule turboModule = getTurboModuleRegistry().getModule(moduleName);
|
||||||
|
|
||||||
if (ReactFeatureFlags.enableTurboModuleDebugLogs) {
|
|
||||||
// TODO(T46487253): Remove after task is closed
|
|
||||||
FLog.e(
|
|
||||||
ReactConstants.TAG,
|
|
||||||
"CatalystInstanceImpl.getNativeModule: TurboModule "
|
|
||||||
+ moduleName
|
|
||||||
+ (turboModule == null ? " not" : "")
|
|
||||||
+ " found");
|
|
||||||
}
|
|
||||||
if (turboModule != null) {
|
if (turboModule != null) {
|
||||||
return (NativeModule) turboModule;
|
return (NativeModule) turboModule;
|
||||||
}
|
}
|
||||||
|
@ -724,9 +714,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onNativeException(Exception e) {
|
private void onNativeException(Exception e) {
|
||||||
// TODO T62192299: remove this after investigation
|
|
||||||
FLog.e(ReactConstants.TAG, "CatalystInstanceImpl caught native exception", e);
|
|
||||||
|
|
||||||
mNativeModuleCallExceptionHandler.handleException(e);
|
mNativeModuleCallExceptionHandler.handleException(e);
|
||||||
mReactQueueConfiguration
|
mReactQueueConfiguration
|
||||||
.getUIQueueThread()
|
.getUIQueueThread()
|
||||||
|
|
|
@ -23,9 +23,6 @@ public class ReactFeatureFlags {
|
||||||
*/
|
*/
|
||||||
public static volatile boolean useTurboModules = false;
|
public static volatile boolean useTurboModules = false;
|
||||||
|
|
||||||
/** Should we output debug logs to debug the TurboModule infra? */
|
|
||||||
public static volatile boolean enableTurboModuleDebugLogs = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This feature flag enables logs for Fabric
|
* This feature flag enables logs for Fabric
|
||||||
*/
|
*/
|
||||||
|
@ -89,4 +86,7 @@ public class ReactFeatureFlags {
|
||||||
|
|
||||||
/** Feature flag to configure initialization of Fabric surfaces. */
|
/** Feature flag to configure initialization of Fabric surfaces. */
|
||||||
public static boolean enableFabricStartSurfaceWithLayoutMetrics = true;
|
public static boolean enableFabricStartSurfaceWithLayoutMetrics = true;
|
||||||
|
|
||||||
|
/** Feature flag to have FabricUIManager teardown stop all active surfaces. */
|
||||||
|
public static boolean enableFabricStopAllSurfacesOnTeardown = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ package com.facebook.react.devsupport;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.facebook.common.logging.FLog;
|
|
||||||
import com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler;
|
import com.facebook.react.bridge.DefaultNativeModuleCallExceptionHandler;
|
||||||
import com.facebook.react.bridge.ReactContext;
|
import com.facebook.react.bridge.ReactContext;
|
||||||
import com.facebook.react.bridge.ReadableArray;
|
import com.facebook.react.bridge.ReadableArray;
|
||||||
|
@ -158,9 +157,6 @@ public class DisabledDevSupportManager implements DevSupportManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleException(Exception e) {
|
public void handleException(Exception e) {
|
||||||
// TODO T62192299: remove this after investigation
|
|
||||||
FLog.e("DisabledDevSupportManager", "Caught exception", e);
|
|
||||||
|
|
||||||
mDefaultNativeModuleCallExceptionHandler.handleException(e);
|
mDefaultNativeModuleCallExceptionHandler.handleException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.facebook.jni.HybridData;
|
||||||
import com.facebook.proguard.annotations.DoNotStrip;
|
import com.facebook.proguard.annotations.DoNotStrip;
|
||||||
import com.facebook.react.bridge.JavaScriptContextHolder;
|
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||||
import com.facebook.react.bridge.NativeMap;
|
import com.facebook.react.bridge.NativeMap;
|
||||||
|
import com.facebook.react.bridge.RuntimeExecutor;
|
||||||
import com.facebook.react.bridge.queue.MessageQueueThread;
|
import com.facebook.react.bridge.queue.MessageQueueThread;
|
||||||
import com.facebook.react.fabric.events.EventBeatManager;
|
import com.facebook.react.fabric.events.EventBeatManager;
|
||||||
import com.facebook.react.uimanager.PixelUtil;
|
import com.facebook.react.uimanager.PixelUtil;
|
||||||
|
@ -35,6 +36,7 @@ public class Binding {
|
||||||
|
|
||||||
private native void installFabricUIManager(
|
private native void installFabricUIManager(
|
||||||
long jsContextNativePointer,
|
long jsContextNativePointer,
|
||||||
|
RuntimeExecutor runtimeExecutor,
|
||||||
Object uiManager,
|
Object uiManager,
|
||||||
EventBeatManager eventBeatManager,
|
EventBeatManager eventBeatManager,
|
||||||
MessageQueueThread jsMessageQueueThread,
|
MessageQueueThread jsMessageQueueThread,
|
||||||
|
@ -72,8 +74,10 @@ public class Binding {
|
||||||
|
|
||||||
public native void driveCxxAnimations();
|
public native void driveCxxAnimations();
|
||||||
|
|
||||||
|
// TODO (T67721598) Remove the jsContext param once we've migrated to using RuntimeExecutor
|
||||||
public void register(
|
public void register(
|
||||||
@NonNull JavaScriptContextHolder jsContext,
|
@NonNull JavaScriptContextHolder jsContext,
|
||||||
|
@NonNull RuntimeExecutor runtimeExecutor,
|
||||||
@NonNull FabricUIManager fabricUIManager,
|
@NonNull FabricUIManager fabricUIManager,
|
||||||
@NonNull EventBeatManager eventBeatManager,
|
@NonNull EventBeatManager eventBeatManager,
|
||||||
@NonNull MessageQueueThread jsMessageQueueThread,
|
@NonNull MessageQueueThread jsMessageQueueThread,
|
||||||
|
@ -82,6 +86,7 @@ public class Binding {
|
||||||
fabricUIManager.setBinding(this);
|
fabricUIManager.setBinding(this);
|
||||||
installFabricUIManager(
|
installFabricUIManager(
|
||||||
jsContext.get(),
|
jsContext.get(),
|
||||||
|
runtimeExecutor,
|
||||||
fabricUIManager,
|
fabricUIManager,
|
||||||
eventBeatManager,
|
eventBeatManager,
|
||||||
jsMessageQueueThread,
|
jsMessageQueueThread,
|
||||||
|
|
|
@ -74,8 +74,10 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||||
.getCatalystInstance()
|
.getCatalystInstance()
|
||||||
.getReactQueueConfiguration()
|
.getReactQueueConfiguration()
|
||||||
.getJSQueueThread();
|
.getJSQueueThread();
|
||||||
|
|
||||||
binding.register(
|
binding.register(
|
||||||
mJSContext,
|
mJSContext,
|
||||||
|
mReactApplicationContext.getCatalystInstance().getRuntimeExecutor(),
|
||||||
uiManager,
|
uiManager,
|
||||||
eventBeatManager,
|
eventBeatManager,
|
||||||
jsMessageQueueThread,
|
jsMessageQueueThread,
|
||||||
|
|
|
@ -244,6 +244,7 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||||
@ThreadConfined(ANY)
|
@ThreadConfined(ANY)
|
||||||
public void stopSurface(int surfaceID) {
|
public void stopSurface(int surfaceID) {
|
||||||
mBinding.stopSurface(surfaceID);
|
mBinding.stopSurface(surfaceID);
|
||||||
|
mReactContextForRootTag.remove(surfaceID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -286,6 +287,15 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||||
// memory immediately.
|
// memory immediately.
|
||||||
mDispatchUIFrameCallback.stop();
|
mDispatchUIFrameCallback.stop();
|
||||||
|
|
||||||
|
// Stop all attached surfaces
|
||||||
|
if (ReactFeatureFlags.enableFabricStopAllSurfacesOnTeardown) {
|
||||||
|
FLog.e(TAG, "stop all attached surfaces");
|
||||||
|
for (int surfaceId : mReactContextForRootTag.keySet()) {
|
||||||
|
FLog.e(TAG, "stop attached surface: " + surfaceId);
|
||||||
|
stopSurface(surfaceId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mBinding.unregister();
|
mBinding.unregister();
|
||||||
mBinding = null;
|
mBinding = null;
|
||||||
|
|
||||||
|
@ -421,8 +431,9 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@AnyThread
|
@AnyThread
|
||||||
@ThreadConfined(ANY)
|
@ThreadConfined(ANY)
|
||||||
private MountItem createBatchMountItem(MountItem[] items, int size, int commitNumber) {
|
private MountItem createBatchMountItem(
|
||||||
return new BatchMountItem(items, size, commitNumber);
|
int rootTag, MountItem[] items, int size, int commitNumber) {
|
||||||
|
return new BatchMountItem(rootTag, items, size, commitNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
|
@ -483,16 +494,21 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||||
@ThreadConfined(UI)
|
@ThreadConfined(UI)
|
||||||
public void synchronouslyUpdateViewOnUIThread(int reactTag, @NonNull ReadableMap props) {
|
public void synchronouslyUpdateViewOnUIThread(int reactTag, @NonNull ReadableMap props) {
|
||||||
UiThreadUtil.assertOnUiThread();
|
UiThreadUtil.assertOnUiThread();
|
||||||
long time = SystemClock.uptimeMillis();
|
|
||||||
int commitNumber = mCurrentSynchronousCommitNumber++;
|
int commitNumber = mCurrentSynchronousCommitNumber++;
|
||||||
|
|
||||||
|
// We are on the UI thread so this is safe to call. We try to flush any existing
|
||||||
|
// mount instructions that are queued.
|
||||||
|
tryDispatchMountItems();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReactMarker.logFabricMarker(
|
ReactMarker.logFabricMarker(
|
||||||
ReactMarkerConstants.FABRIC_UPDATE_UI_MAIN_THREAD_START, null, commitNumber);
|
ReactMarkerConstants.FABRIC_UPDATE_UI_MAIN_THREAD_START, null, commitNumber);
|
||||||
if (ENABLE_FABRIC_LOGS) {
|
if (ENABLE_FABRIC_LOGS) {
|
||||||
FLog.d(TAG, "SynchronouslyUpdateViewOnUIThread for tag %d", reactTag);
|
FLog.d(TAG, "SynchronouslyUpdateViewOnUIThread for tag %d", reactTag);
|
||||||
}
|
}
|
||||||
scheduleMountItem(
|
|
||||||
updatePropsMountItem(reactTag, props), commitNumber, time, 0, 0, 0, 0, 0, 0);
|
updatePropsMountItem(reactTag, props).execute(mMountingManager);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// TODO T42943890: Fix animations in Fabric and remove this try/catch
|
// TODO T42943890: Fix animations in Fabric and remove this try/catch
|
||||||
ReactSoftException.logSoftException(
|
ReactSoftException.logSoftException(
|
||||||
|
@ -771,6 +787,22 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure surface associated with this MountItem has been started, and not stopped.
|
||||||
|
// TODO T68118357: clean up this logic and simplify this method overall
|
||||||
|
if (mountItem instanceof BatchMountItem) {
|
||||||
|
BatchMountItem batchMountItem = (BatchMountItem) mountItem;
|
||||||
|
int rootTag = batchMountItem.getRootTag();
|
||||||
|
if (mReactContextForRootTag.get(rootTag) == null) {
|
||||||
|
ReactSoftException.logSoftException(
|
||||||
|
TAG,
|
||||||
|
new ReactNoCrashSoftException(
|
||||||
|
"dispatchMountItems: skipping batched item: surface not available ["
|
||||||
|
+ rootTag
|
||||||
|
+ "]"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: if early ViewCommand dispatch ships 100% as a feature, this can be removed.
|
// TODO: if early ViewCommand dispatch ships 100% as a feature, this can be removed.
|
||||||
// This try/catch catches Retryable errors that can only be thrown by ViewCommands, which
|
// This try/catch catches Retryable errors that can only be thrown by ViewCommands, which
|
||||||
// won't be executed here in Early Dispatch mode.
|
// won't be executed here in Early Dispatch mode.
|
||||||
|
|
|
@ -73,10 +73,6 @@ std::shared_ptr<Scheduler> Binding::getScheduler() {
|
||||||
return scheduler_;
|
return scheduler_;
|
||||||
}
|
}
|
||||||
|
|
||||||
LayoutAnimationDriver *Binding::getAnimationDriver() {
|
|
||||||
return (animationDriver_ ? animationDriver_.get() : nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Binding::startSurface(
|
void Binding::startSurface(
|
||||||
jint surfaceId,
|
jint surfaceId,
|
||||||
jni::alias_ref<jstring> moduleName,
|
jni::alias_ref<jstring> moduleName,
|
||||||
|
@ -97,7 +93,7 @@ void Binding::startSurface(
|
||||||
initialProps->consume(),
|
initialProps->consume(),
|
||||||
{},
|
{},
|
||||||
context,
|
context,
|
||||||
getAnimationDriver());
|
animationDriver_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Binding::startSurfaceWithConstraints(
|
void Binding::startSurfaceWithConstraints(
|
||||||
|
@ -144,7 +140,7 @@ void Binding::startSurfaceWithConstraints(
|
||||||
initialProps->consume(),
|
initialProps->consume(),
|
||||||
constraints,
|
constraints,
|
||||||
context,
|
context,
|
||||||
getAnimationDriver());
|
animationDriver_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Binding::renderTemplateToSurface(jint surfaceId, jstring uiTemplate) {
|
void Binding::renderTemplateToSurface(jint surfaceId, jstring uiTemplate) {
|
||||||
|
@ -214,6 +210,7 @@ void Binding::setConstraints(
|
||||||
|
|
||||||
void Binding::installFabricUIManager(
|
void Binding::installFabricUIManager(
|
||||||
jlong jsContextNativePointer,
|
jlong jsContextNativePointer,
|
||||||
|
jni::alias_ref<JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
||||||
jni::alias_ref<jobject> javaUIManager,
|
jni::alias_ref<jobject> javaUIManager,
|
||||||
EventBeatManager *eventBeatManager,
|
EventBeatManager *eventBeatManager,
|
||||||
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
|
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
|
||||||
|
@ -247,8 +244,15 @@ void Binding::installFabricUIManager(
|
||||||
auto sharedJSMessageQueueThread =
|
auto sharedJSMessageQueueThread =
|
||||||
std::make_shared<JMessageQueueThread>(jsMessageQueueThread);
|
std::make_shared<JMessageQueueThread>(jsMessageQueueThread);
|
||||||
|
|
||||||
|
bool useRuntimeExecutor =
|
||||||
|
config->getBool("react_fabric:use_shared_runtime_executor_android");
|
||||||
|
|
||||||
|
RuntimeExecutor runtimeExecutor;
|
||||||
|
if (useRuntimeExecutor) {
|
||||||
|
runtimeExecutor = runtimeExecutorHolder->cthis()->get();
|
||||||
|
} else {
|
||||||
Runtime *runtime = (Runtime *)jsContextNativePointer;
|
Runtime *runtime = (Runtime *)jsContextNativePointer;
|
||||||
RuntimeExecutor runtimeExecutor =
|
runtimeExecutor =
|
||||||
[runtime, sharedJSMessageQueueThread](
|
[runtime, sharedJSMessageQueueThread](
|
||||||
std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
|
std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
|
||||||
sharedJSMessageQueueThread->runOnQueue(
|
sharedJSMessageQueueThread->runOnQueue(
|
||||||
|
@ -256,6 +260,7 @@ void Binding::installFabricUIManager(
|
||||||
callback(*runtime);
|
callback(*runtime);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: T31905686 Create synchronous Event Beat
|
// TODO: T31905686 Create synchronous Event Beat
|
||||||
jni::global_ref<jobject> localJavaUIManager = javaUIManager_;
|
jni::global_ref<jobject> localJavaUIManager = javaUIManager_;
|
||||||
|
@ -297,9 +302,10 @@ void Binding::installFabricUIManager(
|
||||||
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
|
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
|
||||||
|
|
||||||
if (enableLayoutAnimations_) {
|
if (enableLayoutAnimations_) {
|
||||||
animationDriver_ = std::make_unique<LayoutAnimationDriver>(this);
|
animationDriver_ = std::make_shared<LayoutAnimationDriver>(this);
|
||||||
}
|
}
|
||||||
scheduler_ = std::make_shared<Scheduler>(toolbox, getAnimationDriver(), this);
|
scheduler_ = std::make_shared<Scheduler>(
|
||||||
|
toolbox, (animationDriver_ ? animationDriver_.get() : nullptr), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Binding::uninstallFabricUIManager() {
|
void Binding::uninstallFabricUIManager() {
|
||||||
|
@ -844,11 +850,15 @@ void Binding::schedulerDidFinishTransaction(
|
||||||
static auto createMountItemsBatchContainer =
|
static auto createMountItemsBatchContainer =
|
||||||
jni::findClassStatic(UIManagerJavaDescriptor)
|
jni::findClassStatic(UIManagerJavaDescriptor)
|
||||||
->getMethod<alias_ref<JMountItem>(
|
->getMethod<alias_ref<JMountItem>(
|
||||||
jtypeArray<JMountItem::javaobject>, jint, jint)>(
|
jint, jtypeArray<JMountItem::javaobject>, jint, jint)>(
|
||||||
"createBatchMountItem");
|
"createBatchMountItem");
|
||||||
|
|
||||||
auto batch = createMountItemsBatchContainer(
|
auto batch = createMountItemsBatchContainer(
|
||||||
localJavaUIManager, mountItemsArray.get(), position, commitNumber);
|
localJavaUIManager,
|
||||||
|
surfaceId,
|
||||||
|
mountItemsArray.get(),
|
||||||
|
position,
|
||||||
|
commitNumber);
|
||||||
|
|
||||||
static auto scheduleMountItem = jni::findClassStatic(UIManagerJavaDescriptor)
|
static auto scheduleMountItem = jni::findClassStatic(UIManagerJavaDescriptor)
|
||||||
->getMethod<void(
|
->getMethod<void(
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <fbjni/fbjni.h>
|
#include <fbjni/fbjni.h>
|
||||||
#include <react/animations/LayoutAnimationDriver.h>
|
#include <react/animations/LayoutAnimationDriver.h>
|
||||||
#include <react/jni/JMessageQueueThread.h>
|
#include <react/jni/JMessageQueueThread.h>
|
||||||
|
#include <react/jni/JRuntimeExecutor.h>
|
||||||
#include <react/jni/ReadableNativeMap.h>
|
#include <react/jni/ReadableNativeMap.h>
|
||||||
#include <react/scheduler/Scheduler.h>
|
#include <react/scheduler/Scheduler.h>
|
||||||
#include <react/scheduler/SchedulerDelegate.h>
|
#include <react/scheduler/SchedulerDelegate.h>
|
||||||
|
@ -50,6 +51,7 @@ class Binding : public jni::HybridClass<Binding>,
|
||||||
|
|
||||||
void installFabricUIManager(
|
void installFabricUIManager(
|
||||||
jlong jsContextNativePointer,
|
jlong jsContextNativePointer,
|
||||||
|
jni::alias_ref<JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
||||||
jni::alias_ref<jobject> javaUIManager,
|
jni::alias_ref<jobject> javaUIManager,
|
||||||
EventBeatManager *eventBeatManager,
|
EventBeatManager *eventBeatManager,
|
||||||
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
|
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
|
||||||
|
@ -110,7 +112,7 @@ class Binding : public jni::HybridClass<Binding>,
|
||||||
virtual void onAnimationStarted() override;
|
virtual void onAnimationStarted() override;
|
||||||
virtual void onAllAnimationsComplete() override;
|
virtual void onAllAnimationsComplete() override;
|
||||||
LayoutAnimationDriver *getAnimationDriver();
|
LayoutAnimationDriver *getAnimationDriver();
|
||||||
std::unique_ptr<LayoutAnimationDriver> animationDriver_;
|
std::shared_ptr<LayoutAnimationDriver> animationDriver_;
|
||||||
|
|
||||||
std::shared_ptr<Scheduler> scheduler_;
|
std::shared_ptr<Scheduler> scheduler_;
|
||||||
std::mutex schedulerMutex_;
|
std::mutex schedulerMutex_;
|
||||||
|
|
|
@ -26,13 +26,14 @@ import com.facebook.systrace.Systrace;
|
||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
public class BatchMountItem implements MountItem {
|
public class BatchMountItem implements MountItem {
|
||||||
|
|
||||||
|
private final int mRootTag;
|
||||||
@NonNull private final MountItem[] mMountItems;
|
@NonNull private final MountItem[] mMountItems;
|
||||||
|
|
||||||
private final int mSize;
|
private final int mSize;
|
||||||
|
|
||||||
private final int mCommitNumber;
|
private final int mCommitNumber;
|
||||||
|
|
||||||
public BatchMountItem(MountItem[] items, int size, int commitNumber) {
|
public BatchMountItem(int rootTag, MountItem[] items, int size, int commitNumber) {
|
||||||
if (items == null) {
|
if (items == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
}
|
}
|
||||||
|
@ -40,6 +41,7 @@ public class BatchMountItem implements MountItem {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Invalid size received by parameter size: " + size + " items.size = " + items.length);
|
"Invalid size received by parameter size: " + size + " items.size = " + items.length);
|
||||||
}
|
}
|
||||||
|
mRootTag = rootTag;
|
||||||
mMountItems = items;
|
mMountItems = items;
|
||||||
mSize = size;
|
mSize = size;
|
||||||
mCommitNumber = commitNumber;
|
mCommitNumber = commitNumber;
|
||||||
|
@ -68,6 +70,10 @@ public class BatchMountItem implements MountItem {
|
||||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRootTag() {
|
||||||
|
return mRootTag;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
|
|
|
@ -16,6 +16,7 @@ import android.media.MediaMetadataRetriever;
|
||||||
import android.media.MediaScannerConnection;
|
import android.media.MediaScannerConnection;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.MediaStore.Images;
|
import android.provider.MediaStore.Images;
|
||||||
|
@ -47,6 +48,7 @@ import java.nio.channels.Channels;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.ReadableByteChannel;
|
import java.nio.channels.ReadableByteChannel;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
// TODO #6015104: rename to something less iOSish
|
// TODO #6015104: rename to something less iOSish
|
||||||
|
@ -68,21 +70,32 @@ public class CameraRollManager extends NativeCameraRollManagerSpec {
|
||||||
private static final String ASSET_TYPE_VIDEOS = "Videos";
|
private static final String ASSET_TYPE_VIDEOS = "Videos";
|
||||||
private static final String ASSET_TYPE_ALL = "All";
|
private static final String ASSET_TYPE_ALL = "All";
|
||||||
|
|
||||||
private static final String[] PROJECTION = {
|
private static final String SELECTION_BUCKET = Images.Media.BUCKET_DISPLAY_NAME + " = ?";
|
||||||
|
private static final String SELECTION_DATE_TAKEN = Images.Media.DATE_TAKEN + " < ?";
|
||||||
|
private static final String SELECTION_MEDIA_SIZE = Images.Media.SIZE + " < ?";
|
||||||
|
|
||||||
|
private static final int IMAGES_MEDIA_LATITUDE_LONGITUDE_DEPRECATED_API_LEVEL = 29;
|
||||||
|
private static final String[] PROJECTION_LIST;
|
||||||
|
|
||||||
|
static {
|
||||||
|
ArrayList<String> projection_list =
|
||||||
|
new ArrayList<>(
|
||||||
|
Arrays.asList(
|
||||||
Images.Media._ID,
|
Images.Media._ID,
|
||||||
Images.Media.MIME_TYPE,
|
Images.Media.MIME_TYPE,
|
||||||
Images.Media.BUCKET_DISPLAY_NAME,
|
Images.Media.BUCKET_DISPLAY_NAME,
|
||||||
Images.Media.DATE_TAKEN,
|
Images.Media.DATE_TAKEN,
|
||||||
MediaStore.MediaColumns.WIDTH,
|
MediaStore.MediaColumns.WIDTH,
|
||||||
MediaStore.MediaColumns.HEIGHT,
|
MediaStore.MediaColumns.HEIGHT,
|
||||||
Images.Media.LONGITUDE,
|
MediaStore.MediaColumns.DATA));
|
||||||
Images.Media.LATITUDE,
|
if (Build.VERSION.SDK_INT < IMAGES_MEDIA_LATITUDE_LONGITUDE_DEPRECATED_API_LEVEL) {
|
||||||
MediaStore.MediaColumns.DATA
|
projection_list.add(Images.Media.LATITUDE);
|
||||||
};
|
projection_list.add(Images.Media.LONGITUDE);
|
||||||
|
PROJECTION_LIST = projection_list.toArray(new String[0]);
|
||||||
private static final String SELECTION_BUCKET = Images.Media.BUCKET_DISPLAY_NAME + " = ?";
|
} else {
|
||||||
private static final String SELECTION_DATE_TAKEN = Images.Media.DATE_TAKEN + " < ?";
|
PROJECTION_LIST = projection_list.toArray(new String[0]);
|
||||||
private static final String SELECTION_MEDIA_SIZE = Images.Media.SIZE + " < ?";
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public CameraRollManager(ReactApplicationContext reactContext) {
|
public CameraRollManager(ReactApplicationContext reactContext) {
|
||||||
super(reactContext);
|
super(reactContext);
|
||||||
|
@ -351,7 +364,7 @@ public class CameraRollManager extends NativeCameraRollManagerSpec {
|
||||||
Cursor media =
|
Cursor media =
|
||||||
resolver.query(
|
resolver.query(
|
||||||
MediaStore.Files.getContentUri("external"),
|
MediaStore.Files.getContentUri("external"),
|
||||||
PROJECTION,
|
PROJECTION_LIST,
|
||||||
selection.toString(),
|
selection.toString(),
|
||||||
selectionArgs.toArray(new String[selectionArgs.size()]),
|
selectionArgs.toArray(new String[selectionArgs.size()]),
|
||||||
Images.Media.DATE_TAKEN
|
Images.Media.DATE_TAKEN
|
||||||
|
@ -413,7 +426,9 @@ public class CameraRollManager extends NativeCameraRollManagerSpec {
|
||||||
resolver, media, node, idIndex, widthIndex, heightIndex, dataIndex, mimeTypeIndex);
|
resolver, media, node, idIndex, widthIndex, heightIndex, dataIndex, mimeTypeIndex);
|
||||||
if (imageInfoSuccess) {
|
if (imageInfoSuccess) {
|
||||||
putBasicNodeInfo(media, node, mimeTypeIndex, groupNameIndex, dateTakenIndex);
|
putBasicNodeInfo(media, node, mimeTypeIndex, groupNameIndex, dateTakenIndex);
|
||||||
|
if (Build.VERSION.SDK_INT < IMAGES_MEDIA_LATITUDE_LONGITUDE_DEPRECATED_API_LEVEL) {
|
||||||
putLocationInfo(media, node, longitudeIndex, latitudeIndex);
|
putLocationInfo(media, node, longitudeIndex, latitudeIndex);
|
||||||
|
}
|
||||||
|
|
||||||
edge.putMap("node", node);
|
edge.putMap("node", node);
|
||||||
edges.pushMap(edge);
|
edges.pushMap(edge);
|
||||||
|
|
|
@ -19,7 +19,6 @@ import com.facebook.react.bridge.JSIModule;
|
||||||
import com.facebook.react.bridge.JavaScriptContextHolder;
|
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||||
import com.facebook.react.bridge.NativeModule;
|
import com.facebook.react.bridge.NativeModule;
|
||||||
import com.facebook.react.common.ReactConstants;
|
import com.facebook.react.common.ReactConstants;
|
||||||
import com.facebook.react.config.ReactFeatureFlags;
|
|
||||||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
||||||
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
||||||
import com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry;
|
import com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry;
|
||||||
|
@ -142,15 +141,6 @@ public class TurboModuleManager implements JSIModule, TurboModuleRegistry {
|
||||||
/*
|
/*
|
||||||
* Always return null after cleanup has started, so that getModule(moduleName) returns null.
|
* Always return null after cleanup has started, so that getModule(moduleName) returns null.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (ReactFeatureFlags.enableTurboModuleDebugLogs) {
|
|
||||||
// TODO(T46487253): Remove after task is closed
|
|
||||||
FLog.e(
|
|
||||||
ReactConstants.TAG,
|
|
||||||
"TurboModuleManager.getOrMaybeCreateTurboModuleHolder: Tried to require TurboModule "
|
|
||||||
+ moduleName
|
|
||||||
+ " after cleanup initiated");
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,8 +104,8 @@ public class DisplayMetricsHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String, Map<String, Object>> getDisplayMetricsMap(double fontScale) {
|
public static Map<String, Map<String, Object>> getDisplayMetricsMap(double fontScale) {
|
||||||
Assertions.assertNotNull(
|
Assertions.assertCondition(
|
||||||
sWindowDisplayMetrics != null || sScreenDisplayMetrics != null,
|
sWindowDisplayMetrics != null && sScreenDisplayMetrics != null,
|
||||||
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
|
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
|
||||||
final Map<String, Map<String, Object>> result = new HashMap<>();
|
final Map<String, Map<String, Object>> result = new HashMap<>();
|
||||||
result.put("windowPhysicalPixels", getPhysicalPixelsMap(sWindowDisplayMetrics, fontScale));
|
result.put("windowPhysicalPixels", getPhysicalPixelsMap(sWindowDisplayMetrics, fontScale));
|
||||||
|
@ -114,8 +114,8 @@ public class DisplayMetricsHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WritableNativeMap getDisplayMetricsNativeMap(double fontScale) {
|
public static WritableNativeMap getDisplayMetricsNativeMap(double fontScale) {
|
||||||
Assertions.assertNotNull(
|
Assertions.assertCondition(
|
||||||
sWindowDisplayMetrics != null || sScreenDisplayMetrics != null,
|
sWindowDisplayMetrics != null && sScreenDisplayMetrics != null,
|
||||||
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
|
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics");
|
||||||
final WritableNativeMap result = new WritableNativeMap();
|
final WritableNativeMap result = new WritableNativeMap();
|
||||||
result.putMap(
|
result.putMap(
|
||||||
|
|
|
@ -73,6 +73,10 @@ public class ReactSliderManager extends SimpleViewManager<ReactSlider>
|
||||||
YogaMeasureMode heightMode) {
|
YogaMeasureMode heightMode) {
|
||||||
if (!mMeasured) {
|
if (!mMeasured) {
|
||||||
SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);
|
SeekBar reactSlider = new ReactSlider(getThemedContext(), null, STYLE);
|
||||||
|
// reactSlider is used for measurements purposes, it is not necessary to set a
|
||||||
|
// StateListAnimator.
|
||||||
|
// It is not safe to access StateListAnimator from a background thread.
|
||||||
|
reactSlider.setStateListAnimator(null);
|
||||||
final int spec =
|
final int spec =
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT, View.MeasureSpec.UNSPECIFIED);
|
ViewGroup.LayoutParams.WRAP_CONTENT, View.MeasureSpec.UNSPECIFIED);
|
||||||
|
|
|
@ -41,16 +41,12 @@ void JReactMarker::logPerfMarker(
|
||||||
const char *tag) {
|
const char *tag) {
|
||||||
switch (markerId) {
|
switch (markerId) {
|
||||||
case ReactMarker::RUN_JS_BUNDLE_START:
|
case ReactMarker::RUN_JS_BUNDLE_START:
|
||||||
LOG(ERROR) << "logMarker RUN_JS_BUNDLE_START"; // TODO T62192299: delete
|
|
||||||
JReactMarker::logMarker("RUN_JS_BUNDLE_START", tag);
|
JReactMarker::logMarker("RUN_JS_BUNDLE_START", tag);
|
||||||
break;
|
break;
|
||||||
case ReactMarker::RUN_JS_BUNDLE_STOP:
|
case ReactMarker::RUN_JS_BUNDLE_STOP:
|
||||||
LOG(ERROR) << "logMarker RUN_JS_BUNDLE_END"; // TODO T62192299: delete
|
|
||||||
JReactMarker::logMarker("RUN_JS_BUNDLE_END", tag);
|
JReactMarker::logMarker("RUN_JS_BUNDLE_END", tag);
|
||||||
break;
|
break;
|
||||||
case ReactMarker::CREATE_REACT_CONTEXT_STOP:
|
case ReactMarker::CREATE_REACT_CONTEXT_STOP:
|
||||||
LOG(ERROR)
|
|
||||||
<< "logMarker CREATE_REACT_CONTEXT_END"; // TODO T62192299: delete
|
|
||||||
JReactMarker::logMarker("CREATE_REACT_CONTEXT_END");
|
JReactMarker::logMarker("CREATE_REACT_CONTEXT_END");
|
||||||
break;
|
break;
|
||||||
case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:
|
case ReactMarker::JS_BUNDLE_STRING_CONVERT_START:
|
||||||
|
|
|
@ -149,6 +149,7 @@ rn_xplat_cxx_library(
|
||||||
"//xplat/folly:headers_only",
|
"//xplat/folly:headers_only",
|
||||||
"//xplat/folly:memory",
|
"//xplat/folly:memory",
|
||||||
"//xplat/folly:molly",
|
"//xplat/folly:molly",
|
||||||
|
"//xplat/jsi:jsi",
|
||||||
react_native_xplat_target("callinvoker:callinvoker"),
|
react_native_xplat_target("callinvoker:callinvoker"),
|
||||||
react_native_xplat_target("jsinspector:jsinspector"),
|
react_native_xplat_target("jsinspector:jsinspector"),
|
||||||
react_native_xplat_target("microprofiler:microprofiler"),
|
react_native_xplat_target("microprofiler:microprofiler"),
|
||||||
|
|
|
@ -222,8 +222,12 @@ ModuleRegistry &Instance::getModuleRegistry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::handleMemoryPressure(int pressureLevel) {
|
void Instance::handleMemoryPressure(int pressureLevel) {
|
||||||
|
if (nativeToJsBridge_) {
|
||||||
|
// This class resets `nativeToJsBridge_` only in the destructor,
|
||||||
|
// hence a race is not possible there.
|
||||||
nativeToJsBridge_->handleMemoryPressure(pressureLevel);
|
nativeToJsBridge_->handleMemoryPressure(pressureLevel);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
|
std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
|
||||||
return std::static_pointer_cast<CallInvoker>(jsCallInvoker_);
|
return std::static_pointer_cast<CallInvoker>(jsCallInvoker_);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <folly/MoveWrapper.h>
|
#include <folly/MoveWrapper.h>
|
||||||
#include <folly/json.h>
|
#include <folly/json.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
|
#include <jsi/jsi.h>
|
||||||
#include <reactperflogger/BridgeNativeModulePerfLogger.h>
|
#include <reactperflogger/BridgeNativeModulePerfLogger.h>
|
||||||
|
|
||||||
#include "Instance.h"
|
#include "Instance.h"
|
||||||
|
@ -337,17 +338,35 @@ std::shared_ptr<CallInvoker> NativeToJsBridge::getDecoratedNativeCallInvoker(
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeExecutor NativeToJsBridge::getRuntimeExecutor() {
|
RuntimeExecutor NativeToJsBridge::getRuntimeExecutor() {
|
||||||
auto runtimeExecutor =
|
auto runtimeExecutor = [this, isDestroyed = m_destroyed](
|
||||||
[this, isDestroyed = m_destroyed](
|
std::function<void(jsi::Runtime & runtime)>
|
||||||
std::function<void(jsi::Runtime & runtime)> &&callback) {
|
&&callback) {
|
||||||
if (*isDestroyed) {
|
if (*isDestroyed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
runOnExecutorQueue(
|
runOnExecutorQueue([callback = std::move(callback)](JSExecutor *executor) {
|
||||||
[callback = std::move(callback)](JSExecutor *executor) {
|
jsi::Runtime *runtime = (jsi::Runtime *)executor->getJavaScriptContext();
|
||||||
jsi::Runtime *runtime =
|
try {
|
||||||
(jsi::Runtime *)executor->getJavaScriptContext();
|
|
||||||
callback(*runtime);
|
callback(*runtime);
|
||||||
|
} catch (jsi::JSError &originalError) {
|
||||||
|
auto errorUtils = runtime->global().getProperty(*runtime, "ErrorUtils");
|
||||||
|
if (errorUtils.isUndefined() || !errorUtils.isObject() ||
|
||||||
|
!errorUtils.getObject(*runtime).hasProperty(
|
||||||
|
*runtime, "reportFatalError")) {
|
||||||
|
// ErrorUtils was not set up. This probably means the bundle didn't
|
||||||
|
// load properly.
|
||||||
|
throw jsi::JSError(
|
||||||
|
*runtime,
|
||||||
|
"ErrorUtils is not set up properly. Something probably went wrong trying to load the JS bundle. Trying to report error " +
|
||||||
|
originalError.getMessage(),
|
||||||
|
originalError.getStack());
|
||||||
|
}
|
||||||
|
// TODO(janzer): Rewrite this function to return the processed error
|
||||||
|
// instead of just reporting it through the native module
|
||||||
|
auto func = errorUtils.asObject(*runtime).getPropertyAsFunction(
|
||||||
|
*runtime, "reportFatalError");
|
||||||
|
func.call(*runtime, originalError.value(), jsi::Value(true));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return runtimeExecutor;
|
return runtimeExecutor;
|
||||||
|
|
|
@ -44,4 +44,5 @@ Pod::Spec.new do |s|
|
||||||
s.dependency "React-callinvoker", version
|
s.dependency "React-callinvoker", version
|
||||||
s.dependency "React-runtimeexecutor", version
|
s.dependency "React-runtimeexecutor", version
|
||||||
s.dependency "React-perflogger", version
|
s.dependency "React-perflogger", version
|
||||||
|
s.dependency "React-jsi", version
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,7 +92,9 @@ ViewProps::ViewProps(ViewProps const &sourceProps, RawProps const &rawProps)
|
||||||
rawProps,
|
rawProps,
|
||||||
"collapsable",
|
"collapsable",
|
||||||
sourceProps.collapsable,
|
sourceProps.collapsable,
|
||||||
true)){};
|
true)),
|
||||||
|
elevation(
|
||||||
|
convertRawProp(rawProps, "elevation", sourceProps.elevation, {})){};
|
||||||
|
|
||||||
#pragma mark - Convenience Methods
|
#pragma mark - Convenience Methods
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ class ViewProps : public YogaStylableProps, public AccessibilityProps {
|
||||||
|
|
||||||
bool collapsable{true};
|
bool collapsable{true};
|
||||||
|
|
||||||
|
int elevation{};
|
||||||
|
|
||||||
#pragma mark - Convenience Methods
|
#pragma mark - Convenience Methods
|
||||||
|
|
||||||
BorderMetrics resolveBorderMetrics(LayoutMetrics const &layoutMetrics) const;
|
BorderMetrics resolveBorderMetrics(LayoutMetrics const &layoutMetrics) const;
|
||||||
|
|
|
@ -43,6 +43,7 @@ void ViewShadowNode::initialize() noexcept {
|
||||||
viewProps.pointerEvents == PointerEventsMode::None ||
|
viewProps.pointerEvents == PointerEventsMode::None ||
|
||||||
!viewProps.nativeId.empty() || viewProps.accessible ||
|
!viewProps.nativeId.empty() || viewProps.accessible ||
|
||||||
viewProps.opacity != 1.0 || viewProps.transform != Transform{} ||
|
viewProps.opacity != 1.0 || viewProps.transform != Transform{} ||
|
||||||
|
viewProps.elevation != 0 ||
|
||||||
(viewProps.zIndex != 0 &&
|
(viewProps.zIndex != 0 &&
|
||||||
viewProps.yogaStyle.positionType() == YGPositionTypeAbsolute) ||
|
viewProps.yogaStyle.positionType() == YGPositionTypeAbsolute) ||
|
||||||
viewProps.getClipsContentToBounds() ||
|
viewProps.getClipsContentToBounds() ||
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace react {
|
||||||
|
|
||||||
MountingCoordinator::MountingCoordinator(
|
MountingCoordinator::MountingCoordinator(
|
||||||
ShadowTreeRevision baseRevision,
|
ShadowTreeRevision baseRevision,
|
||||||
MountingOverrideDelegate *delegate)
|
std::weak_ptr<MountingOverrideDelegate const> delegate)
|
||||||
: surfaceId_(baseRevision.getRootShadowNode().getSurfaceId()),
|
: surfaceId_(baseRevision.getRootShadowNode().getSurfaceId()),
|
||||||
baseRevision_(baseRevision),
|
baseRevision_(baseRevision),
|
||||||
mountingOverrideDelegate_(delegate) {
|
mountingOverrideDelegate_(delegate) {
|
||||||
|
@ -115,8 +115,10 @@ better::optional<MountingTransaction> MountingCoordinator::pullTransaction()
|
||||||
const {
|
const {
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
|
|
||||||
bool shouldOverridePullTransaction = mountingOverrideDelegate_ != nullptr &&
|
auto mountingOverrideDelegate = mountingOverrideDelegate_.lock();
|
||||||
mountingOverrideDelegate_->shouldOverridePullTransaction();
|
|
||||||
|
bool shouldOverridePullTransaction = mountingOverrideDelegate &&
|
||||||
|
mountingOverrideDelegate->shouldOverridePullTransaction();
|
||||||
|
|
||||||
if (!shouldOverridePullTransaction && !lastRevision_.has_value()) {
|
if (!shouldOverridePullTransaction && !lastRevision_.has_value()) {
|
||||||
return {};
|
return {};
|
||||||
|
@ -143,7 +145,7 @@ better::optional<MountingTransaction> MountingCoordinator::pullTransaction()
|
||||||
// even if there's no `lastRevision_`. Consider cases of animation frames
|
// even if there's no `lastRevision_`. Consider cases of animation frames
|
||||||
// in between React tree updates.
|
// in between React tree updates.
|
||||||
if (shouldOverridePullTransaction) {
|
if (shouldOverridePullTransaction) {
|
||||||
transaction = mountingOverrideDelegate_->pullTransaction(
|
transaction = mountingOverrideDelegate->pullTransaction(
|
||||||
surfaceId_, number_, telemetry, std::move(diffMutations));
|
surfaceId_, number_, telemetry, std::move(diffMutations));
|
||||||
} else if (lastRevision_.hasValue()) {
|
} else if (lastRevision_.hasValue()) {
|
||||||
transaction = MountingTransaction{
|
transaction = MountingTransaction{
|
||||||
|
|
|
@ -40,7 +40,7 @@ class MountingCoordinator final {
|
||||||
*/
|
*/
|
||||||
MountingCoordinator(
|
MountingCoordinator(
|
||||||
ShadowTreeRevision baseRevision,
|
ShadowTreeRevision baseRevision,
|
||||||
MountingOverrideDelegate *delegate);
|
std::weak_ptr<MountingOverrideDelegate const> delegate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the id of the surface that the coordinator belongs to.
|
* Returns the id of the surface that the coordinator belongs to.
|
||||||
|
@ -102,7 +102,7 @@ class MountingCoordinator final {
|
||||||
mutable better::optional<ShadowTreeRevision> lastRevision_{};
|
mutable better::optional<ShadowTreeRevision> lastRevision_{};
|
||||||
mutable MountingTransaction::Number number_{0};
|
mutable MountingTransaction::Number number_{0};
|
||||||
mutable std::condition_variable signal_;
|
mutable std::condition_variable signal_;
|
||||||
mutable MountingOverrideDelegate *mountingOverrideDelegate_{nullptr};
|
std::weak_ptr<MountingOverrideDelegate const> mountingOverrideDelegate_;
|
||||||
|
|
||||||
#ifdef RN_SHADOW_TREE_INTROSPECTION
|
#ifdef RN_SHADOW_TREE_INTROSPECTION
|
||||||
void validateTransactionAgainstStubViewTree(
|
void validateTransactionAgainstStubViewTree(
|
||||||
|
|
|
@ -222,7 +222,7 @@ ShadowTree::ShadowTree(
|
||||||
LayoutContext const &layoutContext,
|
LayoutContext const &layoutContext,
|
||||||
RootComponentDescriptor const &rootComponentDescriptor,
|
RootComponentDescriptor const &rootComponentDescriptor,
|
||||||
ShadowTreeDelegate const &delegate,
|
ShadowTreeDelegate const &delegate,
|
||||||
MountingOverrideDelegate *mountingOverrideDelegate)
|
std::weak_ptr<MountingOverrideDelegate const> mountingOverrideDelegate)
|
||||||
: surfaceId_(surfaceId), delegate_(delegate) {
|
: surfaceId_(surfaceId), delegate_(delegate) {
|
||||||
const auto noopEventEmitter = std::make_shared<const ViewEventEmitter>(
|
const auto noopEventEmitter = std::make_shared<const ViewEventEmitter>(
|
||||||
nullptr, -1, std::shared_ptr<const EventDispatcher>());
|
nullptr, -1, std::shared_ptr<const EventDispatcher>());
|
||||||
|
|
|
@ -40,7 +40,7 @@ class ShadowTree final {
|
||||||
LayoutContext const &layoutContext,
|
LayoutContext const &layoutContext,
|
||||||
RootComponentDescriptor const &rootComponentDescriptor,
|
RootComponentDescriptor const &rootComponentDescriptor,
|
||||||
ShadowTreeDelegate const &delegate,
|
ShadowTreeDelegate const &delegate,
|
||||||
MountingOverrideDelegate *mountingOverrideDelegate);
|
std::weak_ptr<MountingOverrideDelegate const> mountingOverrideDelegate);
|
||||||
|
|
||||||
~ShadowTree();
|
~ShadowTree();
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ TEST(StateReconciliationTest, testStateReconciliation) {
|
||||||
LayoutContext{},
|
LayoutContext{},
|
||||||
rootComponentDescriptor,
|
rootComponentDescriptor,
|
||||||
shadowTreeDelegate,
|
shadowTreeDelegate,
|
||||||
nullptr};
|
{}};
|
||||||
|
|
||||||
shadowTree.commit(
|
shadowTree.commit(
|
||||||
[&](RootShadowNode::Shared const &oldRootShadowNode) {
|
[&](RootShadowNode::Shared const &oldRootShadowNode) {
|
||||||
|
|
|
@ -127,6 +127,7 @@ Scheduler::~Scheduler() {
|
||||||
|
|
||||||
// The thread-safety of this operation is guaranteed by this requirement.
|
// The thread-safety of this operation is guaranteed by this requirement.
|
||||||
uiManager_->setDelegate(nullptr);
|
uiManager_->setDelegate(nullptr);
|
||||||
|
uiManager_->setAnimationDelegate(nullptr);
|
||||||
|
|
||||||
// Then, let's verify that the requirement was satisfied.
|
// Then, let's verify that the requirement was satisfied.
|
||||||
auto surfaceIds = std::vector<SurfaceId>{};
|
auto surfaceIds = std::vector<SurfaceId>{};
|
||||||
|
@ -173,7 +174,8 @@ void Scheduler::startSurface(
|
||||||
const folly::dynamic &initialProps,
|
const folly::dynamic &initialProps,
|
||||||
const LayoutConstraints &layoutConstraints,
|
const LayoutConstraints &layoutConstraints,
|
||||||
const LayoutContext &layoutContext,
|
const LayoutContext &layoutContext,
|
||||||
MountingOverrideDelegate *mountingOverrideDelegate) const {
|
std::weak_ptr<MountingOverrideDelegate const> mountingOverrideDelegate)
|
||||||
|
const {
|
||||||
SystraceSection s("Scheduler::startSurface");
|
SystraceSection s("Scheduler::startSurface");
|
||||||
|
|
||||||
auto shadowTree = std::make_unique<ShadowTree>(
|
auto shadowTree = std::make_unique<ShadowTree>(
|
||||||
|
|
|
@ -46,7 +46,8 @@ class Scheduler final : public UIManagerDelegate {
|
||||||
const folly::dynamic &initialProps,
|
const folly::dynamic &initialProps,
|
||||||
const LayoutConstraints &layoutConstraints = {},
|
const LayoutConstraints &layoutConstraints = {},
|
||||||
const LayoutContext &layoutContext = {},
|
const LayoutContext &layoutContext = {},
|
||||||
MountingOverrideDelegate *mountingOverrideDelegate = nullptr) const;
|
std::weak_ptr<MountingOverrideDelegate const> mountingOverrideDelegate =
|
||||||
|
{}) const;
|
||||||
|
|
||||||
void renderTemplateToSurface(
|
void renderTemplateToSurface(
|
||||||
SurfaceId surfaceId,
|
SurfaceId surfaceId,
|
||||||
|
|
|
@ -318,8 +318,7 @@ void UIManager::shadowTreeDidFinishTransaction(
|
||||||
|
|
||||||
#pragma mark - UIManagerAnimationDelegate
|
#pragma mark - UIManagerAnimationDelegate
|
||||||
|
|
||||||
void UIManager::setAnimationDelegate(
|
void UIManager::setAnimationDelegate(UIManagerAnimationDelegate *delegate) {
|
||||||
UIManagerAnimationDelegate *delegate) const {
|
|
||||||
animationDelegate_ = delegate;
|
animationDelegate_ = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class UIManager final : public ShadowTreeDelegate {
|
||||||
* The delegate is stored as a raw pointer, so the owner must null
|
* The delegate is stored as a raw pointer, so the owner must null
|
||||||
* the pointer before being destroyed.
|
* the pointer before being destroyed.
|
||||||
*/
|
*/
|
||||||
void setAnimationDelegate(UIManagerAnimationDelegate *delegate) const;
|
void setAnimationDelegate(UIManagerAnimationDelegate *delegate);
|
||||||
|
|
||||||
void animationTick();
|
void animationTick();
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class UIManager final : public ShadowTreeDelegate {
|
||||||
|
|
||||||
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
|
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
|
||||||
UIManagerDelegate *delegate_;
|
UIManagerDelegate *delegate_;
|
||||||
mutable UIManagerAnimationDelegate *animationDelegate_{nullptr};
|
UIManagerAnimationDelegate *animationDelegate_{nullptr};
|
||||||
UIManagerBinding *uiManagerBinding_;
|
UIManagerBinding *uiManagerBinding_;
|
||||||
ShadowTreeRegistry shadowTreeRegistry_{};
|
ShadowTreeRegistry shadowTreeRegistry_{};
|
||||||
};
|
};
|
||||||
|
|
|
@ -401,32 +401,63 @@ JSError::JSError(std::string what, Runtime& rt, Value&& value)
|
||||||
}
|
}
|
||||||
|
|
||||||
void JSError::setValue(Runtime& rt, Value&& value) {
|
void JSError::setValue(Runtime& rt, Value&& value) {
|
||||||
value_ = std::make_shared<jsi::Value>(std::move(value));
|
value_ = std::make_shared<Value>(std::move(value));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ((message_.empty() || stack_.empty()) && value_->isObject()) {
|
if ((message_.empty() || stack_.empty()) && value_->isObject()) {
|
||||||
auto obj = value_->getObject(rt);
|
auto obj = value_->getObject(rt);
|
||||||
|
|
||||||
if (message_.empty()) {
|
if (message_.empty()) {
|
||||||
jsi::Value message = obj.getProperty(rt, "message");
|
try {
|
||||||
if (!message.isUndefined()) {
|
Value message = obj.getProperty(rt, "message");
|
||||||
message_ =
|
if (!message.isUndefined() && !message.isString()) {
|
||||||
callGlobalFunction(rt, "String", message).getString(rt).utf8(rt);
|
message = callGlobalFunction(rt, "String", message);
|
||||||
|
}
|
||||||
|
if (message.isString()) {
|
||||||
|
message_ = message.getString(rt).utf8(rt);
|
||||||
|
} else if (!message.isUndefined()) {
|
||||||
|
message_ = "String(e.message) is a " + kindToString(message, &rt);
|
||||||
|
}
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
message_ = std::string("[Exception while creating message string: ") +
|
||||||
|
ex.what() + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack_.empty()) {
|
if (stack_.empty()) {
|
||||||
jsi::Value stack = obj.getProperty(rt, "stack");
|
try {
|
||||||
if (!stack.isUndefined()) {
|
Value stack = obj.getProperty(rt, "stack");
|
||||||
stack_ =
|
if (!stack.isUndefined() && !stack.isString()) {
|
||||||
callGlobalFunction(rt, "String", stack).getString(rt).utf8(rt);
|
stack = callGlobalFunction(rt, "String", stack);
|
||||||
|
}
|
||||||
|
if (stack.isString()) {
|
||||||
|
stack_ = stack.getString(rt).utf8(rt);
|
||||||
|
} else if (!stack.isUndefined()) {
|
||||||
|
stack_ = "String(e.stack) is a " + kindToString(stack, &rt);
|
||||||
|
}
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
message_ = std::string("[Exception while creating stack string: ") +
|
||||||
|
ex.what() + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message_.empty()) {
|
if (message_.empty()) {
|
||||||
message_ =
|
try {
|
||||||
callGlobalFunction(rt, "String", *value_).getString(rt).utf8(rt);
|
if (value_->isString()) {
|
||||||
|
message_ = value_->getString(rt).utf8(rt);
|
||||||
|
} else {
|
||||||
|
Value message = callGlobalFunction(rt, "String", *value_);
|
||||||
|
if (message.isString()) {
|
||||||
|
message_ = message.getString(rt).utf8(rt);
|
||||||
|
} else {
|
||||||
|
message_ = "String(e) is a " + kindToString(message, &rt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
message_ = std::string("[Exception while creating message string: ") +
|
||||||
|
ex.what() + "]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack_.empty()) {
|
if (stack_.empty()) {
|
||||||
|
@ -436,13 +467,6 @@ void JSError::setValue(Runtime& rt, Value&& value) {
|
||||||
if (what_.empty()) {
|
if (what_.empty()) {
|
||||||
what_ = message_ + "\n\n" + stack_;
|
what_ = message_ + "\n\n" + stack_;
|
||||||
}
|
}
|
||||||
} catch (const std::exception& ex) {
|
|
||||||
message_ = std::string("[Exception while creating message string: ") +
|
|
||||||
ex.what() + "]";
|
|
||||||
stack_ = std::string("Exception while creating stack string: ") +
|
|
||||||
ex.what() + "]";
|
|
||||||
what_ =
|
|
||||||
std::string("Exception while getting value fields: ") + ex.what() + "]";
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
message_ = "[Exception caught creating message string]";
|
message_ = "[Exception caught creating message string]";
|
||||||
stack_ = "[Exception caught creating stack string]";
|
stack_ = "[Exception caught creating stack string]";
|
||||||
|
|
|
@ -981,19 +981,6 @@ TEST_P(JSITest, JSErrorsCanBeConstructedWithStack) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(JSITest, JSErrorDoesNotInfinitelyRecurse) {
|
TEST_P(JSITest, JSErrorDoesNotInfinitelyRecurse) {
|
||||||
Value globalString = rt.global().getProperty(rt, "String");
|
|
||||||
rt.global().setProperty(rt, "String", Value::undefined());
|
|
||||||
try {
|
|
||||||
eval("throw Error('whoops')");
|
|
||||||
FAIL() << "expected exception";
|
|
||||||
} catch (const JSError& ex) {
|
|
||||||
EXPECT_EQ(
|
|
||||||
ex.getMessage(),
|
|
||||||
"[Exception while creating message string: callGlobalFunction: "
|
|
||||||
"JS global property 'String' is undefined, expected a Function]");
|
|
||||||
}
|
|
||||||
rt.global().setProperty(rt, "String", globalString);
|
|
||||||
|
|
||||||
Value globalError = rt.global().getProperty(rt, "Error");
|
Value globalError = rt.global().getProperty(rt, "Error");
|
||||||
rt.global().setProperty(rt, "Error", Value::undefined());
|
rt.global().setProperty(rt, "Error", Value::undefined());
|
||||||
try {
|
try {
|
||||||
|
@ -1272,6 +1259,70 @@ TEST_P(JSITest, SymbolTest) {
|
||||||
EXPECT_FALSE(Value::strictEquals(rt, eval("Symbol('a')"), eval("'a'")));
|
EXPECT_FALSE(Value::strictEquals(rt, eval("Symbol('a')"), eval("'a'")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(JSITest, JSErrorTest) {
|
||||||
|
// JSError creation can lead to further errors. Make sure these
|
||||||
|
// cases are handled and don't cause weird crashes or other issues.
|
||||||
|
//
|
||||||
|
// Getting message property can throw
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval("var GetMessageThrows = {get message() { throw Error('ex'); }};"
|
||||||
|
"throw GetMessageThrows;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval("var GetMessageThrows = {get message() { throw GetMessageThrows; }};"
|
||||||
|
"throw GetMessageThrows;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
// Converting exception message to String can throw
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval(
|
||||||
|
"Object.defineProperty("
|
||||||
|
" globalThis, 'String', {configurable:true, get() { var e = Error(); e.message = 23; throw e; }});"
|
||||||
|
"var e = Error();"
|
||||||
|
"e.message = 17;"
|
||||||
|
"throw e;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval(
|
||||||
|
"var e = Error();"
|
||||||
|
"Object.defineProperty("
|
||||||
|
" e, 'message', {configurable:true, get() { throw Error('getter'); }});"
|
||||||
|
"throw e;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval("var e = Error();"
|
||||||
|
"String = function() { throw Error('ctor'); };"
|
||||||
|
"throw e;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
// Converting an exception message to String can return a non-String
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval("String = function() { return 42; };"
|
||||||
|
"var e = Error();"
|
||||||
|
"e.message = 17;"
|
||||||
|
"throw e;"),
|
||||||
|
JSIException);
|
||||||
|
|
||||||
|
// Exception can be non-Object
|
||||||
|
|
||||||
|
EXPECT_THROW(eval("throw 17;"), JSIException);
|
||||||
|
|
||||||
|
EXPECT_THROW(eval("throw undefined;"), JSIException);
|
||||||
|
|
||||||
|
// Converting exception with no message or stack property to String can throw
|
||||||
|
|
||||||
|
EXPECT_THROW(
|
||||||
|
eval("var e = {toString() { throw new Error('errstr'); }};"
|
||||||
|
"throw e;"),
|
||||||
|
JSIException);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Test that multiple levels of delegation in DecoratedHostObjects works.
|
// Test that multiple levels of delegation in DecoratedHostObjects works.
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule {
|
||||||
id<RCTTurboModule> instance;
|
id<RCTTurboModule> instance;
|
||||||
std::shared_ptr<CallInvoker> jsInvoker;
|
std::shared_ptr<CallInvoker> jsInvoker;
|
||||||
std::shared_ptr<CallInvoker> nativeInvoker;
|
std::shared_ptr<CallInvoker> nativeInvoker;
|
||||||
// Does the NativeModule dispatch async methods to the JS thread?
|
|
||||||
bool isSyncModule;
|
bool isSyncModule;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,16 +60,20 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule {
|
||||||
void setMethodArgConversionSelector(NSString *methodName, int argIndex, NSString *fnName);
|
void setMethodArgConversionSelector(NSString *methodName, int argIndex, NSString *fnName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Does the NativeModule dispatch async methods to the JS thread?
|
||||||
|
const bool isSyncModule_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO(ramanpreet):
|
* TODO(ramanpreet):
|
||||||
* Investigate an optimization that'll let us get rid of this NSMutableDictionary.
|
* Investigate an optimization that'll let us get rid of this NSMutableDictionary.
|
||||||
*/
|
*/
|
||||||
NSMutableDictionary<NSString *, NSMutableArray *> *methodArgConversionSelectors_;
|
NSMutableDictionary<NSString *, NSMutableArray *> *methodArgConversionSelectors_;
|
||||||
NSDictionary<NSString *, NSArray<NSString *> *> *methodArgumentTypeNames_;
|
NSDictionary<NSString *, NSArray<NSString *> *> *methodArgumentTypeNames_;
|
||||||
const bool isSyncModule_;
|
|
||||||
bool isMethodSync(TurboModuleMethodValueKind returnType);
|
|
||||||
NSString *getArgumentTypeName(NSString *methodName, int argIndex);
|
|
||||||
|
|
||||||
|
bool isMethodSync(TurboModuleMethodValueKind returnType);
|
||||||
|
BOOL hasMethodArgConversionSelector(NSString *methodName, int argIndex);
|
||||||
|
SEL getMethodArgConversionSelector(NSString *methodName, int argIndex);
|
||||||
|
NSString *getArgumentTypeName(NSString *methodName, int argIndex);
|
||||||
NSInvocation *getMethodInvocation(
|
NSInvocation *getMethodInvocation(
|
||||||
jsi::Runtime &runtime,
|
jsi::Runtime &runtime,
|
||||||
TurboModuleMethodValueKind returnType,
|
TurboModuleMethodValueKind returnType,
|
||||||
|
@ -86,9 +89,6 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule {
|
||||||
NSInvocation *inv,
|
NSInvocation *inv,
|
||||||
NSMutableArray *retainedObjectsForInvocation);
|
NSMutableArray *retainedObjectsForInvocation);
|
||||||
|
|
||||||
BOOL hasMethodArgConversionSelector(NSString *methodName, int argIndex);
|
|
||||||
SEL getMethodArgConversionSelector(NSString *methodName, int argIndex);
|
|
||||||
|
|
||||||
using PromiseInvocationBlock = void (^)(RCTPromiseResolveBlock resolveWrapper, RCTPromiseRejectBlock rejectWrapper);
|
using PromiseInvocationBlock = void (^)(RCTPromiseResolveBlock resolveWrapper, RCTPromiseRejectBlock rejectWrapper);
|
||||||
jsi::Value
|
jsi::Value
|
||||||
createPromise(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> jsInvoker, PromiseInvocationBlock invoke);
|
createPromise(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> jsInvoker, PromiseInvocationBlock invoke);
|
||||||
|
|
|
@ -361,7 +361,7 @@ jsi::Value ObjCTurboModule::performMethodInvocation(
|
||||||
};
|
};
|
||||||
|
|
||||||
if (wasMethodSync) {
|
if (wasMethodSync) {
|
||||||
nativeInvoker_->invokeSync([block]() -> void { block(); });
|
block();
|
||||||
} else {
|
} else {
|
||||||
asyncCallCounter = getUniqueId();
|
asyncCallCounter = getUniqueId();
|
||||||
TurboModulePerfLogger::asyncMethodCallDispatch(moduleName, methodName);
|
TurboModulePerfLogger::asyncMethodCallDispatch(moduleName, methodName);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#import "RCTTurboModule.h"
|
#import "RCTTurboModule.h"
|
||||||
|
|
||||||
|
#import <ReactCommon/RuntimeExecutor.h>
|
||||||
|
|
||||||
@protocol RCTTurboModuleManagerDelegate <NSObject>
|
@protocol RCTTurboModuleManagerDelegate <NSObject>
|
||||||
|
|
||||||
// TODO: Move to xplat codegen.
|
// TODO: Move to xplat codegen.
|
||||||
|
@ -45,7 +47,7 @@
|
||||||
delegate:(id<RCTTurboModuleManagerDelegate>)delegate
|
delegate:(id<RCTTurboModuleManagerDelegate>)delegate
|
||||||
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker;
|
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker;
|
||||||
|
|
||||||
- (void)installJSBindingWithRuntime:(facebook::jsi::Runtime *)runtime;
|
- (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor;
|
||||||
|
|
||||||
- (void)invalidate;
|
- (void)invalidate;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#import <React/RCTModuleData.h>
|
#import <React/RCTModuleData.h>
|
||||||
#import <React/RCTPerformanceLogger.h>
|
#import <React/RCTPerformanceLogger.h>
|
||||||
#import <React/RCTUtils.h>
|
#import <React/RCTUtils.h>
|
||||||
|
#import <ReactCommon/RuntimeExecutor.h>
|
||||||
#import <ReactCommon/TurboCxxModule.h>
|
#import <ReactCommon/TurboCxxModule.h>
|
||||||
#import <ReactCommon/TurboModuleBinding.h>
|
#import <ReactCommon/TurboModuleBinding.h>
|
||||||
#import <ReactCommon/TurboModulePerfLogger.h>
|
#import <ReactCommon/TurboModulePerfLogger.h>
|
||||||
|
@ -147,7 +148,6 @@ static Class getFallbackClassFromName(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation RCTTurboModuleManager {
|
@implementation RCTTurboModuleManager {
|
||||||
jsi::Runtime *_runtime;
|
|
||||||
std::shared_ptr<CallInvoker> _jsInvoker;
|
std::shared_ptr<CallInvoker> _jsInvoker;
|
||||||
__weak id<RCTTurboModuleManagerDelegate> _delegate;
|
__weak id<RCTTurboModuleManagerDelegate> _delegate;
|
||||||
__weak RCTBridge *_bridge;
|
__weak RCTBridge *_bridge;
|
||||||
|
@ -640,18 +640,15 @@ static Class getFallbackClassFromName(const char *name)
|
||||||
return requiresMainQueueSetup;
|
return requiresMainQueueSetup;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)installJSBindingWithRuntime:(jsi::Runtime *)runtime
|
- (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor
|
||||||
{
|
{
|
||||||
_runtime = runtime;
|
if (!runtimeExecutor) {
|
||||||
|
|
||||||
if (!_runtime) {
|
|
||||||
// jsi::Runtime doesn't exist when attached to Chrome debugger.
|
// jsi::Runtime doesn't exist when attached to Chrome debugger.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak __typeof(self) weakSelf = self;
|
__weak __typeof(self) weakSelf = self;
|
||||||
|
auto turboModuleProvider = [weakSelf](const std::string &name) -> std::shared_ptr<react::TurboModule> {
|
||||||
TurboModuleBinding::install(*_runtime, [weakSelf](const std::string &name) -> std::shared_ptr<TurboModule> {
|
|
||||||
if (!weakSelf) {
|
if (!weakSelf) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -686,6 +683,10 @@ static Class getFallbackClassFromName(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return turboModule;
|
return turboModule;
|
||||||
|
};
|
||||||
|
|
||||||
|
runtimeExecutor([turboModuleProvider = std::move(turboModuleProvider)](jsi::Runtime &runtime) {
|
||||||
|
react::TurboModuleBinding::install(runtime, std::move(turboModuleProvider));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#import "RCTSampleTurboModule.h"
|
#import "RCTSampleTurboModule.h"
|
||||||
|
|
||||||
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
||||||
|
#import <React/RCTUtils.h>
|
||||||
|
|
||||||
using namespace facebook::react;
|
using namespace facebook::react;
|
||||||
|
|
||||||
|
@ -45,6 +46,8 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
- (NSDictionary *)getConstants
|
- (NSDictionary *)getConstants
|
||||||
{
|
{
|
||||||
|
__block NSDictionary *constants;
|
||||||
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||||
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
||||||
UIScreen *mainScreen = UIScreen.mainScreen;
|
UIScreen *mainScreen = UIScreen.mainScreen;
|
||||||
CGSize screenSize = mainScreen.bounds.size;
|
CGSize screenSize = mainScreen.bounds.size;
|
||||||
|
@ -53,11 +56,14 @@ RCT_EXPORT_MODULE()
|
||||||
CGSize screenSize = mainScreen.frame.size;
|
CGSize screenSize = mainScreen.frame.size;
|
||||||
#endif // ]TODO(macOS GH#774)
|
#endif // ]TODO(macOS GH#774)
|
||||||
|
|
||||||
return @{
|
constants = @{
|
||||||
@"const1" : @YES,
|
@"const1" : @YES,
|
||||||
@"const2" : @(screenSize.width),
|
@"const2" : @(screenSize.width),
|
||||||
@"const3" : @"something",
|
@"const3" : @"something",
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove once fully migrated to TurboModule.
|
// TODO: Remove once fully migrated to TurboModule.
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
"eslint-plugin-react-hooks": "^3.0.0",
|
"eslint-plugin-react-hooks": "^3.0.0",
|
||||||
"eslint-plugin-react-native": "3.8.1",
|
"eslint-plugin-react-native": "3.8.1",
|
||||||
"eslint-plugin-relay": "1.7.1",
|
"eslint-plugin-relay": "1.7.1",
|
||||||
"flow-bin": "^0.125.1",
|
"flow-bin": "^0.126.1",
|
||||||
"flow-remove-types": "1.2.3",
|
"flow-remove-types": "1.2.3",
|
||||||
"hermes-engine-darwin": "~0.5.0",
|
"hermes-engine-darwin": "~0.5.0",
|
||||||
"jest": "^26.0.1",
|
"jest": "^26.0.1",
|
||||||
|
|
|
@ -69,4 +69,4 @@ untyped-import
|
||||||
untyped-type-import
|
untyped-type-import
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.125.0
|
^0.126.1
|
||||||
|
|
210
yarn.lock
210
yarn.lock
|
@ -1950,6 +1950,14 @@ cache-base@^1.0.1:
|
||||||
union-value "^1.0.0"
|
union-value "^1.0.0"
|
||||||
unset-value "^1.0.0"
|
unset-value "^1.0.0"
|
||||||
|
|
||||||
|
call-bind@^1.0.0, call-bind@^1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
|
||||||
|
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
|
||||||
|
dependencies:
|
||||||
|
function-bind "^1.1.1"
|
||||||
|
get-intrinsic "^1.0.2"
|
||||||
|
|
||||||
caller-callsite@^2.0.0:
|
caller-callsite@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
|
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
|
||||||
|
@ -2514,7 +2522,7 @@ defaults@^1.0.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
clone "^1.0.2"
|
clone "^1.0.2"
|
||||||
|
|
||||||
define-properties@^1.1.2:
|
define-properties@^1.1.2, define-properties@^1.1.3:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||||
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
|
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
|
||||||
|
@ -2694,6 +2702,29 @@ errorhandler@^1.5.0:
|
||||||
accepts "~1.3.7"
|
accepts "~1.3.7"
|
||||||
escape-html "~1.0.3"
|
escape-html "~1.0.3"
|
||||||
|
|
||||||
|
es-abstract@^1.10.0:
|
||||||
|
version "1.18.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19"
|
||||||
|
integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
es-to-primitive "^1.2.1"
|
||||||
|
function-bind "^1.1.1"
|
||||||
|
get-intrinsic "^1.1.1"
|
||||||
|
has "^1.0.3"
|
||||||
|
has-symbols "^1.0.2"
|
||||||
|
internal-slot "^1.0.3"
|
||||||
|
is-callable "^1.2.3"
|
||||||
|
is-negative-zero "^2.0.1"
|
||||||
|
is-regex "^1.1.3"
|
||||||
|
is-string "^1.0.6"
|
||||||
|
object-inspect "^1.11.0"
|
||||||
|
object-keys "^1.1.1"
|
||||||
|
object.assign "^4.1.2"
|
||||||
|
string.prototype.trimend "^1.0.4"
|
||||||
|
string.prototype.trimstart "^1.0.4"
|
||||||
|
unbox-primitive "^1.0.1"
|
||||||
|
|
||||||
es-abstract@^1.11.0:
|
es-abstract@^1.11.0:
|
||||||
version "1.13.0"
|
version "1.13.0"
|
||||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
|
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
|
||||||
|
@ -2726,6 +2757,15 @@ es-to-primitive@^1.1.1, es-to-primitive@^1.2.0:
|
||||||
is-date-object "^1.0.1"
|
is-date-object "^1.0.1"
|
||||||
is-symbol "^1.0.2"
|
is-symbol "^1.0.2"
|
||||||
|
|
||||||
|
es-to-primitive@^1.2.1:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
|
||||||
|
integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==
|
||||||
|
dependencies:
|
||||||
|
is-callable "^1.1.4"
|
||||||
|
is-date-object "^1.0.1"
|
||||||
|
is-symbol "^1.0.2"
|
||||||
|
|
||||||
escape-html@~1.0.3:
|
escape-html@~1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
|
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
|
||||||
|
@ -3279,10 +3319,10 @@ flat-cache@^1.2.1:
|
||||||
rimraf "~2.6.2"
|
rimraf "~2.6.2"
|
||||||
write "^0.2.1"
|
write "^0.2.1"
|
||||||
|
|
||||||
flow-bin@^0.125.1:
|
flow-bin@^0.126.1:
|
||||||
version "0.125.1"
|
version "0.126.1"
|
||||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.125.1.tgz#7edbc71e7dc39ddef18086ef75c714bbf1c5917f"
|
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.126.1.tgz#2726595e1891dc35b379b5994627432df4ead52c"
|
||||||
integrity sha512-jEury9NTXylxQEOAXLWEE945BjBwYcMwwKVnb+5XORNwMQE7i5hQYF0ysYfsaaYOa7rW/U16rHBfwLuaZfWV7A==
|
integrity sha512-RI05x7rVzruRVJQN3M4vLEjZMwUHJKhGz9FmL8HN7WiSo66/131EyJS6Vo8PkKyM2pgT9GRWfGP/tXlqS54XUg==
|
||||||
|
|
||||||
flow-parser@0.*:
|
flow-parser@0.*:
|
||||||
version "0.89.0"
|
version "0.89.0"
|
||||||
|
@ -3419,6 +3459,15 @@ get-caller-file@^2.0.1:
|
||||||
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
|
||||||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
|
||||||
|
|
||||||
|
get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
|
||||||
|
integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
|
||||||
|
dependencies:
|
||||||
|
function-bind "^1.1.1"
|
||||||
|
has "^1.0.3"
|
||||||
|
has-symbols "^1.0.1"
|
||||||
|
|
||||||
get-port@^2.1.0:
|
get-port@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/get-port/-/get-port-2.1.0.tgz#8783f9dcebd1eea495a334e1a6a251e78887ab1a"
|
resolved "https://registry.yarnpkg.com/get-port/-/get-port-2.1.0.tgz#8783f9dcebd1eea495a334e1a6a251e78887ab1a"
|
||||||
|
@ -3560,6 +3609,11 @@ has-ansi@^2.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
ansi-regex "^2.0.0"
|
ansi-regex "^2.0.0"
|
||||||
|
|
||||||
|
has-bigints@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113"
|
||||||
|
integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==
|
||||||
|
|
||||||
has-flag@^3.0.0:
|
has-flag@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
||||||
|
@ -3575,6 +3629,18 @@ has-symbols@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
|
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
|
||||||
integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=
|
integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=
|
||||||
|
|
||||||
|
has-symbols@^1.0.1, has-symbols@^1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
|
||||||
|
integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
|
||||||
|
|
||||||
|
has-tostringtag@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25"
|
||||||
|
integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==
|
||||||
|
dependencies:
|
||||||
|
has-symbols "^1.0.2"
|
||||||
|
|
||||||
has-unicode@^2.0.0:
|
has-unicode@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
|
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
|
||||||
|
@ -3776,6 +3842,15 @@ inquirer@^5.2.0:
|
||||||
strip-ansi "^4.0.0"
|
strip-ansi "^4.0.0"
|
||||||
through "^2.3.6"
|
through "^2.3.6"
|
||||||
|
|
||||||
|
internal-slot@^1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c"
|
||||||
|
integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==
|
||||||
|
dependencies:
|
||||||
|
get-intrinsic "^1.1.0"
|
||||||
|
has "^1.0.3"
|
||||||
|
side-channel "^1.0.4"
|
||||||
|
|
||||||
interpret@^1.0.0:
|
interpret@^1.0.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614"
|
||||||
|
@ -3817,6 +3892,21 @@ is-arrayish@^0.2.1:
|
||||||
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
|
||||||
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
|
||||||
|
|
||||||
|
is-bigint@^1.0.1:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3"
|
||||||
|
integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==
|
||||||
|
dependencies:
|
||||||
|
has-bigints "^1.0.1"
|
||||||
|
|
||||||
|
is-boolean-object@^1.1.0:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719"
|
||||||
|
integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
has-tostringtag "^1.0.0"
|
||||||
|
|
||||||
is-buffer@^1.1.5:
|
is-buffer@^1.1.5:
|
||||||
version "1.1.6"
|
version "1.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||||
|
@ -3827,6 +3917,11 @@ is-callable@^1.1.3, is-callable@^1.1.4:
|
||||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
||||||
integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
|
integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==
|
||||||
|
|
||||||
|
is-callable@^1.2.3:
|
||||||
|
version "1.2.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945"
|
||||||
|
integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==
|
||||||
|
|
||||||
is-ci@^2.0.0:
|
is-ci@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
|
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
|
||||||
|
@ -3910,6 +4005,18 @@ is-generator-fn@^2.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e"
|
resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e"
|
||||||
integrity sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g==
|
integrity sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g==
|
||||||
|
|
||||||
|
is-negative-zero@^2.0.1:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
|
||||||
|
integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==
|
||||||
|
|
||||||
|
is-number-object@^1.0.4:
|
||||||
|
version "1.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0"
|
||||||
|
integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==
|
||||||
|
dependencies:
|
||||||
|
has-tostringtag "^1.0.0"
|
||||||
|
|
||||||
is-number@^3.0.0:
|
is-number@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
|
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
|
||||||
|
@ -3946,6 +4053,14 @@ is-regex@^1.0.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
has "^1.0.1"
|
has "^1.0.1"
|
||||||
|
|
||||||
|
is-regex@^1.1.3:
|
||||||
|
version "1.1.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
|
||||||
|
integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
has-tostringtag "^1.0.0"
|
||||||
|
|
||||||
is-resolvable@^1.1.0:
|
is-resolvable@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
|
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
|
||||||
|
@ -3961,6 +4076,13 @@ is-stream@^2.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
|
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
|
||||||
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
|
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
|
||||||
|
|
||||||
|
is-string@^1.0.5, is-string@^1.0.6:
|
||||||
|
version "1.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd"
|
||||||
|
integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==
|
||||||
|
dependencies:
|
||||||
|
has-tostringtag "^1.0.0"
|
||||||
|
|
||||||
is-symbol@^1.0.2:
|
is-symbol@^1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
|
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
|
||||||
|
@ -3968,6 +4090,13 @@ is-symbol@^1.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
has-symbols "^1.0.0"
|
has-symbols "^1.0.0"
|
||||||
|
|
||||||
|
is-symbol@^1.0.3:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c"
|
||||||
|
integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==
|
||||||
|
dependencies:
|
||||||
|
has-symbols "^1.0.2"
|
||||||
|
|
||||||
is-typedarray@^1.0.0, is-typedarray@~1.0.0:
|
is-typedarray@^1.0.0, is-typedarray@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||||
|
@ -5671,7 +5800,12 @@ object-copy@^0.1.0:
|
||||||
define-property "^0.2.5"
|
define-property "^0.2.5"
|
||||||
kind-of "^3.0.3"
|
kind-of "^3.0.3"
|
||||||
|
|
||||||
object-keys@^1.0.11:
|
object-inspect@^1.11.0, object-inspect@^1.9.0:
|
||||||
|
version "1.11.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
|
||||||
|
integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==
|
||||||
|
|
||||||
|
object-keys@^1.0.11, object-keys@^1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
|
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
|
||||||
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
||||||
|
@ -5698,6 +5832,16 @@ object.assign@^4.1.0:
|
||||||
has-symbols "^1.0.0"
|
has-symbols "^1.0.0"
|
||||||
object-keys "^1.0.11"
|
object-keys "^1.0.11"
|
||||||
|
|
||||||
|
object.assign@^4.1.2:
|
||||||
|
version "4.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
|
||||||
|
integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.0"
|
||||||
|
define-properties "^1.1.3"
|
||||||
|
has-symbols "^1.0.1"
|
||||||
|
object-keys "^1.1.1"
|
||||||
|
|
||||||
object.fromentries@^2.0.0:
|
object.fromentries@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
|
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
|
||||||
|
@ -6348,6 +6492,14 @@ regex-not@^1.0.0, regex-not@^1.0.2:
|
||||||
extend-shallow "^3.0.2"
|
extend-shallow "^3.0.2"
|
||||||
safe-regex "^1.1.0"
|
safe-regex "^1.1.0"
|
||||||
|
|
||||||
|
regexp.prototype.flags@^1.2.0:
|
||||||
|
version "1.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26"
|
||||||
|
integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
define-properties "^1.1.3"
|
||||||
|
|
||||||
regexpp@^1.1.0:
|
regexpp@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab"
|
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab"
|
||||||
|
@ -6809,6 +6961,15 @@ shellwords@^0.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
|
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
|
||||||
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
|
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
|
||||||
|
|
||||||
|
side-channel@^1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
|
||||||
|
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.0"
|
||||||
|
get-intrinsic "^1.0.2"
|
||||||
|
object-inspect "^1.9.0"
|
||||||
|
|
||||||
signal-exit@^3.0.0, signal-exit@^3.0.2:
|
signal-exit@^3.0.0, signal-exit@^3.0.2:
|
||||||
version "3.0.2"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
|
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
|
||||||
|
@ -7098,6 +7259,22 @@ string.prototype.matchall@^2.0.0:
|
||||||
has-symbols "^1.0.0"
|
has-symbols "^1.0.0"
|
||||||
regexp.prototype.flags "^1.2.0"
|
regexp.prototype.flags "^1.2.0"
|
||||||
|
|
||||||
|
string.prototype.trimend@^1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80"
|
||||||
|
integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
define-properties "^1.1.3"
|
||||||
|
|
||||||
|
string.prototype.trimstart@^1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed"
|
||||||
|
integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==
|
||||||
|
dependencies:
|
||||||
|
call-bind "^1.0.2"
|
||||||
|
define-properties "^1.1.3"
|
||||||
|
|
||||||
string_decoder@~1.1.1:
|
string_decoder@~1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||||
|
@ -7487,6 +7664,16 @@ ultron@~1.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c"
|
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c"
|
||||||
integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==
|
integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==
|
||||||
|
|
||||||
|
unbox-primitive@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
|
||||||
|
integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==
|
||||||
|
dependencies:
|
||||||
|
function-bind "^1.1.1"
|
||||||
|
has-bigints "^1.0.1"
|
||||||
|
has-symbols "^1.0.2"
|
||||||
|
which-boxed-primitive "^1.0.2"
|
||||||
|
|
||||||
unicode-canonical-property-names-ecmascript@^1.0.4:
|
unicode-canonical-property-names-ecmascript@^1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"
|
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"
|
||||||
|
@ -7695,6 +7882,17 @@ whatwg-url@^8.0.0:
|
||||||
tr46 "^2.0.0"
|
tr46 "^2.0.0"
|
||||||
webidl-conversions "^5.0.0"
|
webidl-conversions "^5.0.0"
|
||||||
|
|
||||||
|
which-boxed-primitive@^1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
|
||||||
|
integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==
|
||||||
|
dependencies:
|
||||||
|
is-bigint "^1.0.1"
|
||||||
|
is-boolean-object "^1.1.0"
|
||||||
|
is-number-object "^1.0.4"
|
||||||
|
is-string "^1.0.5"
|
||||||
|
is-symbol "^1.0.3"
|
||||||
|
|
||||||
which-module@^2.0.0:
|
which-module@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
|
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче