Add feature flag for fragment arguments#4648
Add feature flag for fragment arguments#4648tobias-tengler wants to merge 3 commits intofacebook:mainfrom
Conversation
| ) -> DiagnosticsResult<ExecutableDocument> { | ||
| parse_executable_with_error_recovery_and_parser_features(source, source_location, features) | ||
| .into() | ||
| } |
There was a problem hiding this comment.
Is this a meaningful change, or is the function just moving?
There was a problem hiding this comment.
Just moving the function around. The grouping felt weird.
|
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
What do you think about adding an integration test fixture here: https://github.com/facebook/relay/tree/c2d0901e0ac535e36f94fa23b1e4dfc9324e3bc7/compiler/crates/relay-compiler/tests/relay_compiler_integration/fixtures? Could validate that with the flag enabled we correctly parse the new syntax |
|
Sounds good, one sec :) |
|
@captbaritone Done! |
|
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@captbaritone merged this pull request in d3c8d1c. |
|
Thanks for merging :) |
|
Actually I'm not really sure why we need that rule in the first place. Seems like it could be fully replaced by the compiler, if the compiler were to ensure that only one definition exists within each graphql-tagged-literal. Or is there another reason why we'd need the Lint Rule as well? |
|
@tobias-tengler I looked into this same thing a bit yesterday from an internal perspective: "What would it take to enable this internally".
I think Prettier is the big blocker here. We have to have auto-format working and that will depend upon graphql/graphql-js#4015 landing in a stable enough release that Prettier can adopt it, and then also waiting on Prettier cutting some type of release. |
|
Update: I looked into the syntax highlighting issue for internal use at Meta, and Flow still depends upon https://github.com/michaelgmcd/vscode-language-babel/ for syntax highlighting and it defines its own GraphQL syntax highlighting still. I think it should probably just opt to pull in https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql-syntax as a dependency instead (as we do with Relay's own VSCode extension) |
Adds a new
enable_fragment_argument_transformfeature flag that allows to enable the existing parsing and transform of fragment variable definitions and fragment spread arguments.