-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Universe: use Relay 13 and the new Rust Compiler
This commit upgrades Relay to version 13 and switches from the old Relay Compiler to the new Rust one (since both things go together). Basically, the main change is that now we have only one Relay config for the whole monorepo and the compiler is being executed for the whole monorepo as well (while being much faster). Additionally, Relay support is directly integrated into Flow so in many cases I simply removed previous Flow types (see `useLazyLoadQuery` and `useFragment`). There is still ongoing effort to improve the Flow types in Relay so not everything is finalized. For this reason I decided to use "Compat" types mode. Similarly, some hooks (`useMutation` and `usePreloadedQuery` for example) still require explicit types information so I didn't change these yet. Regardless of that, we are pretty close to use "Final" types. We just need to wait for the Relay team to finish everything. Many issues were already resolved but there are still some that need to be fixed (not blocking this PR): - facebook/relay#3700 - relayjs/eslint-plugin-relay#131 - prettier/prettier#6102 Important links with additional information: - https://relay.dev/blog/2021/12/08/introducing-the-new-relay-compiler/ - https://github.com/facebook/relay/releases/tag/v13.0.0 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.0 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.1 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.2
- Loading branch information
Showing
116 changed files
with
2,080 additions
and
2,695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// @flow strict | ||
|
||
module.exports = { | ||
root: '.', | ||
sources: { | ||
'src/abacus-backoffice': 'abacus', | ||
'src/abacus-kochka': 'abacus', | ||
'src/example-relay': 'example-relay', | ||
}, | ||
excludes: ['**/__flowtests__/**'], | ||
codegenCommand: './node_modules/.bin/relay-compiler', | ||
projects: { | ||
'abacus': { | ||
language: 'flow', | ||
flowEnums: [ | ||
// TODO: doesn't work (https://github.com/facebook/relay/issues/3596#issuecomment-1003148218) | ||
'SupportedCurrency', | ||
'SupportedLocale', | ||
], | ||
flowTypegen: { | ||
phase: 'Compat', // TODO: "Final" | ||
}, | ||
schema: 'src/abacus/schema.graphql', | ||
customScalarTypes: { | ||
ProductImageUploadable: 'string', | ||
}, | ||
testPathRegex: '__tests__', | ||
featureFlags: { | ||
no_inline: { kind: 'enabled' }, | ||
}, | ||
}, | ||
'example-relay': { | ||
language: 'flow', | ||
flowTypegen: { | ||
phase: 'Compat', // TODO: "Final" | ||
}, | ||
schema: 'src/example-relay/schema.graphql', | ||
schemaExtensions: ['src/example-relay/src/LocalForm'], | ||
}, | ||
}, | ||
isDevVariableName: '__DEV__', | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 26 additions & 24 deletions
50
src/abacus-backoffice/src/__generated__/AuthButtonsAuthorizeWebappMutation.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
50 changes: 27 additions & 23 deletions
50
src/abacus-backoffice/src/__generated__/AuthButtonsDeauthorizeWebappMutation.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 26 additions & 21 deletions
47
src/abacus-backoffice/src/__generated__/NavigationHeaderBadgeQuery.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.