Fix typos (#25770)
Summary: Fix typos mostly in comments and some string literals. ## Changelog [General] [Fixed] - Fix typos Pull Request resolved: https://github.com/facebook/react-native/pull/25770 Differential Revision: D16437857 Pulled By: cpojer fbshipit-source-id: ffeb4d6b175e341381352091134f7c97d78c679f
This commit is contained in:
Родитель
d544fa20b7
Коммит
84f5ebe4f9
|
@ -31,7 +31,7 @@ let queueConnections = false;
|
||||||
let queue = [];
|
let queue = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple wrappers around NativeAnimatedModule to provide flow and autocmplete support for
|
* Simple wrappers around NativeAnimatedModule to provide flow and autocomplete support for
|
||||||
* the native module methods
|
* the native module methods
|
||||||
*/
|
*/
|
||||||
const API = {
|
const API = {
|
||||||
|
|
|
@ -115,7 +115,7 @@ describe('bezier', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('symetric curves', function() {
|
describe('symmetric curves', function() {
|
||||||
it('should have a central value y~=0.5 at x=0.5', function() {
|
it('should have a central value y~=0.5 at x=0.5', function() {
|
||||||
repeat(10)(function() {
|
repeat(10)(function() {
|
||||||
const a = Math.random(),
|
const a = Math.random(),
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dummy module that only exists for the sake of proving that the message queue
|
* Dummy module that only exists for the sake of proving that the message queue
|
||||||
* correctly dispatches to commonJS modules. The `testHook` is overriden by test
|
* correctly dispatches to commonJS modules. The `testHook` is overridden by test
|
||||||
* cases.
|
* cases.
|
||||||
*/
|
*/
|
||||||
const MessageQueueTestModule = {
|
const MessageQueueTestModule = {
|
||||||
|
|
|
@ -125,7 +125,7 @@ describe('MessageQueue', function() {
|
||||||
expect(factory).toHaveBeenCalledTimes(1);
|
expect(factory).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check if the global error handler is not overriden by the DebuggerInternal object', () => {
|
it('should check if the global error handler is not overridden by the DebuggerInternal object', () => {
|
||||||
const dummyModule = {
|
const dummyModule = {
|
||||||
dummy: function() {},
|
dummy: function() {},
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,7 @@ describe('MessageQueue', function() {
|
||||||
expect(queue.__shouldPauseOnThrow).toHaveBeenCalledTimes(2);
|
expect(queue.__shouldPauseOnThrow).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check if the global error handler is overriden by the DebuggerInternal object', () => {
|
it('should check if the global error handler is overridden by the DebuggerInternal object', () => {
|
||||||
const dummyModule = {
|
const dummyModule = {
|
||||||
dummy: function() {},
|
dummy: function() {},
|
||||||
};
|
};
|
||||||
|
|
|
@ -532,7 +532,7 @@ export type Props = $ReadOnly<{|
|
||||||
*/
|
*/
|
||||||
snapToOffsets?: ?$ReadOnlyArray<number>,
|
snapToOffsets?: ?$ReadOnlyArray<number>,
|
||||||
/**
|
/**
|
||||||
* Use in conjuction with `snapToOffsets`. By default, the beginning
|
* Use in conjunction with `snapToOffsets`. By default, the beginning
|
||||||
* of the list counts as a snap offset. Set `snapToStart` to false to disable
|
* of the list counts as a snap offset. Set `snapToStart` to false to disable
|
||||||
* this behavior and allow the list to scroll freely between its start and
|
* this behavior and allow the list to scroll freely between its start and
|
||||||
* the first `snapToOffsets` offset.
|
* the first `snapToOffsets` offset.
|
||||||
|
@ -540,7 +540,7 @@ export type Props = $ReadOnly<{|
|
||||||
*/
|
*/
|
||||||
snapToStart?: ?boolean,
|
snapToStart?: ?boolean,
|
||||||
/**
|
/**
|
||||||
* Use in conjuction with `snapToOffsets`. By default, the end
|
* Use in conjunction with `snapToOffsets`. By default, the end
|
||||||
* of the list counts as a snap offset. Set `snapToEnd` to false to disable
|
* of the list counts as a snap offset. Set `snapToEnd` to false to disable
|
||||||
* this behavior and allow the list to scroll freely between its end and
|
* this behavior and allow the list to scroll freely between its end and
|
||||||
* the last `snapToOffsets` offset.
|
* the last `snapToOffsets` offset.
|
||||||
|
@ -561,7 +561,7 @@ export type Props = $ReadOnly<{|
|
||||||
*
|
*
|
||||||
* See [RefreshControl](docs/refreshcontrol.html).
|
* See [RefreshControl](docs/refreshcontrol.html).
|
||||||
*/
|
*/
|
||||||
// $FlowFixMe - how to handle generic type without existential opereator?
|
// $FlowFixMe - how to handle generic type without existential operator?
|
||||||
refreshControl?: ?React.Element<any>,
|
refreshControl?: ?React.Element<any>,
|
||||||
children?: React.Node,
|
children?: React.Node,
|
||||||
|}>;
|
|}>;
|
||||||
|
|
|
@ -377,7 +377,7 @@ class StatusBar extends React.Component<Props> {
|
||||||
// Every time a StatusBar component is mounted, we push it's prop to a stack
|
// Every time a StatusBar component is mounted, we push it's prop to a stack
|
||||||
// and always update the native status bar with the props from the top of then
|
// and always update the native status bar with the props from the top of then
|
||||||
// stack. This allows having multiple StatusBar components and the one that is
|
// stack. This allows having multiple StatusBar components and the one that is
|
||||||
// added last or is deeper in the view hierachy will have priority.
|
// added last or is deeper in the view hierarchy will have priority.
|
||||||
this._stackEntry = StatusBar.pushStackEntry(this.props);
|
this._stackEntry = StatusBar.pushStackEntry(this.props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ type Props = $ReadOnly<{|
|
||||||
* On press down, the opacity of the wrapped view is decreased, dimming it.
|
* On press down, the opacity of the wrapped view is decreased, dimming it.
|
||||||
*
|
*
|
||||||
* Opacity is controlled by wrapping the children in an Animated.View, which is
|
* Opacity is controlled by wrapping the children in an Animated.View, which is
|
||||||
* added to the view hiearchy. Be aware that this can affect layout.
|
* added to the view hierarchy. Be aware that this can affect layout.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,6 +20,6 @@ type NativeProps = $ReadOnly<{|
|
||||||
name?: WithDefault<string, ''>,
|
name?: WithDefault<string, ''>,
|
||||||
|}>;
|
|}>;
|
||||||
|
|
||||||
// NOTE: This compoenent is not implemented in paper
|
// NOTE: This component is not implemented in paper
|
||||||
// Do not require this file in paper builds
|
// Do not require this file in paper builds
|
||||||
export default codegenNativeComponent<NativeProps>('UnimplementedNativeView');
|
export default codegenNativeComponent<NativeProps>('UnimplementedNativeView');
|
||||||
|
|
|
@ -151,7 +151,7 @@ type State = {
|
||||||
};
|
};
|
||||||
class WindowedListView extends React.Component<Props, State> {
|
class WindowedListView extends React.Component<Props, State> {
|
||||||
/**
|
/**
|
||||||
* Recomputing which rows to render is batched up and run asynchronously to avoid wastful updates,
|
* Recomputing which rows to render is batched up and run asynchronously to avoid wasteful updates,
|
||||||
* e.g. from multiple layout updates in rapid succession.
|
* e.g. from multiple layout updates in rapid succession.
|
||||||
*/
|
*/
|
||||||
_computeRowsToRenderBatcher: Batchinator;
|
_computeRowsToRenderBatcher: Batchinator;
|
||||||
|
@ -390,7 +390,7 @@ class WindowedListView extends React.Component<Props, State> {
|
||||||
}
|
}
|
||||||
this._updateVisibleRows(firstVisible, lastVisible);
|
this._updateVisibleRows(firstVisible, lastVisible);
|
||||||
|
|
||||||
// Unfortuantely, we can't use <Incremental> to simplify our increment logic in this function
|
// Unfortunately, we can't use <Incremental> to simplify our increment logic in this function
|
||||||
// because we need to make sure that cells are rendered in the right order one at a time when
|
// because we need to make sure that cells are rendered in the right order one at a time when
|
||||||
// scrolling back up.
|
// scrolling back up.
|
||||||
|
|
||||||
|
@ -646,7 +646,7 @@ type CellProps = {
|
||||||
* after offscreen rendering has completed, includeInLayout will be set true and the finished cell
|
* after offscreen rendering has completed, includeInLayout will be set true and the finished cell
|
||||||
* can be dropped into place.
|
* can be dropped into place.
|
||||||
*
|
*
|
||||||
* This is coordinated outside this component so the parent can syncronize this re-render with
|
* This is coordinated outside this component so the parent can synchronize this re-render with
|
||||||
* managing the placeholder sizing.
|
* managing the placeholder sizing.
|
||||||
*/
|
*/
|
||||||
includeInLayout: boolean,
|
includeInLayout: boolean,
|
||||||
|
@ -656,7 +656,7 @@ type CellProps = {
|
||||||
*/
|
*/
|
||||||
onNewLayout: (params: {rowKey: string, layout: Object}) => void,
|
onNewLayout: (params: {rowKey: string, layout: Object}) => void,
|
||||||
/**
|
/**
|
||||||
* Used to track when rendering is in progress so the parent can avoid wastedful re-renders that
|
* Used to track when rendering is in progress so the parent can avoid wasteful re-renders that
|
||||||
* are just going to be invalidated once the cell finishes.
|
* are just going to be invalidated once the cell finishes.
|
||||||
*/
|
*/
|
||||||
onProgressChange: (progress: {rowKey: string, inProgress: boolean}) => void,
|
onProgressChange: (progress: {rowKey: string, inProgress: boolean}) => void,
|
||||||
|
|
|
@ -136,7 +136,7 @@ RCT_EXPORT_MODULE()
|
||||||
- (void)setImageCache:(id<RCTImageCache>)cache
|
- (void)setImageCache:(id<RCTImageCache>)cache
|
||||||
{
|
{
|
||||||
if (_imageCache) {
|
if (_imageCache) {
|
||||||
RCTLogWarn(@"RCTImageCache was already set and has now been overriden.");
|
RCTLogWarn(@"RCTImageCache was already set and has now been overridden.");
|
||||||
}
|
}
|
||||||
_imageCache = cache;
|
_imageCache = cache;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ jest
|
||||||
|
|
||||||
const isWindows = process.platform === 'win32';
|
const isWindows = process.platform === 'win32';
|
||||||
function expectToBeCalledOnce(fn) {
|
function expectToBeCalledOnce(fn) {
|
||||||
// todo fix this test case on widnows
|
// todo fix this test case on windows
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1180,7 +1180,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||||
if (!this._scrollRef) {
|
if (!this._scrollRef) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// We are asuming that getOutermostParentListRef().getScrollRef()
|
// We are assuming that getOutermostParentListRef().getScrollRef()
|
||||||
// is a non-null reference to a ScrollView
|
// is a non-null reference to a ScrollView
|
||||||
this._scrollRef.measureLayout(
|
this._scrollRef.measureLayout(
|
||||||
this.context.virtualizedList
|
this.context.virtualizedList
|
||||||
|
|
|
@ -34,7 +34,7 @@ describe('newRangeCount', function() {
|
||||||
it('handles front extension', function() {
|
it('handles front extension', function() {
|
||||||
expect(newRangeCount({first: 1, last: 4}, {first: 0, last: 4})).toBe(1);
|
expect(newRangeCount({first: 1, last: 4}, {first: 0, last: 4})).toBe(1);
|
||||||
});
|
});
|
||||||
it('handles forward insersect', function() {
|
it('handles forward intersect', function() {
|
||||||
expect(newRangeCount({first: 1, last: 4}, {first: 3, last: 6})).toBe(2);
|
expect(newRangeCount({first: 1, last: 4}, {first: 3, last: 6})).toBe(2);
|
||||||
});
|
});
|
||||||
it('handles reverse intersect', function() {
|
it('handles reverse intersect', function() {
|
||||||
|
|
|
@ -169,7 +169,7 @@ class Modal extends React.Component<Props> {
|
||||||
|
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
// Reset the context so VirtualizedList doesn't get confused by nesting
|
// Reset the context so VirtualizedList doesn't get confused by nesting
|
||||||
// in the React tree that doesn't reflect the native component heirarchy.
|
// in the React tree that doesn't reflect the native component hierarchy.
|
||||||
return {
|
return {
|
||||||
virtualizedList: null,
|
virtualizedList: null,
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
- (void)setNeedsUpdate NS_REQUIRES_SUPER;
|
- (void)setNeedsUpdate NS_REQUIRES_SUPER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The node will update its value if necesarry and only after its parents have updated.
|
* The node will update its value if necessary and only after its parents have updated.
|
||||||
*/
|
*/
|
||||||
- (void)updateNodeIfNecessary NS_REQUIRES_SUPER;
|
- (void)updateNodeIfNecessary NS_REQUIRES_SUPER;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||||
- (void)performUpdate
|
- (void)performUpdate
|
||||||
{
|
{
|
||||||
_needsUpdate = NO;
|
_needsUpdate = NO;
|
||||||
// To be overidden by subclasses
|
// To be overridden by subclasses
|
||||||
// This method is called on a node only if it has been marked for update
|
// This method is called on a node only if it has been marked for update
|
||||||
// during the current update loop
|
// during the current update loop
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ typedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager);
|
||||||
{
|
{
|
||||||
RCTNativeAnimatedNodesManager *_nodesManager;
|
RCTNativeAnimatedNodesManager *_nodesManager;
|
||||||
|
|
||||||
// Oparations called after views have been updated.
|
// Operations called after views have been updated.
|
||||||
NSMutableArray<AnimatedOperation> *_operations;
|
NSMutableArray<AnimatedOperation> *_operations;
|
||||||
// Operations called before views have been updated.
|
// Operations called before views have been updated.
|
||||||
NSMutableArray<AnimatedOperation> *_preOperations;
|
NSMutableArray<AnimatedOperation> *_preOperations;
|
||||||
|
|
|
@ -9975,7 +9975,7 @@ function updateReducer(reducer, initialArg, init) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hook.memoizedState = newState;
|
hook.memoizedState = newState;
|
||||||
// Don't persist the state accumlated from the render phase updates to
|
// Don't persist the state accumulated from the render phase updates to
|
||||||
// the base state unless the queue is empty.
|
// the base state unless the queue is empty.
|
||||||
// TODO: Not sure if this is the desired semantics, but it's what we
|
// TODO: Not sure if this is the desired semantics, but it's what we
|
||||||
// do for gDSFP. I can't remember why.
|
// do for gDSFP. I can't remember why.
|
||||||
|
@ -14233,7 +14233,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextDidTimeout && !prevDidTimeout) {
|
if (nextDidTimeout && !prevDidTimeout) {
|
||||||
// If this subtreee is running in concurrent mode we can suspend,
|
// If this subtree is running in concurrent mode we can suspend,
|
||||||
// otherwise we won't suspend.
|
// otherwise we won't suspend.
|
||||||
// TODO: This will still suspend a synchronous tree if anything
|
// TODO: This will still suspend a synchronous tree if anything
|
||||||
// in the concurrent tree already suspended during this render.
|
// in the concurrent tree already suspended during this render.
|
||||||
|
@ -14247,7 +14247,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if not prevDidTimeout.
|
// TODO: Only schedule updates if not prevDidTimeout.
|
||||||
if (nextDidTimeout) {
|
if (nextDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children.
|
// primary children.
|
||||||
workInProgress.effectTag |= Update;
|
workInProgress.effectTag |= Update;
|
||||||
}
|
}
|
||||||
|
@ -14256,7 +14256,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
||||||
if (nextDidTimeout || prevDidTimeout) {
|
if (nextDidTimeout || prevDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children. In mutation mode, we also need the flag to
|
// primary children. In mutation mode, we also need the flag to
|
||||||
// *unhide* children that were previously hidden, so check if the
|
// *unhide* children that were previously hidden, so check if the
|
||||||
// is currently timed out, too.
|
// is currently timed out, too.
|
||||||
|
@ -15901,7 +15901,7 @@ function throwException(
|
||||||
sourceFiber.tag = IncompleteClassComponent;
|
sourceFiber.tag = IncompleteClassComponent;
|
||||||
} else {
|
} else {
|
||||||
// When we try rendering again, we should not reuse the current fiber,
|
// When we try rendering again, we should not reuse the current fiber,
|
||||||
// since it's known to be in an inconsistent state. Use a force updte to
|
// since it's known to be in an inconsistent state. Use a force update to
|
||||||
// prevent a bail out.
|
// prevent a bail out.
|
||||||
var update = createUpdate(Sync);
|
var update = createUpdate(Sync);
|
||||||
update.tag = ForceUpdate;
|
update.tag = ForceUpdate;
|
||||||
|
@ -16291,7 +16291,7 @@ function scheduleUpdateOnFiber(fiber, expirationTime) {
|
||||||
// Flush the synchronous work now, wnless we're already working or inside
|
// Flush the synchronous work now, wnless we're already working or inside
|
||||||
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
||||||
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
||||||
// without immediately flushing it. We only do this for user-initated
|
// without immediately flushing it. We only do this for user-initiated
|
||||||
// updates, to preserve historical behavior of sync mode.
|
// updates, to preserve historical behavior of sync mode.
|
||||||
flushImmediateQueue();
|
flushImmediateQueue();
|
||||||
}
|
}
|
||||||
|
@ -16758,7 +16758,7 @@ function renderRoot(root, expirationTime, isSync) {
|
||||||
if (!isSync) {
|
if (!isSync) {
|
||||||
// If we're rendering asynchronously, it's possible the error was
|
// If we're rendering asynchronously, it's possible the error was
|
||||||
// caused by tearing due to a mutation during an event. Try rendering
|
// caused by tearing due to a mutation during an event. Try rendering
|
||||||
// one more time without yiedling to events.
|
// one more time without yielding to events.
|
||||||
prepareFreshStack(root, expirationTime);
|
prepareFreshStack(root, expirationTime);
|
||||||
scheduleCallback(
|
scheduleCallback(
|
||||||
ImmediatePriority,
|
ImmediatePriority,
|
||||||
|
|
|
@ -9971,7 +9971,7 @@ function updateReducer(reducer, initialArg, init) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hook.memoizedState = newState;
|
hook.memoizedState = newState;
|
||||||
// Don't persist the state accumlated from the render phase updates to
|
// Don't persist the state accumulated from the render phase updates to
|
||||||
// the base state unless the queue is empty.
|
// the base state unless the queue is empty.
|
||||||
// TODO: Not sure if this is the desired semantics, but it's what we
|
// TODO: Not sure if this is the desired semantics, but it's what we
|
||||||
// do for gDSFP. I can't remember why.
|
// do for gDSFP. I can't remember why.
|
||||||
|
@ -14229,7 +14229,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextDidTimeout && !prevDidTimeout) {
|
if (nextDidTimeout && !prevDidTimeout) {
|
||||||
// If this subtreee is running in concurrent mode we can suspend,
|
// If this subtree is running in concurrent mode we can suspend,
|
||||||
// otherwise we won't suspend.
|
// otherwise we won't suspend.
|
||||||
// TODO: This will still suspend a synchronous tree if anything
|
// TODO: This will still suspend a synchronous tree if anything
|
||||||
// in the concurrent tree already suspended during this render.
|
// in the concurrent tree already suspended during this render.
|
||||||
|
@ -14243,7 +14243,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if not prevDidTimeout.
|
// TODO: Only schedule updates if not prevDidTimeout.
|
||||||
if (nextDidTimeout) {
|
if (nextDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children.
|
// primary children.
|
||||||
workInProgress.effectTag |= Update;
|
workInProgress.effectTag |= Update;
|
||||||
}
|
}
|
||||||
|
@ -14252,7 +14252,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
||||||
if (nextDidTimeout || prevDidTimeout) {
|
if (nextDidTimeout || prevDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children. In mutation mode, we also need the flag to
|
// primary children. In mutation mode, we also need the flag to
|
||||||
// *unhide* children that were previously hidden, so check if the
|
// *unhide* children that were previously hidden, so check if the
|
||||||
// is currently timed out, too.
|
// is currently timed out, too.
|
||||||
|
@ -15897,7 +15897,7 @@ function throwException(
|
||||||
sourceFiber.tag = IncompleteClassComponent;
|
sourceFiber.tag = IncompleteClassComponent;
|
||||||
} else {
|
} else {
|
||||||
// When we try rendering again, we should not reuse the current fiber,
|
// When we try rendering again, we should not reuse the current fiber,
|
||||||
// since it's known to be in an inconsistent state. Use a force updte to
|
// since it's known to be in an inconsistent state. Use a force update to
|
||||||
// prevent a bail out.
|
// prevent a bail out.
|
||||||
var update = createUpdate(Sync);
|
var update = createUpdate(Sync);
|
||||||
update.tag = ForceUpdate;
|
update.tag = ForceUpdate;
|
||||||
|
@ -16287,7 +16287,7 @@ function scheduleUpdateOnFiber(fiber, expirationTime) {
|
||||||
// Flush the synchronous work now, wnless we're already working or inside
|
// Flush the synchronous work now, wnless we're already working or inside
|
||||||
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
||||||
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
||||||
// without immediately flushing it. We only do this for user-initated
|
// without immediately flushing it. We only do this for user-initiated
|
||||||
// updates, to preserve historical behavior of sync mode.
|
// updates, to preserve historical behavior of sync mode.
|
||||||
flushImmediateQueue();
|
flushImmediateQueue();
|
||||||
}
|
}
|
||||||
|
@ -16754,7 +16754,7 @@ function renderRoot(root, expirationTime, isSync) {
|
||||||
if (!isSync) {
|
if (!isSync) {
|
||||||
// If we're rendering asynchronously, it's possible the error was
|
// If we're rendering asynchronously, it's possible the error was
|
||||||
// caused by tearing due to a mutation during an event. Try rendering
|
// caused by tearing due to a mutation during an event. Try rendering
|
||||||
// one more time without yiedling to events.
|
// one more time without yielding to events.
|
||||||
prepareFreshStack(root, expirationTime);
|
prepareFreshStack(root, expirationTime);
|
||||||
scheduleCallback(
|
scheduleCallback(
|
||||||
ImmediatePriority,
|
ImmediatePriority,
|
||||||
|
|
|
@ -10290,7 +10290,7 @@ function updateReducer(reducer, initialArg, init) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hook.memoizedState = newState;
|
hook.memoizedState = newState;
|
||||||
// Don't persist the state accumlated from the render phase updates to
|
// Don't persist the state accumulated from the render phase updates to
|
||||||
// the base state unless the queue is empty.
|
// the base state unless the queue is empty.
|
||||||
// TODO: Not sure if this is the desired semantics, but it's what we
|
// TODO: Not sure if this is the desired semantics, but it's what we
|
||||||
// do for gDSFP. I can't remember why.
|
// do for gDSFP. I can't remember why.
|
||||||
|
@ -14548,7 +14548,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextDidTimeout && !prevDidTimeout) {
|
if (nextDidTimeout && !prevDidTimeout) {
|
||||||
// If this subtreee is running in concurrent mode we can suspend,
|
// If this subtree is running in concurrent mode we can suspend,
|
||||||
// otherwise we won't suspend.
|
// otherwise we won't suspend.
|
||||||
// TODO: This will still suspend a synchronous tree if anything
|
// TODO: This will still suspend a synchronous tree if anything
|
||||||
// in the concurrent tree already suspended during this render.
|
// in the concurrent tree already suspended during this render.
|
||||||
|
@ -14562,7 +14562,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if not prevDidTimeout.
|
// TODO: Only schedule updates if not prevDidTimeout.
|
||||||
if (nextDidTimeout) {
|
if (nextDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children.
|
// primary children.
|
||||||
workInProgress.effectTag |= Update;
|
workInProgress.effectTag |= Update;
|
||||||
}
|
}
|
||||||
|
@ -14571,7 +14571,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
||||||
if (nextDidTimeout || prevDidTimeout) {
|
if (nextDidTimeout || prevDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children. In mutation mode, we also need the flag to
|
// primary children. In mutation mode, we also need the flag to
|
||||||
// *unhide* children that were previously hidden, so check if the
|
// *unhide* children that were previously hidden, so check if the
|
||||||
// is currently timed out, too.
|
// is currently timed out, too.
|
||||||
|
@ -16215,7 +16215,7 @@ function throwException(
|
||||||
sourceFiber.tag = IncompleteClassComponent;
|
sourceFiber.tag = IncompleteClassComponent;
|
||||||
} else {
|
} else {
|
||||||
// When we try rendering again, we should not reuse the current fiber,
|
// When we try rendering again, we should not reuse the current fiber,
|
||||||
// since it's known to be in an inconsistent state. Use a force updte to
|
// since it's known to be in an inconsistent state. Use a force update to
|
||||||
// prevent a bail out.
|
// prevent a bail out.
|
||||||
var update = createUpdate(Sync);
|
var update = createUpdate(Sync);
|
||||||
update.tag = ForceUpdate;
|
update.tag = ForceUpdate;
|
||||||
|
@ -16605,7 +16605,7 @@ function scheduleUpdateOnFiber(fiber, expirationTime) {
|
||||||
// Flush the synchronous work now, wnless we're already working or inside
|
// Flush the synchronous work now, wnless we're already working or inside
|
||||||
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
||||||
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
||||||
// without immediately flushing it. We only do this for user-initated
|
// without immediately flushing it. We only do this for user-initiated
|
||||||
// updates, to preserve historical behavior of sync mode.
|
// updates, to preserve historical behavior of sync mode.
|
||||||
flushImmediateQueue();
|
flushImmediateQueue();
|
||||||
}
|
}
|
||||||
|
@ -17072,7 +17072,7 @@ function renderRoot(root, expirationTime, isSync) {
|
||||||
if (!isSync) {
|
if (!isSync) {
|
||||||
// If we're rendering asynchronously, it's possible the error was
|
// If we're rendering asynchronously, it's possible the error was
|
||||||
// caused by tearing due to a mutation during an event. Try rendering
|
// caused by tearing due to a mutation during an event. Try rendering
|
||||||
// one more time without yiedling to events.
|
// one more time without yielding to events.
|
||||||
prepareFreshStack(root, expirationTime);
|
prepareFreshStack(root, expirationTime);
|
||||||
scheduleCallback(
|
scheduleCallback(
|
||||||
ImmediatePriority,
|
ImmediatePriority,
|
||||||
|
|
|
@ -10286,7 +10286,7 @@ function updateReducer(reducer, initialArg, init) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hook.memoizedState = newState;
|
hook.memoizedState = newState;
|
||||||
// Don't persist the state accumlated from the render phase updates to
|
// Don't persist the state accumulated from the render phase updates to
|
||||||
// the base state unless the queue is empty.
|
// the base state unless the queue is empty.
|
||||||
// TODO: Not sure if this is the desired semantics, but it's what we
|
// TODO: Not sure if this is the desired semantics, but it's what we
|
||||||
// do for gDSFP. I can't remember why.
|
// do for gDSFP. I can't remember why.
|
||||||
|
@ -14544,7 +14544,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextDidTimeout && !prevDidTimeout) {
|
if (nextDidTimeout && !prevDidTimeout) {
|
||||||
// If this subtreee is running in concurrent mode we can suspend,
|
// If this subtree is running in concurrent mode we can suspend,
|
||||||
// otherwise we won't suspend.
|
// otherwise we won't suspend.
|
||||||
// TODO: This will still suspend a synchronous tree if anything
|
// TODO: This will still suspend a synchronous tree if anything
|
||||||
// in the concurrent tree already suspended during this render.
|
// in the concurrent tree already suspended during this render.
|
||||||
|
@ -14558,7 +14558,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if not prevDidTimeout.
|
// TODO: Only schedule updates if not prevDidTimeout.
|
||||||
if (nextDidTimeout) {
|
if (nextDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children.
|
// primary children.
|
||||||
workInProgress.effectTag |= Update;
|
workInProgress.effectTag |= Update;
|
||||||
}
|
}
|
||||||
|
@ -14567,7 +14567,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
||||||
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
// TODO: Only schedule updates if these values are non equal, i.e. it changed.
|
||||||
if (nextDidTimeout || prevDidTimeout) {
|
if (nextDidTimeout || prevDidTimeout) {
|
||||||
// If this boundary just timed out, schedule an effect to attach a
|
// If this boundary just timed out, schedule an effect to attach a
|
||||||
// retry listener to the proimse. This flag is also used to hide the
|
// retry listener to the promise. This flag is also used to hide the
|
||||||
// primary children. In mutation mode, we also need the flag to
|
// primary children. In mutation mode, we also need the flag to
|
||||||
// *unhide* children that were previously hidden, so check if the
|
// *unhide* children that were previously hidden, so check if the
|
||||||
// is currently timed out, too.
|
// is currently timed out, too.
|
||||||
|
@ -16211,7 +16211,7 @@ function throwException(
|
||||||
sourceFiber.tag = IncompleteClassComponent;
|
sourceFiber.tag = IncompleteClassComponent;
|
||||||
} else {
|
} else {
|
||||||
// When we try rendering again, we should not reuse the current fiber,
|
// When we try rendering again, we should not reuse the current fiber,
|
||||||
// since it's known to be in an inconsistent state. Use a force updte to
|
// since it's known to be in an inconsistent state. Use a force update to
|
||||||
// prevent a bail out.
|
// prevent a bail out.
|
||||||
var update = createUpdate(Sync);
|
var update = createUpdate(Sync);
|
||||||
update.tag = ForceUpdate;
|
update.tag = ForceUpdate;
|
||||||
|
@ -16601,7 +16601,7 @@ function scheduleUpdateOnFiber(fiber, expirationTime) {
|
||||||
// Flush the synchronous work now, wnless we're already working or inside
|
// Flush the synchronous work now, wnless we're already working or inside
|
||||||
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
||||||
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
||||||
// without immediately flushing it. We only do this for user-initated
|
// without immediately flushing it. We only do this for user-initiated
|
||||||
// updates, to preserve historical behavior of sync mode.
|
// updates, to preserve historical behavior of sync mode.
|
||||||
flushImmediateQueue();
|
flushImmediateQueue();
|
||||||
}
|
}
|
||||||
|
@ -17068,7 +17068,7 @@ function renderRoot(root, expirationTime, isSync) {
|
||||||
if (!isSync) {
|
if (!isSync) {
|
||||||
// If we're rendering asynchronously, it's possible the error was
|
// If we're rendering asynchronously, it's possible the error was
|
||||||
// caused by tearing due to a mutation during an event. Try rendering
|
// caused by tearing due to a mutation during an event. Try rendering
|
||||||
// one more time without yiedling to events.
|
// one more time without yielding to events.
|
||||||
prepareFreshStack(root, expirationTime);
|
prepareFreshStack(root, expirationTime);
|
||||||
scheduleCallback(
|
scheduleCallback(
|
||||||
ImmediatePriority,
|
ImmediatePriority,
|
||||||
|
|
|
@ -279,7 +279,7 @@ module.exports = {
|
||||||
* > **NOTE**: Exercise caution as abusing this can tax you in terms of
|
* > **NOTE**: Exercise caution as abusing this can tax you in terms of
|
||||||
* > optimizations.
|
* > optimizations.
|
||||||
* >
|
* >
|
||||||
* > IDs enable optimizations through the bridge and memory in general. Refering
|
* > IDs enable optimizations through the bridge and memory in general. Referring
|
||||||
* > to style objects directly will deprive you of these optimizations.
|
* > to style objects directly will deprive you of these optimizations.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe('normalizeColor', function() {
|
||||||
expect(normalizeColor(0xffffffff + 1)).toBe(null);
|
expect(normalizeColor(0xffffffff + 1)).toBe(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should temporarly accept floating point values for rgb', function() {
|
it('should temporarily accept floating point values for rgb', function() {
|
||||||
expect(normalizeColor('rgb(1.1, 2.1, 3.1)')).toBe(0x010203ff);
|
expect(normalizeColor('rgb(1.1, 2.1, 3.1)')).toBe(0x010203ff);
|
||||||
expect(normalizeColor('rgba(1.1, 2.1, 3.1, 1.0)')).toBe(0x010203ff);
|
expect(normalizeColor('rgba(1.1, 2.1, 3.1, 1.0)')).toBe(0x010203ff);
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,7 +37,7 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
|
||||||
|
|
||||||
- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes
|
- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes
|
||||||
{
|
{
|
||||||
// Note: All lines marked with `*` does not use explicit/correct rules to compare old and new values becuase
|
// Note: All lines marked with `*` does not use explicit/correct rules to compare old and new values because
|
||||||
// their types do not have special designated value representing undefined/unspecified/inherit meaning.
|
// their types do not have special designated value representing undefined/unspecified/inherit meaning.
|
||||||
// We will address this in the future.
|
// We will address this in the future.
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
[descendantViews addObject:descendantView];
|
[descendantViews addObject:descendantView];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// Removing all references to Shadow Views to avoid unnececery retainning.
|
// Removing all references to Shadow Views to avoid unnecessary retaining.
|
||||||
[textStorage removeAttribute:RCTBaseTextShadowViewEmbeddedShadowViewAttributeName range:NSMakeRange(0, textStorage.length)];
|
[textStorage removeAttribute:RCTBaseTextShadowViewEmbeddedShadowViewAttributeName range:NSMakeRange(0, textStorage.length)];
|
||||||
|
|
||||||
[textView setTextStorage:textStorage
|
[textView setTextStorage:textStorage
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
NSMutableAttributedString *attributedText =
|
NSMutableAttributedString *attributedText =
|
||||||
[[NSMutableAttributedString alloc] initWithAttributedString:[self attributedTextWithBaseTextAttributes:nil]];
|
[[NSMutableAttributedString alloc] initWithAttributedString:[self attributedTextWithBaseTextAttributes:nil]];
|
||||||
|
|
||||||
// Removing all references to Shadow Views and tags to avoid unnececery retainning
|
// Removing all references to Shadow Views and tags to avoid unnecessary retaining
|
||||||
// and problems with comparing the strings.
|
// and problems with comparing the strings.
|
||||||
[attributedText removeAttribute:RCTBaseTextShadowViewEmbeddedShadowViewAttributeName
|
[attributedText removeAttribute:RCTBaseTextShadowViewEmbeddedShadowViewAttributeName
|
||||||
range:NSMakeRange(0, attributedText.length)];
|
range:NSMakeRange(0, attributedText.length)];
|
||||||
|
@ -195,7 +195,7 @@
|
||||||
|
|
||||||
if (attributedText.length == 0) {
|
if (attributedText.length == 0) {
|
||||||
// It's impossible to measure empty attributed string because all attributes are
|
// It's impossible to measure empty attributed string because all attributes are
|
||||||
// assosiated with some characters, so no characters means no data.
|
// associated with some characters, so no characters means no data.
|
||||||
|
|
||||||
// Placeholder also can represent the intrinsic size when it is visible.
|
// Placeholder also can represent the intrinsic size when it is visible.
|
||||||
NSString *text = self.placeholder;
|
NSString *text = self.placeholder;
|
||||||
|
|
|
@ -93,13 +93,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)textOf:(NSAttributedString*)newText equals:(NSAttributedString*)oldText{
|
- (BOOL)textOf:(NSAttributedString*)newText equals:(NSAttributedString*)oldText{
|
||||||
// When the dictation is running we can't update the attibuted text on the backed up text view
|
// When the dictation is running we can't update the attributed text on the backed up text view
|
||||||
// because setting the attributed string will kill the dictation. This means that we can't impose
|
// because setting the attributed string will kill the dictation. This means that we can't impose
|
||||||
// the settings on a dictation.
|
// the settings on a dictation.
|
||||||
// Similarly, when the user is in the middle of inputting some text in Japanese/Chinese, there will be styling on the
|
// Similarly, when the user is in the middle of inputting some text in Japanese/Chinese, there will be styling on the
|
||||||
// text that we should disregard. See https://developer.apple.com/documentation/uikit/uitextinput/1614489-markedtextrange?language=objc
|
// text that we should disregard. See https://developer.apple.com/documentation/uikit/uitextinput/1614489-markedtextrange?language=objc
|
||||||
// for more info.
|
// for more info.
|
||||||
// If the user added an emoji, the sytem adds a font attribute for the emoji and stores the original font in NSOriginalFont.
|
// If the user added an emoji, the system adds a font attribute for the emoji and stores the original font in NSOriginalFont.
|
||||||
// Lastly, when entering a password, etc., there will be additional styling on the field as the native text view
|
// Lastly, when entering a password, etc., there will be additional styling on the field as the native text view
|
||||||
// handles showing the last character for a split second.
|
// handles showing the last character for a split second.
|
||||||
__block BOOL fontHasBeenUpdatedBySystem = false;
|
__block BOOL fontHasBeenUpdatedBySystem = false;
|
||||||
|
|
|
@ -187,7 +187,7 @@ describe('buildStyleInterpolator', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should detect chnages correctly', function() {
|
it('should detect changes correctly', function() {
|
||||||
const testAnim = {
|
const testAnim = {
|
||||||
opacity: {
|
opacity: {
|
||||||
from: 0,
|
from: 0,
|
||||||
|
|
|
@ -51,7 +51,7 @@ const _cookies: {[key: string]: number} = {};
|
||||||
const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally committing `true`;
|
const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally committing `true`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates peformance loggers that can be used to collect and log
|
* This function creates performance loggers that can be used to collect and log
|
||||||
* various performance data such as timespans, points and extras.
|
* various performance data such as timespans, points and extras.
|
||||||
* The loggers need to have minimal overhead since they're used in production.
|
* The loggers need to have minimal overhead since they're used in production.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
[super invalidateIntrinsicContentSize];
|
[super invalidateIntrinsicContentSize];
|
||||||
|
|
||||||
// Setting `intrinsicContentSize` dirties the Yoga node and
|
// Setting `intrinsicContentSize` dirties the Yoga node and
|
||||||
// enfoce Yoga to call `measure` function (backed to `measureBlock`).
|
// enforce Yoga to call `measure` function (backed to `measureBlock`).
|
||||||
[_bridge.uiManager setIntrinsicContentSize:self.intrinsicContentSize forView:self];
|
[_bridge.uiManager setIntrinsicContentSize:self.intrinsicContentSize forView:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ describe('YellowBoxRegistry', () => {
|
||||||
expect(observer.mock.calls[0][0]).toBe(registry());
|
expect(observer.mock.calls[0][0]).toBe(registry());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sends batched updates asynchoronously', () => {
|
it('sends batched updates asynchronously', () => {
|
||||||
const {observer} = observe();
|
const {observer} = observe();
|
||||||
expect(observer.mock.calls.length).toBe(1);
|
expect(observer.mock.calls.length).toBe(1);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||||
Performs the comparison of the view.
|
Performs the comparison of the view.
|
||||||
@param view The view to snapshot.
|
@param view The view to snapshot.
|
||||||
@param selector selector
|
@param selector selector
|
||||||
@param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method.
|
@param identifier An optional identifier, used is there are multiple snapshot tests in a given -test method.
|
||||||
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||||
@returns YES if the comparison (or saving of the reference image) succeeded.
|
@returns YES if the comparison (or saving of the reference image) succeeded.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -176,7 +176,7 @@ RCT_EXPORT_METHOD(test:(__unused NSString *)a
|
||||||
/**
|
/**
|
||||||
* T42930872:
|
* T42930872:
|
||||||
*
|
*
|
||||||
* Both bridge invalidation and bridge setUp occurr execute concurrently.
|
* Both bridge invalidation and bridge setUp occur execute concurrently.
|
||||||
* Therefore, it's not safe for us to create a bridge, and immediately reload on
|
* Therefore, it's not safe for us to create a bridge, and immediately reload on
|
||||||
* it. It's also unsafe to just reload the bridge, because that calls invalidate
|
* it. It's also unsafe to just reload the bridge, because that calls invalidate
|
||||||
* and then setUp. Because of these race conditions, this test may randomly
|
* and then setUp. Because of these race conditions, this test may randomly
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ static id RCTPropChecker(NSString *prop, NSNumber *value)
|
||||||
*/
|
*/
|
||||||
- (void) testSpringTrackingRetainsSpeed
|
- (void) testSpringTrackingRetainsSpeed
|
||||||
{
|
{
|
||||||
// this spring config correspomds to tension 20 and friction 0.5 which makes the spring settle
|
// this spring config corresponds to tension 20 and friction 0.5 which makes the spring settle
|
||||||
// very slowly
|
// very slowly
|
||||||
NSDictionary *springConfig = @{@"type": @"spring",
|
NSDictionary *springConfig = @{@"type": @"spring",
|
||||||
@"restSpeedThreshold": @0.001,
|
@"restSpeedThreshold": @0.001,
|
||||||
|
|
|
@ -67,7 +67,7 @@ class AnExTilt extends React.Component<Object, any> {
|
||||||
_startBurnsZoom() {
|
_startBurnsZoom() {
|
||||||
this.state.burns.setValue(1); // reset to beginning
|
this.state.burns.setValue(1); // reset to beginning
|
||||||
Animated.decay(this.state.burns, {
|
Animated.decay(this.state.burns, {
|
||||||
velocity: 1, // sublte zoom
|
velocity: 1, // subtle zoom
|
||||||
deceleration: 0.9999, // slow decay
|
deceleration: 0.9999, // slow decay
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ class TimerTester extends React.Component<TimerTesterProps> {
|
||||||
this._immediateId = setImmediate(this._run);
|
this._immediateId = setImmediate(this._run);
|
||||||
};
|
};
|
||||||
} else if (this.props.type === 'setInterval') {
|
} else if (this.props.type === 'setInterval') {
|
||||||
this._iters = 30; // Only used for forceUpdate periodicidy
|
this._iters = 30; // Only used for forceUpdate periodicity
|
||||||
this._timerFn = null;
|
this._timerFn = null;
|
||||||
this._intervalId = setInterval(this._run, this.props.dt);
|
this._intervalId = setInterval(this._run, this.props.dt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationBridgeDescripti
|
||||||
/**
|
/**
|
||||||
* This block can be used to instantiate modules that require additional
|
* This block can be used to instantiate modules that require additional
|
||||||
* init parameters, or additional configuration prior to being used.
|
* init parameters, or additional configuration prior to being used.
|
||||||
* The bridge will call this block to instatiate the modules, and will
|
* The bridge will call this block to instantiate the modules, and will
|
||||||
* be responsible for invalidating/releasing them when the bridge is destroyed.
|
* be responsible for invalidating/releasing them when the bridge is destroyed.
|
||||||
* For this reason, the block should always return new module instances, and
|
* For this reason, the block should always return new module instances, and
|
||||||
* module instances should not be shared between bridges.
|
* module instances should not be shared between bridges.
|
||||||
|
@ -180,7 +180,7 @@ RCT_EXTERN void RCTEnableTurboModule(BOOL enabled);
|
||||||
/**
|
/**
|
||||||
* Retrieve a bridge module instance by name or class. Note that modules are
|
* Retrieve a bridge module instance by name or class. Note that modules are
|
||||||
* lazily instantiated, so calling these methods for the first time with a given
|
* lazily instantiated, so calling these methods for the first time with a given
|
||||||
* module name/class may cause the class to be sychronously instantiated,
|
* module name/class may cause the class to be synchronously instantiated,
|
||||||
* potentially blocking both the calling thread and main thread for a short time.
|
* potentially blocking both the calling thread and main thread for a short time.
|
||||||
*
|
*
|
||||||
* Note: This method does NOT lazily load the particular module if it's not yet loaded.
|
* Note: This method does NOT lazily load the particular module if it's not yet loaded.
|
||||||
|
@ -198,7 +198,7 @@ RCT_EXTERN void RCTEnableTurboModule(BOOL enabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method for retrieving all modules conforming to a given protocol.
|
* Convenience method for retrieving all modules conforming to a given protocol.
|
||||||
* Modules will be sychronously instantiated if they haven't already been,
|
* Modules will be synchronously instantiated if they haven't already been,
|
||||||
* potentially blocking both the calling thread and main thread for a short time.
|
* potentially blocking both the calling thread and main thread for a short time.
|
||||||
*/
|
*/
|
||||||
- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol;
|
- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol;
|
||||||
|
|
|
@ -291,7 +291,7 @@ RCT_CONCAT(initialize_, objc_name)() { RCTRegisterModule([objc_name class]); }
|
||||||
* Most modules can be used from any thread. All of the modules exported non-sync method will be called on its
|
* Most modules can be used from any thread. All of the modules exported non-sync method will be called on its
|
||||||
* methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access
|
* methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access
|
||||||
* information that's main queue only (e.g. most UIKit classes). Since we don't want to dispatch synchronously to the
|
* information that's main queue only (e.g. most UIKit classes). Since we don't want to dispatch synchronously to the
|
||||||
* main thread to this safely, we construct these moduels and export their constants ahead-of-time.
|
* main thread to this safely, we construct these modules and export their constants ahead-of-time.
|
||||||
*
|
*
|
||||||
* Note that when set to false, the module constructor will be called from any thread.
|
* Note that when set to false, the module constructor will be called from any thread.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Facebook, Inc. and its affilities.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Facebook, Inc. and its affilities.
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
*
|
*
|
||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
|
|
@ -124,7 +124,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init);
|
||||||
_instance = _moduleProvider ? _moduleProvider() : nil;
|
_instance = _moduleProvider ? _moduleProvider() : nil;
|
||||||
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @"");
|
||||||
if (!_instance) {
|
if (!_instance) {
|
||||||
// Module init returned nil, probably because automatic instantatiation
|
// Module init returned nil, probably because automatic instantiation
|
||||||
// of the module is not supported, and it is supposed to be passed in to
|
// of the module is not supported, and it is supposed to be passed in to
|
||||||
// the bridge constructor. Mark setup complete to avoid doing more work.
|
// the bridge constructor. Mark setup complete to avoid doing more work.
|
||||||
_setupComplete = YES;
|
_setupComplete = YES;
|
||||||
|
|
|
@ -429,7 +429,7 @@ RCT_EXTERN_C_END
|
||||||
}
|
}
|
||||||
if (isNullableType) {
|
if (isNullableType) {
|
||||||
// Check converted value wasn't null either, as method probably
|
// Check converted value wasn't null either, as method probably
|
||||||
// won't gracefully handle a nil vallue for a nonull argument
|
// won't gracefully handle a nil value for a nonull argument
|
||||||
void *value;
|
void *value;
|
||||||
[invocation getArgument:&value atIndex:index + 2];
|
[invocation getArgument:&value atIndex:index + 2];
|
||||||
if (value == NULL) {
|
if (value == NULL) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ NSString *const RCTContentDidAppearNotification;
|
||||||
* The intrinsic size of the root view's content. This is set right before the
|
* The intrinsic size of the root view's content. This is set right before the
|
||||||
* `rootViewDidChangeIntrinsicSize` method of `RCTRootViewDelegate` is called.
|
* `rootViewDidChangeIntrinsicSize` method of `RCTRootViewDelegate` is called.
|
||||||
* This property is deprecated and will be removed in next releases.
|
* This property is deprecated and will be removed in next releases.
|
||||||
* Use UIKit `intrinsicContentSize` propery instead.
|
* Use UIKit `intrinsicContentSize` property instead.
|
||||||
*/
|
*/
|
||||||
@property (readonly, nonatomic, assign) CGSize intrinsicSize
|
@property (readonly, nonatomic, assign) CGSize intrinsicSize
|
||||||
__deprecated_msg("Use `intrinsicContentSize` instead.");
|
__deprecated_msg("Use `intrinsicContentSize` instead.");
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* `setNeedsLayout` for its superview which in its turn will trigger relayout.
|
* `setNeedsLayout` for its superview which in its turn will trigger relayout.
|
||||||
*
|
*
|
||||||
* The new intrinsic content size is available via the `intrinsicContentSize`
|
* The new intrinsic content size is available via the `intrinsicContentSize`
|
||||||
* propery of the root view. The view will not resize itself.
|
* property of the root view. The view will not resize itself.
|
||||||
*/
|
*/
|
||||||
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView;
|
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView;
|
||||||
|
|
||||||
|
|
|
@ -234,11 +234,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithTarget:(id)target action:(SEL)action
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* To ensure compatibilty when using UIManager.measure and RCTTouchHandler, we have to adopt
|
* To ensure compatibility when using UIManager.measure and RCTTouchHandler, we have to adopt
|
||||||
* UIManager.measure's behavior in finding a "root view".
|
* UIManager.measure's behavior in finding a "root view".
|
||||||
* Usually RCTTouchHandler is already attached to a root view but in some cases (e.g. Modal),
|
* Usually RCTTouchHandler is already attached to a root view but in some cases (e.g. Modal),
|
||||||
* we are instead attached to some RCTView subtree. This is also the case when embedding some RN
|
* we are instead attached to some RCTView subtree. This is also the case when embedding some RN
|
||||||
* views inside a seperate ViewController not controlled by RN.
|
* views inside a separate ViewController not controlled by RN.
|
||||||
* This logic will either find the nearest rootView, or go all the way to the UIWindow.
|
* This logic will either find the nearest rootView, or go all the way to the UIWindow.
|
||||||
* While this is not optimal, it is exactly what UIManager.measure does, and what Touchable.js
|
* While this is not optimal, it is exactly what UIManager.measure does, and what Touchable.js
|
||||||
* relies on.
|
* relies on.
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Immutable Properties (no need to enforce synchonization)
|
#pragma mark - Immutable Properties (no need to enforce synchronization)
|
||||||
|
|
||||||
- (RCTBridge *)bridge
|
- (RCTBridge *)bridge
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
return _rootViewTag;
|
return _rootViewTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Convinience Internal Thread-Safe Properties
|
#pragma mark - Convenience Internal Thread-Safe Properties
|
||||||
|
|
||||||
- (RCTBridge *)_batchedBridge
|
- (RCTBridge *)_batchedBridge
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
RCTAssert([rootView isKindOfClass:[RCTSurfaceRootView class]],
|
RCTAssert([rootView isKindOfClass:[RCTSurfaceRootView class]],
|
||||||
@"Received root view is not an instanse of `RCTSurfaceRootView`.");
|
@"Received root view is not an instance of `RCTSurfaceRootView`.");
|
||||||
|
|
||||||
if (rootView.superview != view) {
|
if (rootView.superview != view) {
|
||||||
view.rootView = rootView;
|
view.rootView = rootView;
|
||||||
|
@ -339,7 +339,7 @@
|
||||||
RCTSurfaceRootShadowView *rootShadowView =
|
RCTSurfaceRootShadowView *rootShadowView =
|
||||||
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
||||||
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
||||||
@"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.");
|
@"Received shadow view is not an instance of `RCTSurfaceRootShadowView`.");
|
||||||
|
|
||||||
[rootShadowView setMinimumSize:minimumSize
|
[rootShadowView setMinimumSize:minimumSize
|
||||||
maximumSize:maximumSize];
|
maximumSize:maximumSize];
|
||||||
|
@ -360,7 +360,7 @@
|
||||||
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
||||||
|
|
||||||
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
||||||
@"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.");
|
@"Received shadow view is not an instance of `RCTSurfaceRootShadowView`.");
|
||||||
|
|
||||||
fittingSize = [rootShadowView sizeThatFitsMinimumSize:minimumSize
|
fittingSize = [rootShadowView sizeThatFitsMinimumSize:minimumSize
|
||||||
maximumSize:maximumSize];
|
maximumSize:maximumSize];
|
||||||
|
@ -396,7 +396,7 @@
|
||||||
RCTSurfaceRootShadowView *rootShadowView =
|
RCTSurfaceRootShadowView *rootShadowView =
|
||||||
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
(RCTSurfaceRootShadowView *)[uiManager shadowViewForReactTag:self->_rootViewTag];
|
||||||
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
RCTAssert([rootShadowView isKindOfClass:[RCTSurfaceRootShadowView class]],
|
||||||
@"Received shadow view is not an instanse of `RCTSurfaceRootShadowView`.");
|
@"Received shadow view is not an instance of `RCTSurfaceRootShadowView`.");
|
||||||
|
|
||||||
[rootShadowView setMinimumSize:minimumSize maximumSize:maximumSize];
|
[rootShadowView setMinimumSize:minimumSize maximumSize:maximumSize];
|
||||||
[uiManager setNeedsLayout];
|
[uiManager setNeedsLayout];
|
||||||
|
@ -452,7 +452,7 @@
|
||||||
|
|
||||||
if (RCTIsMainQueue() && (stage & RCTSurfaceStageSurfaceDidInitialMounting)) {
|
if (RCTIsMainQueue() && (stage & RCTSurfaceStageSurfaceDidInitialMounting)) {
|
||||||
// All main-threaded execution (especially mounting process) has to be
|
// All main-threaded execution (especially mounting process) has to be
|
||||||
// intercepted, captured and performed synchnously at the end of this method
|
// intercepted, captured and performed synchronously at the end of this method
|
||||||
// right after the semaphore signals.
|
// right after the semaphore signals.
|
||||||
|
|
||||||
// Atomic variant of `_waitingForMountingStageOnMainQueue = YES;`
|
// Atomic variant of `_waitingForMountingStageOnMainQueue = YES;`
|
||||||
|
|
|
@ -865,7 +865,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||||
if (initializeImmediately && RCTIsMainQueue()) {
|
if (initializeImmediately && RCTIsMainQueue()) {
|
||||||
block();
|
block();
|
||||||
} else {
|
} else {
|
||||||
// We've already checked that dispatchGroup is non-null, but this satisifies the
|
// We've already checked that dispatchGroup is non-null, but this satisfies the
|
||||||
// Xcode analyzer
|
// Xcode analyzer
|
||||||
if (dispatchGroup) {
|
if (dispatchGroup) {
|
||||||
dispatch_group_async(dispatchGroup, dispatch_get_main_queue(), block);
|
dispatch_group_async(dispatchGroup, dispatch_get_main_queue(), block);
|
||||||
|
@ -1153,7 +1153,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
|
||||||
// work to the JS queue directly.
|
// work to the JS queue directly.
|
||||||
|
|
||||||
if (self.loading || _pendingCount > 0) {
|
if (self.loading || _pendingCount > 0) {
|
||||||
// From the callers' perspecive:
|
// From the callers' perspective:
|
||||||
|
|
||||||
// Phase 1: jsQueueBlocks are added to the queue; _pendingCount is
|
// Phase 1: jsQueueBlocks are added to the queue; _pendingCount is
|
||||||
// incremented for each. If the first block is created after self.loading is
|
// incremented for each. If the first block is created after self.loading is
|
||||||
|
|
|
@ -57,7 +57,7 @@ using namespace facebook::react;
|
||||||
// is also baked into _method.
|
// is also baked into _method.
|
||||||
|
|
||||||
// the last N arguments are callbacks, according to the Method data. The
|
// the last N arguments are callbacks, according to the Method data. The
|
||||||
// preceding arguments are values whic have already been parsed from JS: they
|
// preceding arguments are values which have already been parsed from JS: they
|
||||||
// may be NSNumber (bool, int, double), NSString, NSArray, or NSObject.
|
// may be NSNumber (bool, int, double), NSString, NSArray, or NSObject.
|
||||||
|
|
||||||
CxxModule::Callback first;
|
CxxModule::Callback first;
|
||||||
|
|
|
@ -29,7 +29,7 @@ extern const int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION;
|
||||||
|
|
||||||
@optional
|
@optional
|
||||||
|
|
||||||
/** By default object will receive its methods on the main queue, unless this method is overriden. */
|
/** By default object will receive its methods on the main queue, unless this method is overridden. */
|
||||||
- (dispatch_queue_t)methodQueue;
|
- (dispatch_queue_t)methodQueue;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `UIScrollView` subclass which has some improvements and tweaks
|
* `UIScrollView` subclass which has some improvements and tweaks
|
||||||
* wich are not directly related to React.
|
* which are not directly related to React.
|
||||||
*/
|
*/
|
||||||
@interface RCTEnhancedScrollView : UIScrollView
|
@interface RCTEnhancedScrollView : UIScrollView
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
* and `padding`) of the component.
|
* and `padding`) of the component.
|
||||||
* This view must not be a component view; it's just a convenient way
|
* This view must not be a component view; it's just a convenient way
|
||||||
* to embed/bridge pure native views as component views.
|
* to embed/bridge pure native views as component views.
|
||||||
* Defaults to `nil`. Assing `nil` to remove view as subview.
|
* Defaults to `nil`. Assign `nil` to remove view as subview.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, strong, nullable) UIView *contentView;
|
@property (nonatomic, strong, nullable) UIView *contentView;
|
||||||
|
|
||||||
|
|
|
@ -459,7 +459,7 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
||||||
CGFloat cornerRadius = 0;
|
CGFloat cornerRadius = 0;
|
||||||
if (self.clipsToBounds) {
|
if (self.clipsToBounds) {
|
||||||
if (borderMetrics.borderRadii.isUniform()) {
|
if (borderMetrics.borderRadii.isUniform()) {
|
||||||
// In this case we can simply use `cornerRadius` exclusivly.
|
// In this case we can simply use `cornerRadius` exclusively.
|
||||||
cornerRadius = borderMetrics.borderRadii.topLeft;
|
cornerRadius = borderMetrics.borderRadii.topLeft;
|
||||||
} else {
|
} else {
|
||||||
// In this case we have to generate masking layer manually.
|
// In this case we have to generate masking layer manually.
|
||||||
|
|
|
@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
- (UIView<RCTComponentViewProtocol> *)componentViewByTag:(ReactTag)tag;
|
- (UIView<RCTComponentViewProtocol> *)componentViewByTag:(ReactTag)tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns `tag` assosiated with given `componentView`.
|
* Returns `tag` associated with given `componentView`.
|
||||||
*/
|
*/
|
||||||
- (ReactTag)tagByComponentView:(UIView<RCTComponentViewProtocol> *)componentView;
|
- (ReactTag)tagByComponentView:(UIView<RCTComponentViewProtocol> *)componentView;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
[self stop];
|
[self stop];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Immutable Properties (no need to enforce synchonization)
|
#pragma mark - Immutable Properties (no need to enforce synchronization)
|
||||||
|
|
||||||
- (NSString *)moduleName
|
- (NSString *)moduleName
|
||||||
{
|
{
|
||||||
|
|
|
@ -246,7 +246,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The corresopnding android code has a lot of custom config options for
|
// The corresponding android code has a lot of custom config options for
|
||||||
// timeouts, but it appears the iOS RCTSRWebSocket API doesn't have the same
|
// timeouts, but it appears the iOS RCTSRWebSocket API doesn't have the same
|
||||||
// implemented options.
|
// implemented options.
|
||||||
_webSocket = [[RCTSRWebSocket alloc] initWithURL:_url];
|
_webSocket = [[RCTSRWebSocket alloc] initWithURL:_url];
|
||||||
|
|
|
@ -232,7 +232,7 @@ RCT_EXPORT_MODULE()
|
||||||
{
|
{
|
||||||
NSNumber *m = self.multipliers[category];
|
NSNumber *m = self.multipliers[category];
|
||||||
if (m.doubleValue <= 0.0) {
|
if (m.doubleValue <= 0.0) {
|
||||||
RCTLogError(@"Can't determinte multiplier for category %@. Using 1.0.", category);
|
RCTLogError(@"Can't determine multiplier for category %@. Using 1.0.", category);
|
||||||
m = @1.0;
|
m = @1.0;
|
||||||
}
|
}
|
||||||
return m.doubleValue;
|
return m.doubleValue;
|
||||||
|
|
|
@ -279,7 +279,7 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
|
||||||
@"Attempt to register rootTag (%@) which is not actually root tag.", rootTag);
|
@"Attempt to register rootTag (%@) which is not actually root tag.", rootTag);
|
||||||
|
|
||||||
RCTAssert(![_rootViewTags containsObject:rootTag],
|
RCTAssert(![_rootViewTags containsObject:rootTag],
|
||||||
@"Attempt to register rootTag (%@) which was already registred.", rootTag);
|
@"Attempt to register rootTag (%@) which was already registered.", rootTag);
|
||||||
|
|
||||||
[_rootViewTags addObject:rootTag];
|
[_rootViewTags addObject:rootTag];
|
||||||
|
|
||||||
|
@ -1203,7 +1203,7 @@ RCT_EXPORT_METHOD(dispatchViewManagerCommand:(nonnull NSNumber *)reactTag
|
||||||
// so we have to maintain this collection properly.
|
// so we have to maintain this collection properly.
|
||||||
NSArray<NSString *> *previousProps;
|
NSArray<NSString *> *previousProps;
|
||||||
if ((previousProps = [_shadowViewsWithUpdatedProps objectForKey:shadowView])) {
|
if ((previousProps = [_shadowViewsWithUpdatedProps objectForKey:shadowView])) {
|
||||||
// Merging already registred changed props and new ones.
|
// Merging already registered changed props and new ones.
|
||||||
NSMutableSet *set = [NSMutableSet setWithArray:previousProps];
|
NSMutableSet *set = [NSMutableSet setWithArray:previousProps];
|
||||||
[set addObjectsFromArray:props];
|
[set addObjectsFromArray:props];
|
||||||
props = [set allObjects];
|
props = [set allObjects];
|
||||||
|
@ -1324,7 +1324,7 @@ RCT_EXPORT_METHOD(measureInWindow:(nonnull NSNumber *)reactTag
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returs if the shadow view provided has the `ancestor` shadow view as
|
* Returns if the shadow view provided has the `ancestor` shadow view as
|
||||||
* an actual ancestor.
|
* an actual ancestor.
|
||||||
*/
|
*/
|
||||||
RCT_EXPORT_METHOD(viewIsDescendantOf:(nonnull NSNumber *)reactTag
|
RCT_EXPORT_METHOD(viewIsDescendantOf:(nonnull NSNumber *)reactTag
|
||||||
|
|
|
@ -85,7 +85,7 @@ RCT_EXTERN BOOL RCTIsPseudoUIManagerQueue(void);
|
||||||
RCT_EXTERN void RCTExecuteOnUIManagerQueue(dispatch_block_t block);
|
RCT_EXTERN void RCTExecuteOnUIManagerQueue(dispatch_block_t block);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* *Synchorously* executes the specified block on the UIManager queue.
|
* *Synchronously* executes the specified block on the UIManager queue.
|
||||||
* Unlike `dispatch_sync()` this will execute the block immediately
|
* Unlike `dispatch_sync()` this will execute the block immediately
|
||||||
* if we're already on the UIManager queue.
|
* if we're already on the UIManager queue.
|
||||||
* Please do not use this unless you really know what you're doing.
|
* Please do not use this unless you really know what you're doing.
|
||||||
|
|
|
@ -456,7 +456,7 @@ static UIImage *RCTGetSolidBorderImage(RCTCornerRadii cornerRadii,
|
||||||
// +------------------+
|
// +------------------+
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Note that this approach will produce discontinous colour changes at the edge
|
// Note that this approach will produce discontinuous colour changes at the edge
|
||||||
// (which is okay). The reason is that Quartz does not currently support drawing
|
// (which is okay). The reason is that Quartz does not currently support drawing
|
||||||
// of gradients _along_ a path (NB: clipping a path and drawing a linear gradient
|
// of gradients _along_ a path (NB: clipping a path and drawing a linear gradient
|
||||||
// is _not_ equivalent).
|
// is _not_ equivalent).
|
||||||
|
|
|
@ -25,14 +25,14 @@
|
||||||
* Designated method to control dirty propagation mechanism.
|
* Designated method to control dirty propagation mechanism.
|
||||||
* Dirties the shadow view (and all affected shadow views, usually a superview)
|
* Dirties the shadow view (and all affected shadow views, usually a superview)
|
||||||
* in terms of layout.
|
* in terms of layout.
|
||||||
* The default implementaion does nothing.
|
* The default implementation does nothing.
|
||||||
*/
|
*/
|
||||||
- (void)dirtyLayout;
|
- (void)dirtyLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Designated method to control dirty propagation mechanism.
|
* Designated method to control dirty propagation mechanism.
|
||||||
* Clears (makes not dirty) the shadow view.
|
* Clears (makes not dirty) the shadow view.
|
||||||
* The default implementaion does nothing.
|
* The default implementation does nothing.
|
||||||
*/
|
*/
|
||||||
- (void)clearLayout;
|
- (void)clearLayout;
|
||||||
|
|
||||||
|
|
|
@ -64,12 +64,12 @@
|
||||||
|
|
||||||
- (void)dirtyLayout
|
- (void)dirtyLayout
|
||||||
{
|
{
|
||||||
// The default implementaion does nothing.
|
// The default implementation does nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)clearLayout
|
- (void)clearLayout
|
||||||
{
|
{
|
||||||
// The default implementaion does nothing.
|
// The default implementation does nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -121,7 +121,7 @@ RCT_EXPORT_VIEW_PROPERTY(hasTVPreferredFocus, BOOL)
|
||||||
RCT_EXPORT_VIEW_PROPERTY(tvParallaxProperties, NSDictionary)
|
RCT_EXPORT_VIEW_PROPERTY(tvParallaxProperties, NSDictionary)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Acessibility related properties
|
// Accessibility related properties
|
||||||
RCT_REMAP_VIEW_PROPERTY(accessible, reactAccessibilityElement.isAccessibilityElement, BOOL)
|
RCT_REMAP_VIEW_PROPERTY(accessible, reactAccessibilityElement.isAccessibilityElement, BOOL)
|
||||||
RCT_REMAP_VIEW_PROPERTY(accessibilityActions, reactAccessibilityElement.accessibilityActions, NSDictionaryArray)
|
RCT_REMAP_VIEW_PROPERTY(accessibilityActions, reactAccessibilityElement.accessibilityActions, NSDictionaryArray)
|
||||||
RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString)
|
RCT_REMAP_VIEW_PROPERTY(accessibilityLabel, reactAccessibilityElement.accessibilityLabel, NSString)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
{
|
{
|
||||||
if (layoutMetrics.layoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
|
if (layoutMetrics.layoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
|
||||||
// Motivation:
|
// Motivation:
|
||||||
// Yoga place `contentView` on the right side of `scrollView` when RTL layout is enfoced.
|
// Yoga place `contentView` on the right side of `scrollView` when RTL layout is enforced.
|
||||||
// That breaks everything; it is completely pointless to (re)position `contentView`
|
// That breaks everything; it is completely pointless to (re)position `contentView`
|
||||||
// because it is `contentView`'s job. So, we work around it here.
|
// because it is `contentView`'s job. So, we work around it here.
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||||
[self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
|
[self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
|
||||||
|
|
||||||
if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {
|
if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {
|
||||||
// We intentionaly force `UIScrollView`s `semanticContentAttribute` to `LTR` here
|
// We intentionally force `UIScrollView`s `semanticContentAttribute` to `LTR` here
|
||||||
// because this attribute affects a position of vertical scrollbar; we don't want this
|
// because this attribute affects a position of vertical scrollbar; we don't want this
|
||||||
// scrollbar flip because we also flip it with whole `UIScrollView` flip.
|
// scrollbar flip because we also flip it with whole `UIScrollView` flip.
|
||||||
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
self.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
|
||||||
|
@ -367,7 +367,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||||
{
|
{
|
||||||
[super didMoveToWindow];
|
[super didMoveToWindow];
|
||||||
// ScrollView enables pinch gesture late in its lifecycle. So simply setting it
|
// ScrollView enables pinch gesture late in its lifecycle. So simply setting it
|
||||||
// in the setter gets overriden when the view loads.
|
// in the setter gets overridden when the view loads.
|
||||||
self.pinchGestureRecognizer.enabled = _pinchGestureEnabled;
|
self.pinchGestureRecognizer.enabled = _pinchGestureEnabled;
|
||||||
}
|
}
|
||||||
#endif //TARGET_OS_TV
|
#endif //TARGET_OS_TV
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by the UIIManager to set the view frame.
|
* Used by the UIIManager to set the view frame.
|
||||||
* May be overriden to disable animation, etc.
|
* May be overridden to disable animation, etc.
|
||||||
*/
|
*/
|
||||||
- (void)reactSetFrame:(CGRect)frame;
|
- (void)reactSetFrame:(CGRect)frame;
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
/**
|
/**
|
||||||
* The (sub)view which represents this view in terms of accessibility.
|
* The (sub)view which represents this view in terms of accessibility.
|
||||||
* ViewManager will apply all accessibility properties directly to this view.
|
* ViewManager will apply all accessibility properties directly to this view.
|
||||||
* May be overriten in view subclass which needs to be accessiblitywise
|
* May be overridden in view subclass which needs to be accessiblitywise
|
||||||
* transparent in favour of some subview.
|
* transparent in favour of some subview.
|
||||||
* Defaults to `self`.
|
* Defaults to `self`.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -290,7 +290,7 @@
|
||||||
return UIEdgeInsetsInsetRect(self.bounds, self.reactCompoundInsets);
|
return UIEdgeInsetsInsetRect(self.bounds, self.reactCompoundInsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Accessiblity
|
#pragma mark - Accessibility
|
||||||
|
|
||||||
- (UIView *)reactAccessibilityElement
|
- (UIView *)reactAccessibilityElement
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ import com.facebook.react.module.annotations.ReactModule;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
// This module is being called only by Java via the static method "captureHeap" that
|
// This module is being called only by Java via the static method "captureHeap" that
|
||||||
// requires it to alreay be initialized, thus we eagerly initialize this module
|
// requires it to already be initialized, thus we eagerly initialize this module
|
||||||
@ReactModule(name = "JSCHeapCapture", needsEagerInit = true)
|
@ReactModule(name = "JSCHeapCapture", needsEagerInit = true)
|
||||||
public class JSCHeapCapture extends ReactContextBaseJavaModule {
|
public class JSCHeapCapture extends ReactContextBaseJavaModule {
|
||||||
public interface HeapCapture extends JavaScriptModule {
|
public interface HeapCapture extends JavaScriptModule {
|
||||||
|
|
|
@ -294,7 +294,7 @@ public class ImageEditingManager extends ReactContextBaseJavaModule {
|
||||||
*/
|
*/
|
||||||
private Bitmap crop(BitmapFactory.Options outOptions) throws IOException {
|
private Bitmap crop(BitmapFactory.Options outOptions) throws IOException {
|
||||||
InputStream inputStream = openBitmapInputStream();
|
InputStream inputStream = openBitmapInputStream();
|
||||||
// Effeciently crops image without loading full resolution into memory
|
// Efficiently crops image without loading full resolution into memory
|
||||||
// https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html
|
// https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html
|
||||||
BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(inputStream, false);
|
BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(inputStream, false);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import com.facebook.soloader.SoLoader;
|
||||||
/**
|
/**
|
||||||
* JSCallInvoker is created at a different time/place (i.e: in CatalystInstance) than
|
* JSCallInvoker is created at a different time/place (i.e: in CatalystInstance) than
|
||||||
* TurboModuleManager. Therefore, we need to wrap JSCallInvoker within a hybrid class so that we may
|
* TurboModuleManager. Therefore, we need to wrap JSCallInvoker within a hybrid class so that we may
|
||||||
* pass it from CatalystInstance, through Java, to TurboMoudleManager::initHybrid.
|
* pass it from CatalystInstance, through Java, to TurboModuleManager::initHybrid.
|
||||||
*/
|
*/
|
||||||
public class JSCallInvokerHolderImpl implements JSCallInvokerHolder {
|
public class JSCallInvokerHolderImpl implements JSCallInvokerHolder {
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -9,7 +9,7 @@ package com.facebook.react.turbomodule.core.interfaces;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/** Interface to allow for creating and retrieving TurboModuels. */
|
/** Interface to allow for creating and retrieving TurboModules. */
|
||||||
public interface TurboModuleRegistry {
|
public interface TurboModuleRegistry {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class ReactAccessibilityDelegate extends AccessibilityDelegateCompat {
|
||||||
setRole(info, accessibilityRole, host.getContext());
|
setRole(info, accessibilityRole, host.getContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
// states are changable.
|
// states are changeable.
|
||||||
final ReadableArray accessibilityStates =
|
final ReadableArray accessibilityStates =
|
||||||
(ReadableArray) host.getTag(R.id.accessibility_states);
|
(ReadableArray) host.getTag(R.id.accessibility_states);
|
||||||
final ReadableMap accessibilityState = (ReadableMap) host.getTag(R.id.accessibility_state);
|
final ReadableMap accessibilityState = (ReadableMap) host.getTag(R.id.accessibility_state);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class CustomLineHeightSpan implements LineHeightSpan, ReactSpan {
|
||||||
// Show proportionally additional ascent / top & descent / bottom
|
// Show proportionally additional ascent / top & descent / bottom
|
||||||
final int additional = mHeight - (-fm.top + fm.bottom);
|
final int additional = mHeight - (-fm.top + fm.bottom);
|
||||||
|
|
||||||
// Round up for the negative values and down for the positive values (arbritary choice)
|
// Round up for the negative values and down for the positive values (arbitrary choice)
|
||||||
// So that bottom - top equals additional even if it's an odd number.
|
// So that bottom - top equals additional even if it's an odd number.
|
||||||
fm.top -= Math.ceil(additional / 2.0f);
|
fm.top -= Math.ceil(additional / 2.0f);
|
||||||
fm.bottom += Math.floor(additional / 2.0f);
|
fm.bottom += Math.floor(additional / 2.0f);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* {@link ReactShadowNode} abstract class for spannable text nodes.
|
* {@link ReactShadowNode} abstract class for spannable text nodes.
|
||||||
*
|
*
|
||||||
* <p>This class handles all text attributes assosiated with {@code <Text>}-ish node. A concrete
|
* <p>This class handles all text attributes associated with {@code <Text>}-ish node. A concrete
|
||||||
* node can be an anchor {@code <Text>} node, an anchor {@code <TextInput>} node or virtual {@code
|
* node can be an anchor {@code <Text>} node, an anchor {@code <TextInput>} node or virtual {@code
|
||||||
* <Text>} node inside {@code <Text>} or {@code <TextInput>} node. Or even something else.
|
* <Text>} node inside {@code <Text>} or {@code <TextInput>} node. Or even something else.
|
||||||
*
|
*
|
||||||
|
@ -241,7 +241,7 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
|
||||||
// TODO(5837930): Investigate whether it's worth optimizing this part and do it if so
|
// TODO(5837930): Investigate whether it's worth optimizing this part and do it if so
|
||||||
|
|
||||||
// The {@link SpannableStringBuilder} implementation require setSpan operation to be called
|
// The {@link SpannableStringBuilder} implementation require setSpan operation to be called
|
||||||
// up-to-bottom, otherwise all the spannables that are withing the region for which one may set
|
// up-to-bottom, otherwise all the spannables that are within the region for which one may set
|
||||||
// a new spannable will be wiped out
|
// a new spannable will be wiped out
|
||||||
List<SetSpanOperation> ops = new ArrayList<>();
|
List<SetSpanOperation> ops = new ArrayList<>();
|
||||||
Map<Integer, ReactShadowNode> inlineViews =
|
Map<Integer, ReactShadowNode> inlineViews =
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class TextLayoutManager {
|
||||||
SpannableStringBuilder sb = new SpannableStringBuilder();
|
SpannableStringBuilder sb = new SpannableStringBuilder();
|
||||||
|
|
||||||
// The {@link SpannableStringBuilder} implementation require setSpan operation to be called
|
// The {@link SpannableStringBuilder} implementation require setSpan operation to be called
|
||||||
// up-to-bottom, otherwise all the spannables that are withing the region for which one may set
|
// up-to-bottom, otherwise all the spannables that are within the region for which one may set
|
||||||
// a new spannable will be wiped out
|
// a new spannable will be wiped out
|
||||||
List<SetSpanOperation> ops = new ArrayList<>();
|
List<SetSpanOperation> ops = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class ReactViewManager extends ViewGroupManager<ReactViewGroup> {
|
||||||
view.setOnClickListener(null);
|
view.setOnClickListener(null);
|
||||||
view.setClickable(false);
|
view.setClickable(false);
|
||||||
// Don't set view.setFocusable(false) because we might still want it to be focusable for
|
// Don't set view.setFocusable(false) because we might still want it to be focusable for
|
||||||
// accessibiliy reasons
|
// accessibility reasons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
/** @file CoreClasses.h
|
/** @file CoreClasses.h
|
||||||
*
|
*
|
||||||
* In CoreClasses.h wrappers for the core classes (jobject, jclass, and jstring) is defined
|
* In CoreClasses.h wrappers for the core classes (jobject, jclass, and jstring) is defined
|
||||||
* to provide access to corresponding JNI functions + some conveniance.
|
* to provide access to corresponding JNI functions + some convenience.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "References-forward.h"
|
#include "References-forward.h"
|
||||||
|
|
|
@ -77,7 +77,7 @@ struct JIterable : JavaClass<JIterable<E>> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JavaClass types which represent Collection, List, and Set are also provided.
|
* JavaClass types which represent Collection, List, and Set are also provided.
|
||||||
* These preserve the Java class heirarchy.
|
* These preserve the Java class hierarchy.
|
||||||
*/
|
*/
|
||||||
template <typename E = jobject>
|
template <typename E = jobject>
|
||||||
struct JCollection : JavaClass<JCollection<E>, JIterable<E>> {
|
struct JCollection : JavaClass<JCollection<E>, JIterable<E>> {
|
||||||
|
|
|
@ -1139,7 +1139,7 @@ public class NativeAnimatedNodeTraversalTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testSpringTrackingRetainsSpeed() {
|
public void testSpringTrackingRetainsSpeed() {
|
||||||
// this spring config correspomds to tension 20 and friction 0.5 which makes the spring settle
|
// this spring config corresponds to tension 20 and friction 0.5 which makes the spring settle
|
||||||
// very slowly
|
// very slowly
|
||||||
JavaOnlyMap springConfig =
|
JavaOnlyMap springConfig =
|
||||||
JavaOnlyMap.of(
|
JavaOnlyMap.of(
|
||||||
|
|
|
@ -24,7 +24,7 @@ JSBigFileString::JSBigFileString(int fd, size_t size, off_t offset /*= 0*/)
|
||||||
folly::checkUnixError(m_fd = dup(fd),
|
folly::checkUnixError(m_fd = dup(fd),
|
||||||
"Could not duplicate file descriptor");
|
"Could not duplicate file descriptor");
|
||||||
|
|
||||||
// Offsets given to mmap must be page aligend. We abstract away that
|
// Offsets given to mmap must be page aligned. We abstract away that
|
||||||
// restriction by sending a page aligned offset to mmap, and keeping track
|
// restriction by sending a page aligned offset to mmap, and keeping track
|
||||||
// of the offset within the page that we must alter the mmap pointer by to
|
// of the offset within the page that we must alter the mmap pointer by to
|
||||||
// get the final desired offset.
|
// get the final desired offset.
|
||||||
|
|
|
@ -69,7 +69,7 @@ std::vector<MethodCall> parseMethodCalls(folly::dynamic&& jsonData) {
|
||||||
std::move(params[i]),
|
std::move(params[i]),
|
||||||
callId);
|
callId);
|
||||||
|
|
||||||
// only incremement callid if contains valid callid as callid is optional
|
// only increment callid if contains valid callid as callid is optional
|
||||||
callId += (callId != -1) ? 1 : 0;
|
callId += (callId != -1) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
if (isEndOfBatch) {
|
if (isEndOfBatch) {
|
||||||
// onBatchComplete will be called on the native (module) queue, but
|
// onBatchComplete will be called on the native (module) queue, but
|
||||||
// decrementPendingJSCalls will be called sync. Be aware that the bridge may still
|
// decrementPendingJSCalls will be called sync. Be aware that the bridge may still
|
||||||
// be processing native calls when the birdge idle signaler fires.
|
// be processing native calls when the bridge idle signaler fires.
|
||||||
if (m_batchHadNativeModuleCalls) {
|
if (m_batchHadNativeModuleCalls) {
|
||||||
m_callback->onBatchComplete();
|
m_callback->onBatchComplete();
|
||||||
m_batchHadNativeModuleCalls = false;
|
m_batchHadNativeModuleCalls = false;
|
||||||
|
|
|
@ -225,7 +225,7 @@ YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(
|
||||||
int childIndex) {
|
int childIndex) {
|
||||||
SystraceSection s("YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector");
|
SystraceSection s("YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector");
|
||||||
|
|
||||||
// At this point it is garanteed that all shadow nodes associated with yoga
|
// At this point it is guaranteed that all shadow nodes associated with yoga
|
||||||
// nodes are `YogaLayoutableShadowNode` subclasses.
|
// nodes are `YogaLayoutableShadowNode` subclasses.
|
||||||
auto parentNode =
|
auto parentNode =
|
||||||
static_cast<YogaLayoutableShadowNode *>(parentYogaNode->getContext());
|
static_cast<YogaLayoutableShadowNode *>(parentYogaNode->getContext());
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace react {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Event Beat serves two interleaving purposes: synchronization of event queues
|
* Event Beat serves two interleaving purposes: synchronization of event queues
|
||||||
* and ensuring that event dispatching happens on propper threads.
|
* and ensuring that event dispatching happens on proper threads.
|
||||||
*/
|
*/
|
||||||
class EventBeat {
|
class EventBeat {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -68,7 +68,7 @@ class EventEmitter {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initates an event delivery process.
|
* Initiates an event delivery process.
|
||||||
* Is used by particular subclasses only.
|
* Is used by particular subclasses only.
|
||||||
*/
|
*/
|
||||||
void dispatchEvent(
|
void dispatchEvent(
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Describes results of layout process for partucular shadow node.
|
* Describes results of layout process for particular shadow node.
|
||||||
*/
|
*/
|
||||||
struct LayoutMetrics {
|
struct LayoutMetrics {
|
||||||
Rect frame;
|
Rect frame;
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines visibility of the shadow node and partucular layout
|
* Defines visibility of the shadow node and particular layout
|
||||||
* engine which should be used for laying out the node.
|
* engine which should be used for laying out the node.
|
||||||
*/
|
*/
|
||||||
enum class DisplayType {
|
enum class DisplayType {
|
||||||
|
|
|
@ -37,14 +37,14 @@ class LayoutableShadowNode : public virtual Sealable {
|
||||||
virtual ~LayoutableShadowNode() noexcept = default;
|
virtual ~LayoutableShadowNode() noexcept = default;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Measures the node (and node content, propbably recursivly) with
|
* Measures the node (and node content, probably recursively) with
|
||||||
* given constrains and relying on possible layout.
|
* given constrains and relying on possible layout.
|
||||||
* Default implementation returns zero size.
|
* Default implementation returns zero size.
|
||||||
*/
|
*/
|
||||||
virtual Size measure(LayoutConstraints layoutConstraints) const;
|
virtual Size measure(LayoutConstraints layoutConstraints) const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Computes layout recusively.
|
* Computes layout recursively.
|
||||||
* Additional environmental constraints might be provided via `layoutContext`
|
* Additional environmental constraints might be provided via `layoutContext`
|
||||||
* argument.
|
* argument.
|
||||||
* Default implementation basically calls `layoutChildren()` and then
|
* Default implementation basically calls `layoutChildren()` and then
|
||||||
|
@ -98,7 +98,7 @@ class LayoutableShadowNode : public virtual Sealable {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Applies layout for all children;
|
* Applies layout for all children;
|
||||||
* does not call anything in recusive manner *by desing*.
|
* does not call anything in recursive manner *by desing*.
|
||||||
*/
|
*/
|
||||||
virtual void layoutChildren(LayoutContext layoutContext);
|
virtual void layoutChildren(LayoutContext layoutContext);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace react {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note:
|
* Note:
|
||||||
* We must explictly implement all *the rule of five* methods because:
|
* We must explicitly implement all *the rule of five* methods because:
|
||||||
* 1. Using `std::atomic` behind `sealed_` implicitly deletes default
|
* 1. Using `std::atomic` behind `sealed_` implicitly deletes default
|
||||||
* constructors;
|
* constructors;
|
||||||
* 2. We have to establish behaviour where any new cloned or moved instances
|
* 2. We have to establish behaviour where any new cloned or moved instances
|
||||||
|
|
|
@ -21,7 +21,7 @@ using SharedLocalData = std::shared_ptr<const LocalData>;
|
||||||
/*
|
/*
|
||||||
* Abstract class for any kind of concrete pieces of local data specific for
|
* Abstract class for any kind of concrete pieces of local data specific for
|
||||||
* some kinds of `ShadowNode`s.
|
* some kinds of `ShadowNode`s.
|
||||||
* LocalData might be used to communicate some infomation between `ShadowNode`s
|
* LocalData might be used to communicate some information between `ShadowNode`s
|
||||||
* and native component views.
|
* and native component views.
|
||||||
* All `LocalData` objects *must* be immutable (sealed) when they became
|
* All `LocalData` objects *must* be immutable (sealed) when they became
|
||||||
* a part of the shadow tree.
|
* a part of the shadow tree.
|
||||||
|
|
|
@ -139,7 +139,7 @@ class ShadowNode : public virtual Sealable,
|
||||||
int suggestedIndex = -1);
|
int suggestedIndex = -1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets local data assosiated with the node.
|
* Sets local data associated with the node.
|
||||||
* The node must be unsealed at this point.
|
* The node must be unsealed at this point.
|
||||||
*/
|
*/
|
||||||
void setLocalData(const SharedLocalData &localData);
|
void setLocalData(const SharedLocalData &localData);
|
||||||
|
|
|
@ -34,8 +34,8 @@ class ShadowNodeFamily {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the parent.
|
* Sets the parent.
|
||||||
* This is not techically thread-safe, but practically it mutates the object
|
* This is not technically thread-safe, but practically it mutates the object
|
||||||
* only once (and the model enforces that this first call is not concurent).
|
* only once (and the model enforces that this first call is not concurrent).
|
||||||
*/
|
*/
|
||||||
void setParent(ShadowNodeFamily::Shared const &parent) const;
|
void setParent(ShadowNodeFamily::Shared const &parent) const;
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class DebugStringConvertible {
|
||||||
// Default implementation returns "Node".
|
// Default implementation returns "Node".
|
||||||
virtual std::string getDebugName() const;
|
virtual std::string getDebugName() const;
|
||||||
|
|
||||||
// Returns a value assosiate with the object.
|
// Returns a value associate with the object.
|
||||||
// Default implementation returns an empty string.
|
// Default implementation returns an empty string.
|
||||||
virtual std::string getDebugValue() const;
|
virtual std::string getDebugValue() const;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ std::string toString(void const *value);
|
||||||
* - `getDebugName`: Returns a name of the object. Default implementation
|
* - `getDebugName`: Returns a name of the object. Default implementation
|
||||||
* returns "Node".
|
* returns "Node".
|
||||||
*
|
*
|
||||||
* - `getDebugValue`: Returns a value assosiate with the object. Default
|
* - `getDebugValue`: Returns a value associate with the object. Default
|
||||||
* implementation returns an empty string.
|
* implementation returns an empty string.
|
||||||
*
|
*
|
||||||
* - `getDebugChildren`: Returns a list of `DebugStringConvertible`-compatible
|
* - `getDebugChildren`: Returns a list of `DebugStringConvertible`-compatible
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct Transform {
|
||||||
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}};
|
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returs the identity transform (`[1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`).
|
* Returns the identity transform (`[1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`).
|
||||||
*/
|
*/
|
||||||
static Transform Identity();
|
static Transform Identity();
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class ImageRequest final {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*
|
/*
|
||||||
* Image source assosiated with the request.
|
* Image source associated with the request.
|
||||||
*/
|
*/
|
||||||
ImageSource imageSource_;
|
ImageSource imageSource_;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Represents retrieved image bitmap and any assotiated platform-specific info.
|
* Represents retrieved image bitmap and any associated platform-specific info.
|
||||||
*/
|
*/
|
||||||
class ImageResponse final {
|
class ImageResponse final {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace react {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MapBuffer is an optimized map format for transferring data like props between
|
* MapBuffer is an optimized map format for transferring data like props between
|
||||||
* C++ and other platforms The implemenation of this map is optimized to:
|
* C++ and other platforms The implementation of this map is optimized to:
|
||||||
* - be compact to optimize space when sparse (sparse is the common case).
|
* - be compact to optimize space when sparse (sparse is the common case).
|
||||||
* - be accessible through JNI with zero/minimal copying via ByteBuffer.
|
* - be accessible through JNI with zero/minimal copying via ByteBuffer.
|
||||||
* - be Have excellent C++ single-write and many-read performance by maximizing
|
* - be Have excellent C++ single-write and many-read performance by maximizing
|
||||||
|
|
|
@ -143,7 +143,7 @@ static void calculateShadowViewMutations(
|
||||||
ShadowView const &parentShadowView,
|
ShadowView const &parentShadowView,
|
||||||
ShadowViewNodePair::List const &oldChildPairs,
|
ShadowViewNodePair::List const &oldChildPairs,
|
||||||
ShadowViewNodePair::List const &newChildPairs) {
|
ShadowViewNodePair::List const &newChildPairs) {
|
||||||
// The current version of the algorithm is otimized for simplicity,
|
// The current version of the algorithm is optimized for simplicity,
|
||||||
// not for performance or optimal result.
|
// not for performance or optimal result.
|
||||||
|
|
||||||
if (oldChildPairs == newChildPairs) {
|
if (oldChildPairs == newChildPairs) {
|
||||||
|
|
|
@ -101,7 +101,7 @@ static std::string componentNameByReactViewName(std::string viewName) {
|
||||||
return "ActivityIndicatorView";
|
return "ActivityIndicatorView";
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need this temporarly for testing purposes until we have proper
|
// We need this temporarily for testing purposes until we have proper
|
||||||
// implementation of core components.
|
// implementation of core components.
|
||||||
if (viewName == "SinglelineTextInputView" ||
|
if (viewName == "SinglelineTextInputView" ||
|
||||||
viewName == "MultilineTextInputView" || viewName == "AndroidTextInput" ||
|
viewName == "MultilineTextInputView" || viewName == "AndroidTextInput" ||
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace react {
|
||||||
class UIManagerBinding : public jsi::HostObject {
|
class UIManagerBinding : public jsi::HostObject {
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
* Installs UIManagerBinding into JavaSctipt runtime.
|
* Installs UIManagerBinding into JavaScript runtime.
|
||||||
* Thread synchronization must be enforced externally.
|
* Thread synchronization must be enforced externally.
|
||||||
*/
|
*/
|
||||||
static void install(
|
static void install(
|
||||||
|
|
|
@ -789,7 +789,7 @@ jsi::Object JSCRuntime::createObject(std::shared_ptr<jsi::HostObject> ho) {
|
||||||
|
|
||||||
std::shared_ptr<jsi::HostObject> JSCRuntime::getHostObject(
|
std::shared_ptr<jsi::HostObject> JSCRuntime::getHostObject(
|
||||||
const jsi::Object& obj) {
|
const jsi::Object& obj) {
|
||||||
// We are guarenteed at this point to have isHostObject(obj) == true
|
// We are guaranteed at this point to have isHostObject(obj) == true
|
||||||
// so the private data should be HostObjectMetadata
|
// so the private data should be HostObjectMetadata
|
||||||
JSObjectRef object = objectRef(obj);
|
JSObjectRef object = objectRef(obj);
|
||||||
auto metadata =
|
auto metadata =
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче