-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch xplat prettier config to hermes plugin #37915
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,7 +246,18 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent< | |
clearTimeout(_timer.current); | ||
} | ||
}; | ||
}, [nextHeaderLayoutY, measured, layoutHeight, layoutY, scrollViewHeight, scrollAnimatedValue, inverted, offset, animatedValueListener, isFabric]); | ||
}, [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
nextHeaderLayoutY, | ||
measured, | ||
layoutHeight, | ||
layoutY, | ||
scrollViewHeight, | ||
scrollAnimatedValue, | ||
inverted, | ||
offset, | ||
animatedValueListener, | ||
isFabric, | ||
]); | ||
|
||
const _onLayout = (event: LayoutEvent) => { | ||
setLayoutY(event.nativeEvent.layout.y); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,10 @@ let hasNativeGenerator; | |
try { | ||
// If this function was lowered by regenerator-transform, it will try to | ||
// access `global.regeneratorRuntime` which doesn't exist yet and will throw. | ||
hasNativeGenerator = hasNativeConstructor(function* () {}, | ||
'GeneratorFunction'); | ||
hasNativeGenerator = hasNativeConstructor( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
function* () {}, | ||
'GeneratorFunction', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
} catch { | ||
// In this case, we know generators are not provided natively. | ||
hasNativeGenerator = false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ const backgroundForLevel = (level: LogLevel) => | |
default: 'transparent', | ||
pressed: LogBoxStyle.getFatalDarkColor(), | ||
}, | ||
}[level]); | ||
})[level]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
function LogBoxInspectorHeaderButton( | ||
props: $ReadOnly<{| | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,10 +56,10 @@ async function main() { | |
if (latest !== currentVersion) { | ||
const msg = ` | ||
${chalk.bold.yellow('WARNING:')} You should run ${chalk.white.bold( | ||
'npx react-native@latest', | ||
)} to ensure you're always using the most current version of the CLI. NPX has cached version (${chalk.bold.yellow( | ||
currentVersion, | ||
)}) != current release (${chalk.bold.green(latest)}) | ||
'npx react-native@latest', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
)} to ensure you're always using the most current version of the CLI. NPX has cached version (${chalk.bold.yellow( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
currentVersion, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
)}) != current release (${chalk.bold.green(latest)}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
`; | ||
console.warn(msg); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,13 +67,16 @@ function PointerEventAttributesHoverablePointersTestCase( | |
testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType; | ||
|
||
detected_pointertypes[event.nativeEvent.pointerType] = true; | ||
harness.test(({assert_equals}) => { | ||
assert_equals( | ||
eventType, | ||
expectedEventType, | ||
'Event.type should be ' + expectedEventType, | ||
); | ||
}, pointerTestName + "'s type should be " + expectedEventType); | ||
harness.test( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
({assert_equals}) => { | ||
assert_equals( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
eventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expectedEventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'Event.type should be ' + expectedEventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
pointerTestName + "'s type should be " + expectedEventType, | ||
); | ||
|
||
// Test button and buttons | ||
if (eventType === 'pointerdown') { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,13 +66,16 @@ function PointerEventAttributesNoHoverPointersTestCase( | |
testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType; | ||
|
||
detected_pointertypes[event.nativeEvent.pointerType] = true; | ||
harness.test(({assert_equals}) => { | ||
assert_equals( | ||
eventType, | ||
expectedEventType, | ||
'Event.type should be ' + expectedEventType, | ||
); | ||
}, pointerTestName + "'s type should be " + expectedEventType); | ||
harness.test( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
({assert_equals}) => { | ||
assert_equals( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
eventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expectedEventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'Event.type should be ' + expectedEventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
pointerTestName + "'s type should be " + expectedEventType, | ||
); | ||
|
||
// Test button and buttons | ||
harness.test(({assert_equals}) => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,23 +62,28 @@ function PointerEventPrimaryTouchPointerTestCase( | |
expectedOrder[Object.keys(detected_events).length]; | ||
detected_events[pointerEventIdentifier] = true; | ||
|
||
harness.test(({assert_equals}) => { | ||
assert_equals( | ||
boxLabel, | ||
expectedBoxLabel, | ||
'event should be coming from the correct box', | ||
); | ||
assert_equals( | ||
eventType, | ||
expectedEventType.toLowerCase(), | ||
'event should have the right type', | ||
); | ||
assert_equals( | ||
isPrimary, | ||
expectedIsPrimary, | ||
'event should be correctly primary', | ||
); | ||
}, `${expectedBoxLabel} box's ${expectedEventType} should${!expectedIsPrimary ? ' not' : ''} be marked as the primary pointer`); | ||
harness.test( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
({assert_equals}) => { | ||
assert_equals( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
boxLabel, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expectedBoxLabel, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'event should be coming from the correct box', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert_equals( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
eventType, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expectedEventType.toLowerCase(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'event should have the right type', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert_equals( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
isPrimary, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
expectedIsPrimary, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'event should be correctly primary', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
`${expectedBoxLabel} box's ${expectedEventType} should${ | ||
!expectedIsPrimary ? ' not' : '' | ||
} be marked as the primary pointer`, | ||
); | ||
}, | ||
[harness], | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏎····nextHeaderLayoutY,⏎····measured,⏎····layoutHeight,⏎····layoutY,⏎····scrollViewHeight,⏎····scrollAnimatedValue,⏎····inverted,⏎····offset,⏎····animatedValueListener,⏎····isFabric,⏎··
withnextHeaderLayoutY,·measured,·layoutHeight,·layoutY,·scrollViewHeight,·scrollAnimatedValue,·inverted,·offset,·animatedValueListener,·isFabric
(prettier/prettier)