Update hermes-parser and related packages in fbsource to 0.20.0

Summary:
Bump hermes-parser and related packages to [0.20.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: alexmckenley

Differential Revision: D54368487

fbshipit-source-id: a5a05f1e499ff5d8bda4649433bd285f7215d3da
This commit is contained in:
Sam Zhou
2024-02-29 14:19:29 -08:00
committed by Facebook GitHub Bot
parent 67b9628af5
commit 2053364e5a
25 changed files with 121 additions and 125 deletions
+4 -4
View File
@@ -87,11 +87,11 @@
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.19.2",
"flow-api-translator": "0.20.0",
"flow-bin": "^0.229.2",
"glob": "^7.1.1",
"hermes-eslint": "0.19.2",
"hermes-transform": "0.19.2",
"hermes-eslint": "0.20.0",
"hermes-transform": "0.20.0",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
@@ -104,7 +104,7 @@
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.19.2",
"prettier-plugin-hermes-parser": "0.20.0",
"react": "18.2.0",
"react-test-renderer": "18.2.0",
"rimraf": "^3.0.2",
@@ -194,8 +194,8 @@ class RefProperty extends Property {
return this.cyclical
? `{nullptr, deleter<${fullCppType}>}`
: this.optional
? ''
: '{}';
? ''
: '{}';
}
}
@@ -17,7 +17,7 @@
"dependencies": {
"@babel/core": "^7.20.0",
"@react-native/babel-preset": "0.74.0",
"hermes-parser": "0.19.2",
"hermes-parser": "0.20.0",
"nullthrows": "^1.1.1"
},
"peerDependencies": {
+2 -2
View File
@@ -31,7 +31,7 @@
"dependencies": {
"@babel/parser": "^7.20.0",
"glob": "^7.1.1",
"hermes-parser": "0.19.2",
"hermes-parser": "0.20.0",
"invariant": "^2.2.4",
"jscodeshift": "^0.14.0",
"mkdirp": "^0.5.1",
@@ -49,7 +49,7 @@
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"chalk": "^4.0.0",
"hermes-estree": "0.19.2",
"hermes-estree": "0.20.0",
"micromatch": "^4.0.4",
"prettier": "2.8.8",
"rimraf": "^3.0.2",
@@ -1158,8 +1158,8 @@ function InternalTextInput(props: Props): React.Node {
typeof props.value === 'string'
? props.value
: typeof props.defaultValue === 'string'
? props.defaultValue
: '';
? props.defaultValue
: '';
// This is necessary in case native updates the text and JS decides
// that the update should be ignored and we should stick with the value
@@ -1736,12 +1736,12 @@ const ExportedForwardRef: React.AbstractComponent<
textContentType != null
? textContentType
: Platform.OS === 'ios' &&
autoComplete &&
autoComplete in autoCompleteWebToTextContentTypeMap
? // $FlowFixMe[invalid-computed-prop]
// $FlowFixMe[prop-missing]
autoCompleteWebToTextContentTypeMap[autoComplete]
: textContentType
autoComplete &&
autoComplete in autoCompleteWebToTextContentTypeMap
? // $FlowFixMe[invalid-computed-prop]
// $FlowFixMe[prop-missing]
autoCompleteWebToTextContentTypeMap[autoComplete]
: textContentType
}
{...restProps}
forwardedRef={forwardedRef}
@@ -40,8 +40,8 @@ const extractSingleTouch = (nativeEvent: {
return !hasTouches && hasChangedTouches
? changedTouches[0]
: hasTouches
? touches[0]
: nativeEvent;
? touches[0]
: nativeEvent;
};
/**
@@ -47,11 +47,11 @@ function parseErrorStack(errorStack?: string): Array<StackFrame> {
const parsedStack = Array.isArray(errorStack)
? errorStack
: global.HermesInternal
? convertHermesStack(parseHermesStack(errorStack))
: stacktraceParser.parse(errorStack).map((frame): StackFrame => ({
...frame,
column: frame.column != null ? frame.column - 1 : null,
}));
? convertHermesStack(parseHermesStack(errorStack))
: stacktraceParser.parse(errorStack).map((frame): StackFrame => ({
...frame,
column: frame.column != null ? frame.column - 1 : null,
}));
return parsedStack;
}
@@ -88,25 +88,25 @@ function parseLine(line: string): ?HermesStackEntry {
asFrame[2] === 'native'
? {type: 'NATIVE'}
: asFrame[3] === 'address at '
? isInternalBytecodeSourceUrl(asFrame[4])
? {
type: 'INTERNAL_BYTECODE',
sourceUrl: asFrame[4],
line1Based: Number.parseInt(asFrame[5], 10),
virtualOffset0Based: Number.parseInt(asFrame[6], 10),
}
? isInternalBytecodeSourceUrl(asFrame[4])
? {
type: 'INTERNAL_BYTECODE',
sourceUrl: asFrame[4],
line1Based: Number.parseInt(asFrame[5], 10),
virtualOffset0Based: Number.parseInt(asFrame[6], 10),
}
: {
type: 'BYTECODE',
sourceUrl: asFrame[4],
line1Based: Number.parseInt(asFrame[5], 10),
virtualOffset0Based: Number.parseInt(asFrame[6], 10),
}
: {
type: 'BYTECODE',
type: 'SOURCE',
sourceUrl: asFrame[4],
line1Based: Number.parseInt(asFrame[5], 10),
virtualOffset0Based: Number.parseInt(asFrame[6], 10),
}
: {
type: 'SOURCE',
sourceUrl: asFrame[4],
line1Based: Number.parseInt(asFrame[5], 10),
column1Based: Number.parseInt(asFrame[6], 10),
},
column1Based: Number.parseInt(asFrame[6], 10),
},
};
}
const asSkipped = line.match(RE_SKIPPED);
@@ -48,10 +48,10 @@ const TouchHistoryMath = {
ofCurrent && isXAxis
? oneTouchData.currentPageX
: ofCurrent && !isXAxis
? oneTouchData.currentPageY
: !ofCurrent && isXAxis
? oneTouchData.previousPageX
: oneTouchData.previousPageY;
? oneTouchData.currentPageY
: !ofCurrent && isXAxis
? oneTouchData.previousPageX
: oneTouchData.previousPageY;
count = 1;
}
} else {
@@ -77,8 +77,8 @@ function getNativeComponentAttributes(uiViewClassName: string): any {
? true
: {process}
: process == null
? {diff}
: {diff, process};
? {diff}
: {diff, process};
}
// Unfortunately, the current setup declares style properties as top-level
@@ -918,5 +918,5 @@ export type ____FlattenStyleProp_Internal<
> = TStyleProp extends null | void | false | ''
? empty
: TStyleProp extends $ReadOnlyArray<infer V>
? ____FlattenStyleProp_Internal<V>
: TStyleProp;
? ____FlattenStyleProp_Internal<V>
: TStyleProp;
@@ -78,10 +78,10 @@ const Platform: PlatformType = {
? // $FlowFixMe[incompatible-return]
spec.android
: 'native' in spec
? // $FlowFixMe[incompatible-return]
spec.native
: // $FlowFixMe[incompatible-return]
spec.default,
? // $FlowFixMe[incompatible-return]
spec.native
: // $FlowFixMe[incompatible-return]
spec.default,
};
module.exports = Platform;
@@ -7750,8 +7750,8 @@ export type ____FlattenStyleProp_Internal<
> = TStyleProp extends null | void | false | \\"\\"
? empty
: TStyleProp extends $ReadOnlyArray<infer V>
? ____FlattenStyleProp_Internal<V>
: TStyleProp;
? ____FlattenStyleProp_Internal<V>
: TStyleProp;
"
`;
@@ -151,9 +151,8 @@ export default class ReadOnlyElement extends ReadOnlyNode {
const node = getShadowNode(this);
if (node != null) {
const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition(
node,
);
const scrollPosition =
nullthrows(getFabricUIManager()).getScrollPosition(node);
if (scrollPosition != null) {
return scrollPosition[0];
}
@@ -166,9 +165,8 @@ export default class ReadOnlyElement extends ReadOnlyNode {
const node = getShadowNode(this);
if (node != null) {
const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition(
node,
);
const scrollPosition =
nullthrows(getFabricUIManager()).getScrollPosition(node);
if (scrollPosition != null) {
return scrollPosition[1];
}
@@ -125,9 +125,8 @@ export default class ReadOnlyNode {
return null;
}
const parentInstanceHandle = nullthrows(getFabricUIManager()).getParentNode(
shadowNode,
);
const parentInstanceHandle =
nullthrows(getFabricUIManager()).getParentNode(shadowNode);
if (parentInstanceHandle == null) {
return null;
@@ -323,9 +322,8 @@ export function getChildNodes(
return [];
}
const childNodeInstanceHandles = nullthrows(
getFabricUIManager(),
).getChildNodes(shadowNode);
const childNodeInstanceHandles =
nullthrows(getFabricUIManager()).getChildNodes(shadowNode);
return childNodeInstanceHandles
.map(instanceHandle =>
getPublicInstanceFromInternalInstanceHandle(instanceHandle),
+2 -2
View File
@@ -217,8 +217,8 @@ const RNTesterApp = ({
activeModuleTitle != null
? activeModuleTitle
: screen === Screens.COMPONENTS
? 'Components'
: 'APIs';
? 'Components'
: 'APIs';
const activeExampleList =
screen === Screens.COMPONENTS ? examplesList.components : examplesList.apis;
@@ -645,8 +645,8 @@ class NestedCheckBox extends React.Component<
checkbox2 && this.state.checkbox3
? true
: checkbox2 || this.state.checkbox3
? 'mixed'
: false,
? 'mixed'
: false,
});
};
@@ -659,8 +659,8 @@ class NestedCheckBox extends React.Component<
this.state.checkbox2 && checkbox3
? true
: this.state.checkbox2 || checkbox3
? 'mixed'
: false,
? 'mixed'
: false,
});
};
@@ -680,8 +680,8 @@ class NestedCheckBox extends React.Component<
this.state.checkbox1 === 'mixed'
? mixedCheckboxImageSource
: this.state.checkbox1
? checkImageSource
: uncheckImageSource
? checkImageSource
: uncheckImageSource
}
/>
<Text>Meat</Text>
@@ -84,8 +84,8 @@ function PerfExampleWrapper(props: {
{loadExample === SHOW_BAD_EXAMPLE
? badExampleContents
: loadExample === SHOW_GOOD_EXAMPLE
? goodExampleContents
: null}
? goodExampleContents
: null}
</View>
</View>
</RNTesterPage>
@@ -297,8 +297,8 @@ function VariantColorsExample() {
Platform.OS === 'ios'
? DynamicColorIOS({light: 'red', dark: 'blue'})
: Platform.OS === 'android'
? PlatformColor('?attr/colorAccent')
: 'red',
? PlatformColor('?attr/colorAccent')
: 'red',
}}
/>
</View>
@@ -244,8 +244,8 @@ function PressableNativeMethods() {
{status == null
? 'Missing Ref!'
: status === true
? 'Native Methods Exist'
: 'Native Methods Missing!'}
? 'Native Methods Exist'
: 'Native Methods Missing!'}
</Text>
</View>
</>
@@ -321,8 +321,8 @@ function TouchableNativeMethodChecker<
{status == null
? 'Missing Ref!'
: status === true
? 'Native Methods Exist'
: 'Native Methods Missing!'}
? 'Native Methods Exist'
: 'Native Methods Missing!'}
</Text>
</View>
);
@@ -203,8 +203,8 @@ export default class CellRenderer<ItemT> extends React.Component<
? [styles.rowReverse, inversionStyle]
: [styles.columnReverse, inversionStyle]
: horizontal
? [styles.row, inversionStyle]
: inversionStyle;
? [styles.row, inversionStyle]
: inversionStyle;
const result = !CellRendererComponent ? (
<View
style={cellStyle}
+2 -2
View File
@@ -115,8 +115,8 @@ function getNpmInfo(buildType /*: BuildType */) /*: NpmInfo */ {
prerelease != null
? 'next'
: isLatest === true
? 'latest'
: releaseBranchTag;
? 'latest'
: releaseBranchTag;
return {
version,
@@ -68,8 +68,8 @@ async function main() {
const buildType = isDryRun
? 'dry-run'
: isReleaseBranch(branch)
? 'release'
: 'nightly';
? 'release'
: 'nightly';
failIfTagExists(releaseVersion, buildType);
+37 -37
View File
@@ -5137,18 +5137,18 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561"
integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==
flow-api-translator@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/flow-api-translator/-/flow-api-translator-0.19.2.tgz#487a3fc43291c5dc470b5179c87af96c9678672e"
integrity sha512-omizG6riYa2c7XggF01/bQZzDw5bV9+5Nqw0WKfihWMOq08/smCSPY0D0w9s11cu5UFiG9GcvDqSFq5faTBC4Q==
flow-api-translator@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/flow-api-translator/-/flow-api-translator-0.20.0.tgz#43f8efed80da1c01f52f96c224fbbce9477792a7"
integrity sha512-51Fvqnn1VFA98guXk4R39TTz1SCVP3A/pIldXqgXcwW4OGGBK9XFwo73TdE0+rYxqRHVg0HWpM7IaRvDrWPiJw==
dependencies:
"@babel/code-frame" "^7.16.0"
"@typescript-eslint/visitor-keys" "^5.42.0"
flow-enums-runtime "^0.0.6"
hermes-eslint "0.19.2"
hermes-estree "0.19.2"
hermes-parser "0.19.2"
hermes-transform "0.19.2"
hermes-eslint "0.20.0"
hermes-estree "0.20.0"
hermes-parser "0.20.0"
hermes-transform "0.20.0"
flow-bin@^0.229.2:
version "0.229.2"
@@ -5537,14 +5537,14 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
hermes-eslint@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.19.2.tgz#22e98faf2fff42c3b0aeb803fc811f54e6695a62"
integrity sha512-k0U/fZuIOLMIUA1qERpm0HTsNsyPQFodvQRdVcy3BAI4dqgFHOXXP9UisENr5tlu8rApIrZQrRUvWsJ+QD/Z2Q==
hermes-eslint@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.20.0.tgz#b34f6ced2134423b05d394794b34a57c47290476"
integrity sha512-XVNfDSsU/mgbEkhv1afIIrzi131tou1N/paq7PhbExXM/XEzcLKRgrV4l61ODy8moK3tfiZ9WLb6A0pDuwaCNA==
dependencies:
esrecurse "^4.3.0"
hermes-estree "0.19.2"
hermes-parser "0.19.2"
hermes-estree "0.20.0"
hermes-parser "0.20.0"
hermes-estree@0.17.0:
version "0.17.0"
@@ -5556,10 +5556,10 @@ hermes-estree@0.18.2:
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.18.2.tgz#fd450fa1659cf074ceaa2ddeeb21674f3b2342f3"
integrity sha512-KoLsoWXJ5o81nit1wSyEZnWUGy9cBna9iYMZBR7skKh7okYAYKqQ9/OczwpMHn/cH0hKDyblulGsJ7FknlfVxQ==
hermes-estree@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.19.2.tgz#b35f59c7fa184ac63a049a9ad37b370c5151bd20"
integrity sha512-dMDmDgaW9LXQxGOQ+gsAZUlXiPXkHvUrpKESCPhkm3pH0SjHy5uaBaT8psxmPol1EBh8GVM2lGC/W0bhuW/fpQ==
hermes-estree@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.20.0.tgz#f8d7be10495274bfeb02c8b43d511a5ace19f7e7"
integrity sha512-TbBq98tclEfJE3NatmWtSMk51RXKvvBlaJqm/XVsJlP5mkXNrDx5FUTCoN221/cyQ4PcoJw/aRELbi0QeAw6Bg==
hermes-parser@0.17.0:
version "0.17.0"
@@ -5575,12 +5575,12 @@ hermes-parser@0.18.2:
dependencies:
hermes-estree "0.18.2"
hermes-parser@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.19.2.tgz#67b0fd92f4d7a374234f58c4f980f816734a7695"
integrity sha512-FxPcupAYzTks42tx8c29UGW59BbZQ67aKKS4jFi0eiD8Q3US3O8raxfNx0yi0ha0dTCq1WXK2MlJv+RCjkVp3Q==
hermes-parser@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.20.0.tgz#71fe1130a2bb12bec1091b3fedc5301b8745bb26"
integrity sha512-vYTT4KeXAa6WmolPl++QLvcBi86ao5i9jJ4JCLX5s1c9eC1Xf/9AY/RUlKl9KY66Sg2uyuHE9A5BqbUT+hbbaA==
dependencies:
hermes-estree "0.19.2"
hermes-estree "0.20.0"
hermes-profile-transformer@^0.0.6:
version "0.0.6"
@@ -5589,17 +5589,17 @@ hermes-profile-transformer@^0.0.6:
dependencies:
source-map "^0.7.3"
hermes-transform@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/hermes-transform/-/hermes-transform-0.19.2.tgz#51d5f10940d6253468e574cc54f0874735e4b14f"
integrity sha512-PyVw66yepLKKdTY/9PqRWz4YvbqL/57Y+jz9m3jd7qAJp+ZJWfj5MyVUWQPlqk00/lz57ATqzxB/tpx6stZe7w==
hermes-transform@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/hermes-transform/-/hermes-transform-0.20.0.tgz#b5879e982e6a64606ab6e9287842156ea07bd872"
integrity sha512-Q1dqaXJvJP6NAzek3z0bmK24M+Vn2jXsXIk+nau/PJQeH0Z5SwjcTUsZUOELdcMzBjtYG3xbM/pGMcg2/eMjCQ==
dependencies:
"@babel/code-frame" "^7.16.0"
esquery "^1.4.0"
flow-enums-runtime "^0.0.6"
hermes-eslint "0.19.2"
hermes-estree "0.19.2"
hermes-parser "0.19.2"
hermes-eslint "0.20.0"
hermes-estree "0.20.0"
hermes-parser "0.20.0"
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
version "1.0.3"
@@ -7878,14 +7878,14 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"
prettier-plugin-hermes-parser@0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.19.2.tgz#b64f663fef949504dfc01cab0413555a2a1bb2cf"
integrity sha512-F45GldmOTHlVBNmD7noHmKxyzZvkevJ7M1cAQfWU4qUUoPZpaCuKXE3IncG+X01dw1nhq0Fq0Pmj3el8BcqWhA==
prettier-plugin-hermes-parser@0.20.0:
version "0.20.0"
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.20.0.tgz#32a7b46901fd8c93aabffb93f2cec8ae7ea6a5d5"
integrity sha512-IzUrpE5eP61N7aeLGXNqBbqz4BzzvRi0v6B5a4Yn/5QqSs/HPZvWXTNK9z4svur01ZJezFIYwy5psb6R3YpVJg==
dependencies:
hermes-estree "0.19.2"
hermes-parser "0.19.2"
prettier-plugin-hermes-parser "0.19.2"
hermes-estree "0.20.0"
hermes-parser "0.20.0"
prettier-plugin-hermes-parser "0.20.0"
prettier@2.8.8:
version "2.8.8"