Skip to content

Commit 48c5424

Browse files
pietervfacebook-github-bot
authored andcommitted
Upgrade xplat/js + arvr/js to hermes-parser 0.16.0 (again) (#39819)
Summary: Pull Request resolved: #39819 Bump `hermes-parser` packages to the latest released version. Changelog: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md Notable changes: - Upgraded to the lastest version of emscripten for the parser. - The babel interop logic now more closely matches babel's AST. - The biggest change is we now add the `extra.raw` properties to literal nodes, which results in Babel more closely outputting literal sources. e.g. previously the following would happen `1.0` -> `1`, `'foo'` -> `"foo"` and `1n` -> `1` but now the raw source value is preserved. - Upgraded `prettier-plugin-hermes-parser` to use the latest prettier formatting logic, which causes some minor formatting changes. - `hermes-parser` no longer fails when the `component` name is used within a function type, e.g. `type Foo = (component: string) => void`. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D49935231 fbshipit-source-id: a905838396fdd7281442c211970e0caa773a1256
1 parent b58db61 commit 48c5424

File tree

4 files changed

+46
-45
lines changed

4 files changed

+46
-45
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@
8383
"eslint-plugin-react-native": "^4.0.0",
8484
"eslint-plugin-redundant-undefined": "^0.4.0",
8585
"eslint-plugin-relay": "^1.8.3",
86-
"flow-api-translator": "0.15.0",
86+
"flow-api-translator": "0.16.0",
8787
"flow-bin": "^0.217.2",
8888
"glob": "^7.1.1",
89-
"hermes-eslint": "0.15.0",
89+
"hermes-eslint": "0.16.0",
9090
"inquirer": "^7.1.0",
9191
"jest": "^29.6.3",
9292
"jest-junit": "^10.0.0",
@@ -98,7 +98,7 @@
9898
"mock-fs": "^5.1.4",
9999
"nullthrows": "^1.1.1",
100100
"prettier": "2.8.8",
101-
"prettier-plugin-hermes-parser": "0.14.0",
101+
"prettier-plugin-hermes-parser": "0.16.0",
102102
"react": "18.2.0",
103103
"react-test-renderer": "18.2.0",
104104
"rimraf": "^3.0.2",

packages/react-native-babel-transformer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@babel/core": "^7.20.0",
1919
"@react-native/babel-preset": "*",
20-
"hermes-parser": "0.15.0",
20+
"hermes-parser": "0.16.0",
2121
"nullthrows": "^1.1.1"
2222
},
2323
"peerDependencies": {

packages/react-native-babel-transformer/src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,13 @@ const transform /*: BabelTransformer['transform'] */ = ({
202202
// You get this behavior by default when using Babel's `transform` method directly.
203203
cloneInputAst: false,
204204
};
205-
const sourceAst =
205+
const sourceAst /*: BabelNodeFile */ =
206206
isTypeScriptSource(filename) ||
207207
isTSXSource(filename) ||
208208
!options.hermesParser
209209
? parseSync(src, babelConfig)
210-
: require('hermes-parser').parse(src, {
210+
: // $FlowFixMe[incompatible-exact]
211+
require('hermes-parser').parse(src, {
211212
babel: true,
212213
sourceType: babelConfig.sourceType,
213214
});

yarn.lock

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5025,18 +5025,18 @@ flatted@^3.1.0:
50255025
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561"
50265026
integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==
50275027

5028-
flow-api-translator@0.15.0:
5029-
version "0.15.0"
5030-
resolved "https://registry.yarnpkg.com/flow-api-translator/-/flow-api-translator-0.15.0.tgz#3df5af2d45630251f12782679271dc2533bcf094"
5031-
integrity sha512-cH5Fo08kQO0vucJfcQqMAPc2De8ooVX/9AhBUiRDhe+Ob98HOSBJamaiFLgTmC9UVnSyIFRKgpG+RRopHWtjwg==
5028+
flow-api-translator@0.16.0:
5029+
version "0.16.0"
5030+
resolved "https://registry.yarnpkg.com/flow-api-translator/-/flow-api-translator-0.16.0.tgz#c1f9a23ccf756d0b7cc7d168da1dc4203ee4fdc0"
5031+
integrity sha512-wIaR2K/NfIa9YllPHO2m6TQPabMFFL8u08ix+aohul0F23+sTQyePGtqOuqWGm63E16sBgh/uPYcsw+/xZoFWA==
50325032
dependencies:
50335033
"@babel/code-frame" "^7.16.0"
50345034
"@typescript-eslint/visitor-keys" "^5.42.0"
50355035
flow-enums-runtime "^0.0.6"
5036-
hermes-eslint "0.15.0"
5037-
hermes-estree "0.15.0"
5038-
hermes-parser "0.15.0"
5039-
hermes-transform "0.15.0"
5036+
hermes-eslint "0.16.0"
5037+
hermes-estree "0.16.0"
5038+
hermes-parser "0.16.0"
5039+
hermes-transform "0.16.0"
50405040

50415041
flow-bin@^0.217.2:
50425042
version "0.217.2"
@@ -5420,31 +5420,24 @@ has@^1.0.3:
54205420
dependencies:
54215421
function-bind "^1.1.1"
54225422

5423-
hermes-eslint@0.15.0:
5424-
version "0.15.0"
5425-
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.15.0.tgz#4d7495cb5e0e9275a1fb0b465b88fccf0b6d8840"
5426-
integrity sha512-Rd12uW9FZdOTDDwpVdYUxZGEApskUzBfKYy9RMtczm2uprX8yviPb9QVSVn2hl+xuRTA7Z0FnqDwOwXGiinsRQ==
5423+
hermes-eslint@0.16.0:
5424+
version "0.16.0"
5425+
resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.16.0.tgz#f377e7e0260c82d687f4efedff4ae1a4a193359f"
5426+
integrity sha512-8EFCiVY5Sv7fYaje31HgaUIpe5DrRlx8luQ6Cgj9wyVpNpSMoVeoXHsWS2MEA4CHuWKItM1mACB5E4snBQxV/g==
54275427
dependencies:
54285428
esrecurse "^4.3.0"
5429-
hermes-estree "0.15.0"
5430-
hermes-parser "0.15.0"
5431-
5432-
5433-
version "0.14.0"
5434-
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.14.0.tgz#c663eea1400980802283338a09d0087c448729e7"
5435-
integrity sha512-L6M67+0/eSEbt6Ha2XOBFXL++7MR34EOJMgm+j7YCaI4L/jZqrVAg6zYQKzbs1ZCFDLvEQpOgLlapTX4gpFriA==
5429+
hermes-estree "0.16.0"
5430+
hermes-parser "0.16.0"
54365431

54375432
54385433
version "0.15.0"
54395434
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.15.0.tgz#e32f6210ab18c7b705bdcb375f7700f2db15d6ba"
54405435
integrity sha512-lLYvAd+6BnOqWdnNbP/Q8xfl8LOGw4wVjfrNd9Gt8eoFzhNBRVD95n4l2ksfMVOoxuVyegs85g83KS9QOsxbVQ==
54415436

5442-
5443-
version "0.14.0"
5444-
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.14.0.tgz#edb2e7172fce996d2c8bbba250d140b70cc1aaaf"
5445-
integrity sha512-pt+8uRiJhVlErY3fiXB3gKhZ72RxM6E1xRMpvfZ5n6Z5TQKQQXKorgRCRzoe02mmvLKBJFP5nPDGv75MWAgCTw==
5446-
dependencies:
5447-
hermes-estree "0.14.0"
5437+
5438+
version "0.16.0"
5439+
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.16.0.tgz#e2c76a1e9d5a4d620790b9fe05fb01f2d53da07d"
5440+
integrity sha512-XCoTuBU8S+Jg8nFzaqgy6pNEYo0WYkbMmuJldb3svzpJ2SNUYJDg28b1ltoDMo7k3YlJwPRg7ZS3JTWV3DkDZA==
54485441

54495442
54505443
version "0.15.0"
@@ -5453,24 +5446,31 @@ [email protected]:
54535446
dependencies:
54545447
hermes-estree "0.15.0"
54555448

5449+
5450+
version "0.16.0"
5451+
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.16.0.tgz#92d0a34ff4f9b7ffcb04511dfed0cc19df5038e0"
5452+
integrity sha512-tdJJntb45DUpv8j7ybHfq8NfIQgz8AgaD+PVFyfjK+O+v2N5zbsSDtlvQN2uxCghoTkQL86BEs9oi8IPrUE9Pg==
5453+
dependencies:
5454+
hermes-estree "0.16.0"
5455+
54565456
hermes-profile-transformer@^0.0.6:
54575457
version "0.0.6"
54585458
resolved "https://registry.yarnpkg.com/hermes-profile-transformer/-/hermes-profile-transformer-0.0.6.tgz#bd0f5ecceda80dd0ddaae443469ab26fb38fc27b"
54595459
integrity sha512-cnN7bQUm65UWOy6cbGcCcZ3rpwW8Q/j4OP5aWRhEry4Z2t2aR1cjrbp0BS+KiBN0smvP1caBgAuxutvyvJILzQ==
54605460
dependencies:
54615461
source-map "^0.7.3"
54625462

5463-
hermes-transform@0.15.0:
5464-
version "0.15.0"
5465-
resolved "https://registry.yarnpkg.com/hermes-transform/-/hermes-transform-0.15.0.tgz#5509cf6993abafbdc32528098d287f5c91eef52c"
5466-
integrity sha512-ACGdssuE2mcu/qSwSfie1yWQs5IBRYy7yokPbdCkHd4M0jPqCiQbwrlRzQP0+XgyZPooINXWHxkhsI5Iffhppw==
5463+
hermes-transform@0.16.0:
5464+
version "0.16.0"
5465+
resolved "https://registry.yarnpkg.com/hermes-transform/-/hermes-transform-0.16.0.tgz#f2ba027f558d5c59398f807683ade66adda37b69"
5466+
integrity sha512-8jckjt5WG+k/zIFSFe1VyTn4xnAJy9Hdej1/9vx0LUEwHXqCwHSasatwuZiF3oKjXX+q92lc33Nrpv1Ixl1gBw==
54675467
dependencies:
54685468
"@babel/code-frame" "^7.16.0"
54695469
esquery "^1.4.0"
54705470
flow-enums-runtime "^0.0.6"
5471-
hermes-eslint "0.15.0"
5472-
hermes-estree "0.15.0"
5473-
hermes-parser "0.15.0"
5471+
hermes-eslint "0.16.0"
5472+
hermes-estree "0.16.0"
5473+
hermes-parser "0.16.0"
54745474

54755475
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
54765476
version "1.0.3"
@@ -7756,14 +7756,14 @@ prettier-linter-helpers@^1.0.0:
77567756
dependencies:
77577757
fast-diff "^1.1.2"
77587758

7759-
prettier-plugin-hermes-parser@0.14.0:
7760-
version "0.14.0"
7761-
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.14.0.tgz#1b5122c14b949bfae96541bbeb39cdd15962a072"
7762-
integrity sha512-L3QtrNCVYUhN56oAvlkSYnwdOPgYxjBo1Fg+ApXTFUSk+b3uKcMlUqo6j0WZk4QKYtTtDwZcTT1Zl9VIF/7nDg==
7759+
prettier-plugin-hermes-parser@0.16.0:
7760+
version "0.16.0"
7761+
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.16.0.tgz#4393d43a4a6f4ed976493dccbbb93f62c44215c3"
7762+
integrity sha512-J4HdSmlxf3a0nVHVi0G6JJJ7sDVtSb5a+QR52LpiQonpQzMkqgIqyCg+Gt1sGMTJqn19Z0yTHxwCmUicVYXUVg==
77637763
dependencies:
7764-
hermes-estree "0.14.0"
7765-
hermes-parser "0.14.0"
7766-
prettier-plugin-hermes-parser "0.14.0"
7764+
hermes-estree "0.16.0"
7765+
hermes-parser "0.16.0"
7766+
prettier-plugin-hermes-parser "0.16.0"
77677767

77687768
77697769
version "2.8.8"

0 commit comments

Comments
 (0)