Closed tobias-tengler closed 3 months ago
@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 facebook/relay@d3c8d1c2330013d178c159f4418407ed41528283.
Thanks for merging :) I just wanted to play around with it in our real codebase and noticed that we're still blocked by eslint-plugin-relay's graphql-syntax rule until we get https://github.com/graphql/graphql-js/pull/4015 :/ Fingers crossed it lands soon!
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 https://github.com/graphql/graphql-js/pull/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_transform
feature flag that allows to enable the existing parsing and transform of fragment variable definitions and fragment spread arguments.