-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Conversation
Summary: Enable the `prettier-plugin-hermes-parser` in xplat. This plugin enables the use of `hermes-parser` which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D46748891 fbshipit-source-id: e162e498bb5a7c2855bfe2e0151694d8518213c4
This pull request was exported from Phabricator. Differential Revision: D46748891 |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js line 249 – Replace
⏎····nextHeaderLayoutY,⏎····measured,⏎····layoutHeight,⏎····layoutY,⏎····scrollViewHeight,⏎····scrollAnimatedValue,⏎····inverted,⏎····offset,⏎····animatedValueListener,⏎····isFabric,⏎··
withnextHeaderLayoutY,·measured,·layoutHeight,·layoutY,·scrollViewHeight,·scrollAnimatedValue,·inverted,·offset,·animatedValueListener,·isFabric
(prettier/prettier)
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js line 25 – Delete
⏎····
(prettier/prettier)
'GeneratorFunction'); | ||
hasNativeGenerator = hasNativeConstructor( | ||
function* () {}, | ||
'GeneratorFunction', |
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.
- 🚫 packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js line 27 – Replace
····'GeneratorFunction',⏎··
with··'GeneratorFunction'
(prettier/prettier)
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js line 91 – Replace
)[level]
with[level])
(prettier/prettier)
)} 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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/cli.js line 59 – Insert
······
(prettier/prettier)
'event should have the right type', | ||
); | ||
assert_equals( | ||
isPrimary, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 78 – Delete
··
(prettier/prettier)
); | ||
assert_equals( | ||
isPrimary, | ||
expectedIsPrimary, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 79 – Delete
··
(prettier/prettier)
assert_equals( | ||
isPrimary, | ||
expectedIsPrimary, | ||
'event should be correctly primary', |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 80 – Delete
··
(prettier/prettier)
isPrimary, | ||
expectedIsPrimary, | ||
'event should be correctly primary', | ||
); |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 81 – Delete
··
(prettier/prettier)
expectedIsPrimary, | ||
'event should be correctly primary', | ||
); | ||
}, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 82 – Replace
··},⏎········
${expectedBoxLabel}·box's·${expectedEventType}·should${⏎··········!expectedIsPrimary·?·'·not'·:·''⏎········}·be·marked·as·the·primary·pointer,⏎······
with},·
${expectedBoxLabel}·box's·${expectedEventType}·should${!expectedIsPrimary·?·'·not'·:·''}·be·marked·as·the·primary·pointer`` (prettier/prettier)
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js line 249 – Replace
⏎····nextHeaderLayoutY,⏎····measured,⏎····layoutHeight,⏎····layoutY,⏎····scrollViewHeight,⏎····scrollAnimatedValue,⏎····inverted,⏎····offset,⏎····animatedValueListener,⏎····isFabric,⏎··
withnextHeaderLayoutY,·measured,·layoutHeight,·layoutY,·scrollViewHeight,·scrollAnimatedValue,·inverted,·offset,·animatedValueListener,·isFabric
(prettier/prettier)
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js line 25 – Delete
⏎····
(prettier/prettier)
'GeneratorFunction'); | ||
hasNativeGenerator = hasNativeConstructor( | ||
function* () {}, | ||
'GeneratorFunction', |
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.
- 🚫 packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js line 27 – Replace
····'GeneratorFunction',⏎··
with··'GeneratorFunction'
(prettier/prettier)
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js line 91 – Replace
)[level]
with[level])
(prettier/prettier)
)} 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 comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 packages/react-native/cli.js line 59 – Insert
······
(prettier/prettier)
'event should have the right type', | ||
); | ||
assert_equals( | ||
isPrimary, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 78 – Delete
··
(prettier/prettier)
); | ||
assert_equals( | ||
isPrimary, | ||
expectedIsPrimary, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 79 – Delete
··
(prettier/prettier)
assert_equals( | ||
isPrimary, | ||
expectedIsPrimary, | ||
'event should be correctly primary', |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 80 – Delete
··
(prettier/prettier)
isPrimary, | ||
expectedIsPrimary, | ||
'event should be correctly primary', | ||
); |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 81 – Delete
··
(prettier/prettier)
expectedIsPrimary, | ||
'event should be correctly primary', | ||
); | ||
}, |
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.
- 🚫 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js line 82 – Replace
··},⏎········
${expectedBoxLabel}·box's·${expectedEventType}·should${⏎··········!expectedIsPrimary·?·'·not'·:·''⏎········}·be·marked·as·the·primary·pointer,⏎······
with},·
${expectedBoxLabel}·box's·${expectedEventType}·should${!expectedIsPrimary·?·'·not'·:·''}·be·marked·as·the·primary·pointer`` (prettier/prettier)
This pull request was successfully merged by @pieterv in dc2037c. When will my fix make it into a release? | Upcoming Releases |
Base commit: 54a5ff9 |
Summary: X-link: facebook/react-native#37915 Enable the `prettier-plugin-hermes-parser` in xplat. This plugin enables the use of `hermes-parser` which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D46748891 fbshipit-source-id: 3775ef9afa7c04e565fa4fcf8ca5b410f49d35a1
* main: (135 commits) translation auto-update for i18n/twilight.config.json on master Interop: Introduce Bridge proxy Remove okhttp internal util usage (facebook#37843) Update debian to fix CI while updating Node (facebook#37841) fix: foreground ripple crash on api < 23 (facebook#37901) Re-add the top level LICENSE file (facebook#37916) Deploy 0.209.0 to xplat (facebook#37921) Re-enable direct debugging with JSC on iOS 16.4+ (facebook#37914) add emitObjectProp in parser primitives (facebook#37904) Make React-utils its own pod (facebook#37659) feat: allow custom assignment of rootView to rootViewController (facebook#37873) Switch xplat prettier config to hermes plugin (facebook#37915) Set iOS AppState to inactive when app is launching (facebook#37690) Use `fileExists` in replace_hermes script (facebook#37911) (docs): fix license url (facebook#37909) Revert D46719890: Re-enable direct debugging with JSC on iOS 16.4+ Re-enable direct debugging with JSC on iOS 16.4+ (facebook#37874) Fix component type references in xplat (facebook#37903) Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader (facebook#37867) test runtime lifecycle callback (facebook#37897) ...
Summary:
Enable the
prettier-plugin-hermes-parser
in xplat. This plugin enables the use ofhermes-parser
which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax.Changelog: [Internal]
Reviewed By: SamChou19815
Differential Revision: D46748891