-
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
Use hermes-parser for Flow codegen specs #39036
Conversation
This pull request was exported from Phabricator. Differential Revision: D48384078 |
Base commit: 5a7ae61 |
This pull request was exported from Phabricator. Differential Revision: D48384078 |
Summary: Pull Request resolved: facebook#39036 Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078 fbshipit-source-id: 1159012219e5f47110a68ba532899afbc102beaa
a53d1dd
to
6647bb6
Compare
This pull request was exported from Phabricator. Differential Revision: D48384078 |
Summary: Pull Request resolved: facebook#39036 Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078 fbshipit-source-id: 73366ea213d3083da6bc732a0e00f9a217a4fc21
6647bb6
to
5243618
Compare
This pull request was exported from Phabricator. Differential Revision: D48384078 |
Summary: Pull Request resolved: facebook#39036 Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078 fbshipit-source-id: 9f765c472c06fabfaf743eae59aaeeec7a1b3550
5243618
to
8a5b6ca
Compare
This pull request was exported from Phabricator. Differential Revision: D48384078 |
Summary: Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078
8a5b6ca
to
66c88ff
Compare
Summary: Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078
66c88ff
to
ac22ddc
Compare
This pull request was exported from Phabricator. Differential Revision: D48384078 |
…cebook#39035) Summary: Changelog: [General][Fixed] Flow syntax errors in Codegen specs are no longer ignored. Instead of throwing errors like most parsers, the `flow-parser` package returns errors as part of the AST (along with a best-effort parse). It turns out that `react-native/codegen` ignores such errors and only detects a subset of them after the fact. Here we change the behaviour to immediately throwing a descriptive error message (containing the file name and a code frame). **This change is theoretically breaking** for any published packages that already contain broken Flow code (that somehow doesn't happen to affect the Codegen output today). Hopefully, anyone using Flow-flavoured RN Codegen is also typechecking with Flow and/or building with Metro (which would both flag the same errors), so the impact should be fairly contained. Reviewed By: huntie Differential Revision: D48385786
Summary: Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078
ac22ddc
to
bfc87f6
Compare
This pull request was exported from Phabricator. Differential Revision: D48384078 |
This pull request has been merged in 5abaf38. |
Summary: Pull Request resolved: facebook#39036 Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs. `hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety. Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement. In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself. Reviewed By: huntie Differential Revision: D48384078 fbshipit-source-id: 310ad150ec62671ba395b0e2f6415ccae97ac04d
Summary:
Changelog: [General][Changed] Use
hermes-parser
instead offlow-parser
to parse Flow Codegen specs.hermes-parser
is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared toflow-parser
) include better performance and improved type safety.Here we update
react-native/codegen
to usehermes-parser
instead offlow-parser
. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement.In future work we should be able to use the improved AST types available in
hermes-estree
to improve type safety withinreact-native/codegen
itself.Differential Revision: D48384078