-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[WIP] Refactoring of the type generation/type assertion for provided variables to support internal use case with shared artifacts. #4429
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
base: main
Are you sure you want to change the base?
Conversation
This pull request was exported from Phabricator. Differential Revision: D48801823 |
@alunyov has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was exported from Phabricator. Differential Revision: D48801823 |
…les to support internal use case with shared artifacts. (facebook#4429) Summary: Pull Request resolved: facebook#4429 Differential Revision: D48801823 Pulled By: alunyov fbshipit-source-id: bcfd9ee731f9314f46d0ccb6953d1e8015c2bda9
dd0091a
to
d1f3f8b
Compare
@alunyov has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was exported from Phabricator. Differential Revision: D48801823 |
…les to support internal use case with shared artifacts. (facebook#4429) Summary: Pull Request resolved: facebook#4429 Differential Revision: D48801823 Pulled By: alunyov fbshipit-source-id: 91f7249105ac90652d8c257954dfcc4fa87467af
d1f3f8b
to
82bbc4a
Compare
@alunyov has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…les to support internal use case with shared artifacts. (facebook#4429) Summary: The main goal is to separate `codegen` and `typegen` for provided variables. Currently, there is an implicit dependency between `typegen` and `codegen` where were generating code for provided variables. The `codegen` expects the local type for provided variables to always be generated as `type ProvidedVariables` so we cam enable inline type assertion as ``` var providedVariables: ProvidedVariables = { ... object with provided variables ... } ``` However, this approach doesn't work well with the `skip_types` option, where the `typegen` block for an operation is completely skipped (without the `skip_types` we would generate a type for `ProvidedVariables` in it), but the type inline assertion still remains in the `relay-codegen`. The proposed solution is to make this dependency explicit by passing the generated provided variables object to the method responsible for generating types. Additionally, the type assertion should only be generated in the `relay-typegen`. --- Pull Request resolved: facebook#4429 Test Plan: TBD Differential Revision: D48801823 Pulled By: alunyov fbshipit-source-id: 556098bb2ad2457d451b5e77bc38fdb568df2d08
This pull request was exported from Phabricator. Differential Revision: D48801823 |
5a630e6
to
04044ba
Compare
Differential Revision: D48801823